5
exec_prefix="`eval echo @exec_prefix@`"
6
phpdir="`eval echo @libdir@`/build"
7
includedir="`eval echo @includedir@`/php"
10
FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4"
11
FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh"
12
CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ include/ modules/ install-sh \
13
mkinstalldirs missing config.nice config.sub config.guess configure configure.in \
14
aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache autom4te.cache/ \
15
config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h"
17
# function declaration
20
echo "Usage: $0 [--clean|--help|--version|-v]"
25
if test $@ -eq 1; then
29
echo "Cannot find config.m4. "
30
echo "Make sure that you run '$0$clean' in the top level source directory of the module"
37
for i in $CLEAN_FILES; do
38
test -e $i && rm -rf $i
42
phpize_check_configm4()
44
if test ! -r config.m4; then
51
phpize_get_api_numbers()
54
PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|sed 's/#define PHP_API_VERSION//'`
55
ZEND_MODULE_API_NO=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO//'`
56
ZEND_EXTENSION_API_NO=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|sed 's/#define ZEND_EXTENSION_API_NO//'`
59
phpize_print_api_numbers()
61
phpize_get_api_numbers
62
echo "Configuring for:"
63
echo "PHP Api Version: "$PHP_API_VERSION
64
echo "Zend Module Api No: "$ZEND_MODULE_API_NO
65
echo "Zend Extension Api No: "$ZEND_EXTENSION_API_NO
68
phpize_check_build_files()
70
if test ! -d "$phpdir"; then
72
Cannot find build files at '$phpdir'. Please check your PHP installation.
81
test -x "$builddir/build/shtool" || chmod +x "$builddir/build/shtool"
83
if test ! -x "$builddir/build/shtool"; then
85
shtool at '$builddir/build/shtool' does not exist or is not executable.
86
Make sure that the file exists and is executable and then rerun this script.
91
php_shtool=$builddir/build/shtool
95
phpize_check_autotools()
97
test -z "$PHP_AUTOCONF" && PHP_AUTOCONF=autoconf
98
test -z "$PHP_AUTOHEADER" && PHP_AUTOHEADER=autoheader
100
if ! test -x "`$php_shtool path $PHP_AUTOCONF`"; then
102
Cannot find autoconf. Please check your autoconf installation and the \$PHP_AUTOCONF
103
environment variable is set correctly and then rerun this script.
108
if ! test -x "`$php_shtool path $PHP_AUTOHEADER`"; then
110
Cannot find autoheader. Please check your autoconf installation and the \$PHP_AUTOHEADER
111
environment variable is set correctly and then rerun this script.
120
test -d build || mkdir build
122
(cd "$phpdir" && cp $FILES_BUILD "$builddir"/build)
123
(cd "$phpdir" && cp $FILES "$builddir")
124
(cd "$builddir" && cat acinclude.m4 ./build/libtool.m4 > aclocal.m4)
127
phpize_replace_prefix()
130
-e "s#@prefix@#$prefix#" \
131
< "$phpdir/phpize.m4" > configure.in
136
$PHP_AUTOCONF || exit 1
137
$PHP_AUTOHEADER || exit 1
145
phpize_check_configm4 1
158
phpize_print_api_numbers
164
phpize_check_configm4 0
166
phpize_check_build_files
168
phpize_print_api_numbers
172
phpize_replace_prefix
174
touch install-sh mkinstalldirs missing
178
phpize_check_autotools