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