xref: /PHP-7.4/scripts/php-config.in (revision 68724e24)
1f2f8d38eSSascha Schumann#! /bin/sh
2f2f8d38eSSascha Schumann
3*68724e24SfoobarSED="@SED@"
4574eaa8eSHartmut Holzgraefeprefix="@prefix@"
5ee5fd96eSfoobarexec_prefix="@exec_prefix@"
61d475375Sfoobarversion="@PHP_VERSION@"
7*68724e24Sfoobarvernum="@PHP_VERSION_ID@"
8*68724e24Sfoobarinclude_dir="@includedir@/php"
937d4fa7bSfoobarincludes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext -I$includedir/ext/date/lib"
1020c43285Sfoobarldflags="@PHP_LDFLAGS@"
1104bb45cfSStig Bakkenlibs="@EXTRA_LIBS@"
12cae3b7dfSSascha Schumannextension_dir='@EXTENSION_DIR@'
13ee5fd96eSfoobarprogram_prefix="@program_prefix@"
14ee5fd96eSfoobarprogram_suffix="@program_suffix@"
15ee5fd96eSfoobarexe_extension="@EXEEXT@"
16*68724e24Sfoobarphp_cli_binary=NONE
17*68724e24Sfoobarphp_cgi_binary=NONE
18*68724e24Sfoobarconfigure_options="@CONFIGURE_OPTIONS@"
19*68724e24Sfoobarphp_sapis="@PHP_INSTALLED_SAPIS@"
20*68724e24Sfoobar
21*68724e24Sfoobar# Set php_cli_binary and php_cgi_binary if available
22*68724e24Sfoobarfor sapi in $php_sapis; do
23*68724e24Sfoobar  case $sapi in
24*68724e24Sfoobar  cli)
25*68724e24Sfoobar    php_cli_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}"
26*68724e24Sfoobar    ;;
27*68724e24Sfoobar  cgi)
28*68724e24Sfoobar    php_cgi_binary="@bindir@/${program_prefix}php-cgi${program_suffix}${exe_extension}"
29*68724e24Sfoobar    ;;
30*68724e24Sfoobar  esac
31*68724e24Sfoobardone
32*68724e24Sfoobar
33*68724e24Sfoobar# Determine which (if any) php binary is available
34*68724e24Sfoobarif test "$php_cli_binary" != "NONE"; then
35*68724e24Sfoobar  php_binary="$php_cli_binary"
36*68724e24Sfoobarelse
37*68724e24Sfoobar  php_binary="$php_cgi_binary"
38*68724e24Sfoobarfi
39*68724e24Sfoobar
40*68724e24Sfoobar# Remove quotes
41*68724e24Sfoobarconfigure_options="`echo $configure_options | $SED -e "s#'##g"`"
42f2f8d38eSSascha Schumann
43f2f8d38eSSascha Schumanncase "$1" in
44f2f8d38eSSascha Schumann--prefix)
45*68724e24Sfoobar  echo $prefix;;
46f2f8d38eSSascha Schumann--includes)
47*68724e24Sfoobar  echo $includes;;
4820c43285Sfoobar--ldflags)
49*68724e24Sfoobar  echo $ldflags;;
5004bb45cfSStig Bakken--libs)
51*68724e24Sfoobar  echo $libs;;
52cae3b7dfSSascha Schumann--extension-dir)
53*68724e24Sfoobar  echo $extension_dir;;
54bcade7ceSfoobar--include-dir)
55*68724e24Sfoobar  echo $include_dir;;
56ee5fd96eSfoobar--php-binary)
57*68724e24Sfoobar  echo $php_binary;;
58*68724e24Sfoobar--php-sapis)
59*68724e24Sfoobar  echo $php_sapis;;
60*68724e24Sfoobar--configure-options)
61*68724e24Sfoobar  echo $configure_options;;
62ecb2b081SStig Bakken--version)
63*68724e24Sfoobar  echo $version;;
64f0fe4e05Sfoobar--vernum)
65*68724e24Sfoobar  echo $vernum;;
66f2f8d38eSSascha Schumann*)
67*68724e24Sfoobar  cat << EOF
68*68724e24SfoobarUsage: $0 [OPTION]
69*68724e24SfoobarOptions:
70*68724e24Sfoobar  --prefix            [$prefix]
71*68724e24Sfoobar  --includes          [$includes]
72*68724e24Sfoobar  --ldflags           [$ldflags]
73*68724e24Sfoobar  --libs              [$libs]
74*68724e24Sfoobar  --extension-dir     [$extension_dir]
75*68724e24Sfoobar  --include-dir       [$include_dir]
76*68724e24Sfoobar  --php-binary        [$php_binary]
77*68724e24Sfoobar  --php-sapis         [$php_sapis]
78*68724e24Sfoobar  --configure-options [$configure_options]
79*68724e24Sfoobar  --version           [$version]
80*68724e24Sfoobar  --vernum            [$vernum]
81*68724e24SfoobarEOF
82*68724e24Sfoobar  exit 1;;
83f2f8d38eSSascha Schumannesac
84f2f8d38eSSascha Schumann
85f2f8d38eSSascha Schumannexit 0
86