5 datarootdir
='@datarootdir@'
6 exec_prefix
="`eval echo @exec_prefix@`"
7 phpdir
="`eval echo @libdir@`/build"
8 includedir
="`eval echo @includedir@`/php"
12 FILES_BUILD
="mkdep.awk scan_makefile_in.awk shtool libtool.m4"
13 FILES
="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php"
14 CLEAN_FILES
="$FILES *.o *.lo *.la .deps .libs/ build/ include/ modules/ install-sh \
15 mkinstalldirs missing config.nice config.sub config.guess configure configure.in \
16 aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache autom4te.cache/ \
17 config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h \
18 run-tests*.php tests/*.diff tests/*.exp tests/*.log tests/*.out tests/*.php"
20 # function declaration
23 echo "Usage: $0 [--clean|--help|--version|-v]"
28 if test $@
-eq 1; then
32 echo "Cannot find config.m4. "
33 echo "Make sure that you run '$0$clean' in the top level source directory of the module"
40 for i
in $CLEAN_FILES; do
43 elif test -d "$i"; then
49 phpize_check_configm4
()
51 if test ! -r config.
m4; then
58 phpize_get_api_numbers
()
61 PHP_API_VERSION
=`grep '#define PHP_API_VERSION' $includedir/main/php.h|$SED 's/#define PHP_API_VERSION//'`
62 ZEND_MODULE_API_NO
=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO//'`
63 ZEND_EXTENSION_API_NO
=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|$SED 's/#define ZEND_EXTENSION_API_NO//'`
66 phpize_print_api_numbers
()
68 phpize_get_api_numbers
69 echo "Configuring for:"
70 echo "PHP Api Version: "$PHP_API_VERSION
71 echo "Zend Module Api No: "$ZEND_MODULE_API_NO
72 echo "Zend Extension Api No: "$ZEND_EXTENSION_API_NO
75 phpize_check_build_files
()
77 if test ! -d "$phpdir"; then
79 Cannot find build files at '$phpdir'. Please check your PHP installation.
88 Invalid source path '$phpdir'. Whitespace is not allowed in source path.
97 Invalid build path '$builddir'. Whitespace is not allowed in build path.
104 phpize_check_shtool
()
106 test -x "$builddir/build/shtool" ||
chmod +x
"$builddir/build/shtool"
108 if test ! -x "$builddir/build/shtool"; then
110 shtool at '$builddir/build/shtool' does not exist or is not executable.
111 Make sure that the file exists and is executable and then rerun this script.
116 php_shtool
=$builddir/build
/shtool
120 phpize_check_autotools
()
122 test -z "$PHP_AUTOCONF" && PHP_AUTOCONF
=autoconf
123 test -z "$PHP_AUTOHEADER" && PHP_AUTOHEADER
=autoheader
125 if test ! -x "$PHP_AUTOCONF" && test ! -x "`$php_shtool path $PHP_AUTOCONF`"; then
127 Cannot find autoconf. Please check your autoconf installation and the
128 \$PHP_AUTOCONF environment variable. Then, rerun this script.
133 if test ! -x "$PHP_AUTOHEADER" && test ! -x "`$php_shtool path $PHP_AUTOHEADER`"; then
135 Cannot find autoheader. Please check your autoconf installation and the
136 \$PHP_AUTOHEADER environment variable. Then, rerun this script.
145 test -d build || mkdir build
147 (cd "$phpdir" && cp $FILES_BUILD "$builddir"/build
)
148 (cd "$phpdir" && cp $FILES "$builddir")
149 (cd "$builddir" && cat acinclude.
m4 .
/build
/libtool.
m4 > aclocal.
m4)
152 phpize_replace_prefix
()
155 -e "s#@prefix@#$prefix#" \
156 < "$phpdir/phpize.m4" > configure.
in
161 $PHP_AUTOCONF ||
exit 1
162 $PHP_AUTOHEADER ||
exit 1
170 phpize_check_configm4
1
183 phpize_print_api_numbers
189 phpize_check_configm4
0
191 phpize_check_build_files
193 phpize_print_api_numbers
197 phpize_replace_prefix
199 touch install-sh mkinstalldirs missing
203 phpize_check_autotools