xref: /PHP-7.4/scripts/php-config.in (revision 2d5f277a)
1f2f8d38eSSascha Schumann#! /bin/sh
2f2f8d38eSSascha Schumann
368724e24SfoobarSED="@SED@"
4574eaa8eSHartmut Holzgraefeprefix="@prefix@"
5438cc7f2SRasmus Lerdorfdatarootdir="@datarootdir@"
6ee5fd96eSfoobarexec_prefix="@exec_prefix@"
71d475375Sfoobarversion="@PHP_VERSION@"
868724e24Sfoobarvernum="@PHP_VERSION_ID@"
968724e24Sfoobarinclude_dir="@includedir@/php"
106e25d4f4Sfoobarincludes="-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"
1120c43285Sfoobarldflags="@PHP_LDFLAGS@"
1204bb45cfSStig Bakkenlibs="@EXTRA_LIBS@"
13cae3b7dfSSascha Schumannextension_dir='@EXTENSION_DIR@'
14988b8a9cSHannes Magnussonman_dir=`eval echo @mandir@`
15ee5fd96eSfoobarprogram_prefix="@program_prefix@"
16ee5fd96eSfoobarprogram_suffix="@program_suffix@"
17ee5fd96eSfoobarexe_extension="@EXEEXT@"
1868724e24Sfoobarphp_cli_binary=NONE
1968724e24Sfoobarphp_cgi_binary=NONE
2068724e24Sfoobarconfigure_options="@CONFIGURE_OPTIONS@"
2168724e24Sfoobarphp_sapis="@PHP_INSTALLED_SAPIS@"
22*2d5f277aSJoe Watkinsini_dir="@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@"
23*2d5f277aSJoe Watkinsini_path="@EXPANDED_PHP_CONFIG_FILE_PATH@"
2468724e24Sfoobar
2568724e24Sfoobar# Set php_cli_binary and php_cgi_binary if available
2668724e24Sfoobarfor sapi in $php_sapis; do
2768724e24Sfoobar  case $sapi in
2868724e24Sfoobar  cli)
2968724e24Sfoobar    php_cli_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}"
3068724e24Sfoobar    ;;
3168724e24Sfoobar  cgi)
3268724e24Sfoobar    php_cgi_binary="@bindir@/${program_prefix}php-cgi${program_suffix}${exe_extension}"
3368724e24Sfoobar    ;;
3468724e24Sfoobar  esac
3568724e24Sfoobardone
3668724e24Sfoobar
3768724e24Sfoobar# Determine which (if any) php binary is available
3868724e24Sfoobarif test "$php_cli_binary" != "NONE"; then
3968724e24Sfoobar  php_binary="$php_cli_binary"
4068724e24Sfoobarelse
4168724e24Sfoobar  php_binary="$php_cgi_binary"
4268724e24Sfoobarfi
4368724e24Sfoobar
4468724e24Sfoobar# Remove quotes
45eb10507fSJani Taskinenconfigure_options=`echo $configure_options | $SED -e "s#'##g"`
46f2f8d38eSSascha Schumann
47f2f8d38eSSascha Schumanncase "$1" in
48f2f8d38eSSascha Schumann--prefix)
4968724e24Sfoobar  echo $prefix;;
50f2f8d38eSSascha Schumann--includes)
5168724e24Sfoobar  echo $includes;;
5220c43285Sfoobar--ldflags)
5368724e24Sfoobar  echo $ldflags;;
5404bb45cfSStig Bakken--libs)
5568724e24Sfoobar  echo $libs;;
56cae3b7dfSSascha Schumann--extension-dir)
5768724e24Sfoobar  echo $extension_dir;;
58bcade7ceSfoobar--include-dir)
5968724e24Sfoobar  echo $include_dir;;
60ee5fd96eSfoobar--php-binary)
6168724e24Sfoobar  echo $php_binary;;
6268724e24Sfoobar--php-sapis)
6368724e24Sfoobar  echo $php_sapis;;
6468724e24Sfoobar--configure-options)
6568724e24Sfoobar  echo $configure_options;;
66988b8a9cSHannes Magnusson--man-dir)
67988b8a9cSHannes Magnusson  echo $man_dir;;
68*2d5f277aSJoe Watkins--ini-path)
69*2d5f277aSJoe Watkins  echo $ini_path;;
70*2d5f277aSJoe Watkins--ini-dir)
71*2d5f277aSJoe Watkins  echo $ini_dir;;
72ecb2b081SStig Bakken--version)
7368724e24Sfoobar  echo $version;;
74f0fe4e05Sfoobar--vernum)
7568724e24Sfoobar  echo $vernum;;
76f2f8d38eSSascha Schumann*)
7768724e24Sfoobar  cat << EOF
7868724e24SfoobarUsage: $0 [OPTION]
7968724e24SfoobarOptions:
8068724e24Sfoobar  --prefix            [$prefix]
8168724e24Sfoobar  --includes          [$includes]
8268724e24Sfoobar  --ldflags           [$ldflags]
8368724e24Sfoobar  --libs              [$libs]
8468724e24Sfoobar  --extension-dir     [$extension_dir]
8568724e24Sfoobar  --include-dir       [$include_dir]
86988b8a9cSHannes Magnusson  --man-dir           [$man_dir]
8768724e24Sfoobar  --php-binary        [$php_binary]
8868724e24Sfoobar  --php-sapis         [$php_sapis]
89*2d5f277aSJoe Watkins  --ini-path          [$ini_path]
90*2d5f277aSJoe Watkins  --ini-dir           [$ini_dir]
9168724e24Sfoobar  --configure-options [$configure_options]
9268724e24Sfoobar  --version           [$version]
9368724e24Sfoobar  --vernum            [$vernum]
9468724e24SfoobarEOF
9568724e24Sfoobar  exit 1;;
96f2f8d38eSSascha Schumannesac
97f2f8d38eSSascha Schumann
98f2f8d38eSSascha Schumannexit 0
99