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