xref: /PHP-5.3/scripts/php-config.in (revision 5ca8ba7a)
1#! /bin/sh
2
3SED="@SED@"
4prefix="@prefix@"
5exec_prefix="@exec_prefix@"
6version="@PHP_VERSION@"
7vernum="@PHP_VERSION_ID@"
8include_dir="@includedir@/php"
9includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib"
10ldflags="@PHP_LDFLAGS@"
11libs="@EXTRA_LIBS@"
12extension_dir='@EXTENSION_DIR@'
13man_dir=`eval echo @mandir@`
14program_prefix="@program_prefix@"
15program_suffix="@program_suffix@"
16exe_extension="@EXEEXT@"
17php_cli_binary=NONE
18php_cgi_binary=NONE
19configure_options="@CONFIGURE_OPTIONS@"
20php_sapis="@PHP_INSTALLED_SAPIS@"
21
22# Set php_cli_binary and php_cgi_binary if available
23for sapi in $php_sapis; do
24  case $sapi in
25  cli)
26    php_cli_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}"
27    ;;
28  cgi)
29    php_cgi_binary="@bindir@/${program_prefix}php-cgi${program_suffix}${exe_extension}"
30    ;;
31  esac
32done
33
34# Determine which (if any) php binary is available
35if test "$php_cli_binary" != "NONE"; then
36  php_binary="$php_cli_binary"
37else
38  php_binary="$php_cgi_binary"
39fi
40
41# Remove quotes
42configure_options=`echo $configure_options | $SED -e "s#'##g"`
43
44case "$1" in
45--prefix)
46  echo $prefix;;
47--includes)
48  echo $includes;;
49--ldflags)
50  echo $ldflags;;
51--libs)
52  echo $libs;;
53--extension-dir)
54  echo $extension_dir;;
55--include-dir)
56  echo $include_dir;;
57--php-binary)
58  echo $php_binary;;
59--php-sapis)
60  echo $php_sapis;;
61--configure-options)
62  echo $configure_options;;
63--man-dir)
64  echo $man_dir;;
65--version)
66  echo $version;;
67--vernum)
68  echo $vernum;;
69*)
70  cat << EOF
71Usage: $0 [OPTION]
72Options:
73  --prefix            [$prefix]
74  --includes          [$includes]
75  --ldflags           [$ldflags]
76  --libs              [$libs]
77  --extension-dir     [$extension_dir]
78  --include-dir       [$include_dir]
79  --man-dir           [$man_dir]
80  --php-binary        [$php_binary]
81  --php-sapis         [$php_sapis]
82  --configure-options [$configure_options]
83  --version           [$version]
84  --vernum            [$vernum]
85EOF
86  exit 1;;
87esac
88
89exit 0
90