xref: /php-src/scripts/php-config.in (revision 7d6bb3e8)
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"
10lib_dir="@orig_libdir@"
11includes="-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"
12ldflags="@PHP_LDFLAGS@"
13libs="@EXTRA_LIBS@"
14extension_dir="@EXTENSION_DIR@"
15man_dir=`eval echo @mandir@`
16program_prefix="@program_prefix@"
17program_suffix="@program_suffix@"
18exe_extension="@EXEEXT@"
19php_cli_binary=NONE
20php_cgi_binary=NONE
21configure_options="@CONFIGURE_OPTIONS@"
22php_sapis="@PHP_INSTALLED_SAPIS@"
23ini_dir="@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@"
24ini_path="@EXPANDED_PHP_CONFIG_FILE_PATH@"
25php_embed_type="@PHP_EMBED_TYPE@"
26
27# Set php_cli_binary and php_cgi_binary if available
28for sapi in $php_sapis; do
29  case $sapi in
30  cli)
31    php_cli_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}"
32    ;;
33  cgi)
34    php_cgi_binary="@bindir@/${program_prefix}php-cgi${program_suffix}${exe_extension}"
35    ;;
36  esac
37done
38
39# Determine which (if any) php binary is available
40if test "$php_cli_binary" != "NONE"; then
41  php_binary="$php_cli_binary"
42else
43  php_binary="$php_cgi_binary"
44fi
45
46# Set embed SAPI library path
47if test "$php_embed_type" = "shared"; then
48  php_embed_lib=@SAPI_LIBNAME_SHARED@
49elif test "$php_embed_type" = "static"; then
50  php_embed_lib=@SAPI_LIBNAME_STATIC@
51fi
52
53# Remove quotes
54configure_options=`echo $configure_options | $SED -e "s#'##g"`
55
56case "$1" in
57--prefix)
58  echo $prefix;;
59--includes)
60  echo $includes;;
61--ldflags)
62  echo $ldflags;;
63--libs)
64  echo $libs;;
65--extension-dir)
66  echo $extension_dir;;
67--include-dir)
68  echo $include_dir;;
69--lib-dir)
70  echo $lib_dir;;
71--lib-embed)
72  echo $php_embed_lib;;
73--php-binary)
74  echo $php_binary;;
75--php-sapis)
76  echo $php_sapis;;
77--configure-options)
78  echo $configure_options;;
79--man-dir)
80  echo $man_dir;;
81--ini-path)
82  echo $ini_path;;
83--ini-dir)
84  echo $ini_dir;;
85--version)
86  echo $version;;
87--vernum)
88  echo $vernum;;
89*)
90  cat << EOF
91Usage: $0 [OPTION]
92Options:
93  --prefix            [$prefix]
94  --includes          [$includes]
95  --ldflags           [$ldflags]
96  --libs              [$libs]
97  --extension-dir     [$extension_dir]
98  --include-dir       [$include_dir]
99  --lib-dir           [$lib_dir]
100  --lib-embed         [$php_embed_lib]
101  --man-dir           [$man_dir]
102  --php-binary        [$php_binary]
103  --php-sapis         [$php_sapis]
104  --ini-path          [$ini_path]
105  --ini-dir           [$ini_dir]
106  --configure-options [$configure_options]
107  --version           [$version]
108  --vernum            [$vernum]
109EOF
110  exit 1;;
111esac
112
113exit 0
114