xref: /PHP-7.4/scripts/php-config.in (revision 6e25d4f4)
1f2f8d38eSSascha Schumann#! /bin/sh
2f2f8d38eSSascha Schumann
368724e24SfoobarSED="@SED@"
4574eaa8eSHartmut Holzgraefeprefix="@prefix@"
5ee5fd96eSfoobarexec_prefix="@exec_prefix@"
61d475375Sfoobarversion="@PHP_VERSION@"
768724e24Sfoobarvernum="@PHP_VERSION_ID@"
868724e24Sfoobarinclude_dir="@includedir@/php"
9*6e25d4f4Sfoobarincludes="-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"
1020c43285Sfoobarldflags="@PHP_LDFLAGS@"
1104bb45cfSStig Bakkenlibs="@EXTRA_LIBS@"
12cae3b7dfSSascha Schumannextension_dir='@EXTENSION_DIR@'
13ee5fd96eSfoobarprogram_prefix="@program_prefix@"
14ee5fd96eSfoobarprogram_suffix="@program_suffix@"
15ee5fd96eSfoobarexe_extension="@EXEEXT@"
1668724e24Sfoobarphp_cli_binary=NONE
1768724e24Sfoobarphp_cgi_binary=NONE
1868724e24Sfoobarconfigure_options="@CONFIGURE_OPTIONS@"
1968724e24Sfoobarphp_sapis="@PHP_INSTALLED_SAPIS@"
2068724e24Sfoobar
2168724e24Sfoobar# Set php_cli_binary and php_cgi_binary if available
2268724e24Sfoobarfor sapi in $php_sapis; do
2368724e24Sfoobar  case $sapi in
2468724e24Sfoobar  cli)
2568724e24Sfoobar    php_cli_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}"
2668724e24Sfoobar    ;;
2768724e24Sfoobar  cgi)
2868724e24Sfoobar    php_cgi_binary="@bindir@/${program_prefix}php-cgi${program_suffix}${exe_extension}"
2968724e24Sfoobar    ;;
3068724e24Sfoobar  esac
3168724e24Sfoobardone
3268724e24Sfoobar
3368724e24Sfoobar# Determine which (if any) php binary is available
3468724e24Sfoobarif test "$php_cli_binary" != "NONE"; then
3568724e24Sfoobar  php_binary="$php_cli_binary"
3668724e24Sfoobarelse
3768724e24Sfoobar  php_binary="$php_cgi_binary"
3868724e24Sfoobarfi
3968724e24Sfoobar
4068724e24Sfoobar# Remove quotes
4168724e24Sfoobarconfigure_options="`echo $configure_options | $SED -e "s#'##g"`"
42f2f8d38eSSascha Schumann
43f2f8d38eSSascha Schumanncase "$1" in
44f2f8d38eSSascha Schumann--prefix)
4568724e24Sfoobar  echo $prefix;;
46f2f8d38eSSascha Schumann--includes)
4768724e24Sfoobar  echo $includes;;
4820c43285Sfoobar--ldflags)
4968724e24Sfoobar  echo $ldflags;;
5004bb45cfSStig Bakken--libs)
5168724e24Sfoobar  echo $libs;;
52cae3b7dfSSascha Schumann--extension-dir)
5368724e24Sfoobar  echo $extension_dir;;
54bcade7ceSfoobar--include-dir)
5568724e24Sfoobar  echo $include_dir;;
56ee5fd96eSfoobar--php-binary)
5768724e24Sfoobar  echo $php_binary;;
5868724e24Sfoobar--php-sapis)
5968724e24Sfoobar  echo $php_sapis;;
6068724e24Sfoobar--configure-options)
6168724e24Sfoobar  echo $configure_options;;
62ecb2b081SStig Bakken--version)
6368724e24Sfoobar  echo $version;;
64f0fe4e05Sfoobar--vernum)
6568724e24Sfoobar  echo $vernum;;
66f2f8d38eSSascha Schumann*)
6768724e24Sfoobar  cat << EOF
6868724e24SfoobarUsage: $0 [OPTION]
6968724e24SfoobarOptions:
7068724e24Sfoobar  --prefix            [$prefix]
7168724e24Sfoobar  --includes          [$includes]
7268724e24Sfoobar  --ldflags           [$ldflags]
7368724e24Sfoobar  --libs              [$libs]
7468724e24Sfoobar  --extension-dir     [$extension_dir]
7568724e24Sfoobar  --include-dir       [$include_dir]
7668724e24Sfoobar  --php-binary        [$php_binary]
7768724e24Sfoobar  --php-sapis         [$php_sapis]
7868724e24Sfoobar  --configure-options [$configure_options]
7968724e24Sfoobar  --version           [$version]
8068724e24Sfoobar  --vernum            [$vernum]
8168724e24SfoobarEOF
8268724e24Sfoobar  exit 1;;
83f2f8d38eSSascha Schumannesac
84f2f8d38eSSascha Schumann
85f2f8d38eSSascha Schumannexit 0
86