xref: /PHP-8.0/scripts/php-config.in (revision 2d5f277a)
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@"
22ini_dir="@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@"
23ini_path="@EXPANDED_PHP_CONFIG_FILE_PATH@"
24
25# Set php_cli_binary and php_cgi_binary if available
26for sapi in $php_sapis; do
27  case $sapi in
28  cli)
29    php_cli_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}"
30    ;;
31  cgi)
32    php_cgi_binary="@bindir@/${program_prefix}php-cgi${program_suffix}${exe_extension}"
33    ;;
34  esac
35done
36
37# Determine which (if any) php binary is available
38if test "$php_cli_binary" != "NONE"; then
39  php_binary="$php_cli_binary"
40else
41  php_binary="$php_cgi_binary"
42fi
43
44# Remove quotes
45configure_options=`echo $configure_options | $SED -e "s#'##g"`
46
47case "$1" in
48--prefix)
49  echo $prefix;;
50--includes)
51  echo $includes;;
52--ldflags)
53  echo $ldflags;;
54--libs)
55  echo $libs;;
56--extension-dir)
57  echo $extension_dir;;
58--include-dir)
59  echo $include_dir;;
60--php-binary)
61  echo $php_binary;;
62--php-sapis)
63  echo $php_sapis;;
64--configure-options)
65  echo $configure_options;;
66--man-dir)
67  echo $man_dir;;
68--ini-path)
69  echo $ini_path;;
70--ini-dir)
71  echo $ini_dir;;
72--version)
73  echo $version;;
74--vernum)
75  echo $vernum;;
76*)
77  cat << EOF
78Usage: $0 [OPTION]
79Options:
80  --prefix            [$prefix]
81  --includes          [$includes]
82  --ldflags           [$ldflags]
83  --libs              [$libs]
84  --extension-dir     [$extension_dir]
85  --include-dir       [$include_dir]
86  --man-dir           [$man_dir]
87  --php-binary        [$php_binary]
88  --php-sapis         [$php_sapis]
89  --ini-path          [$ini_path]
90  --ini-dir           [$ini_dir]
91  --configure-options [$configure_options]
92  --version           [$version]
93  --vernum            [$vernum]
94EOF
95  exit 1;;
96esac
97
98exit 0
99