From: foobar Date: Thu, 20 Jan 2005 01:43:19 +0000 (+0000) Subject: MFH: - Changed phpize not to require automake and libtool. (Jani) X-Git-Tag: php-4.3.11RC1~129 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5a163091e283c14f3c381fea3378aefc246df02;p=php MFH: - Changed phpize not to require automake and libtool. (Jani) MFH: - Fixed build system to always use bundled libtool files. (Jani) MFH: - Rewrote of phpize routines --- diff --git a/NEWS b/NEWS index d7addafc12..ec92a6ecf7 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,10 @@ PHP 4 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, Version 4.3.11 -- Fixed MacOSX shared extensions crashing on Apache startup. (Rasmus) - Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony) +- Changed phpize not to require automake and libtool. (Jani) +- Fixed build system to always use bundled libtool files. (Jani) +- Fixed MacOSX shared extensions crashing on Apache startup. (Rasmus) - Fixed bug #31580 (fgetcsv() problematic with "" escape sequences). (Ilia) - Fixed bug #31480 (Possible infinite loop in imap_mail_compose()). (Ilia) - Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen). (Ilia) diff --git a/build/build2.mk b/build/build2.mk index db1a7af01a..ea7d6bd1a1 100644 --- a/build/build2.mk +++ b/build/build2.mk @@ -34,11 +34,12 @@ targets = $(TOUCH_FILES) configure $(config_h_in) ifeq ($(SHOW_WARNINGS), no) SUPPRESS_WARNINGS = 2>&1 | (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_DECL_YYTEXT is expanded from...|the top level)'||true) - libtoolize_flags = --automake +else + debug_target = debugging endif -all: $(targets) +all: $(targets) $(debug_target) acconfig.h: $(acconfig_h_SOURCES) @echo rebuilding $@ @@ -49,19 +50,19 @@ $(config_h_in): configure acconfig.h # correctly otherwise (timestamps are not updated) @echo rebuilding $@ @rm -f $@ - @autoheader $(SUPPRESS_WARNINGS) + autoheader $(SUPPRESS_WARNINGS) $(TOUCH_FILES): touch $(TOUCH_FILES) aclocal.m4: configure.in acinclude.m4 @echo rebuilding $@ - @libtoolize=`./build/shtool path glibtoolize libtoolize`; \ - $$libtoolize --copy $(libtoolize_flags); \ - ltpath=`dirname $$libtoolize`; \ - ltfile=`cd $$ltpath/../share/aclocal; pwd`/libtool.m4; \ - cat acinclude.m4 $$ltfile > $@ + cat acinclude.m4 ./build/libtool.m4 > $@ configure: aclocal.m4 configure.in $(config_m4_files) @echo rebuilding $@ - @autoconf $(SUPPRESS_WARNINGS) + autoconf $(SUPPRESS_WARNINGS) + +debugging: + @libtoolize=`./build/shtool path glibtoolize libtoolize`; \ + $$libtoolize diff --git a/build/buildcheck.sh b/build/buildcheck.sh index f9ee56bc5d..b5c81f9f91 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -16,7 +16,7 @@ # | Sascha Schumann | # +----------------------------------------------------------------------+ # -# $Id: buildcheck.sh,v 1.21.2.10 2005-01-19 22:27:59 sniper Exp $ +# $Id: buildcheck.sh,v 1.21.2.11 2005-01-20 01:43:18 sniper Exp $ # echo "buildconf: checking installation..." @@ -41,51 +41,12 @@ else echo "buildconf: autoconf version $ac_version (ok)" fi - if test "$1" = "2" && test "$2" -ge "50"; then echo "buildconf: running cvsclean." ./cvsclean stamp= fi -# libtoolize 1.4.3 or newer -# Prefer glibtoolize over libtoolize for Mac OS X compatibility -libtoolize=`./build/shtool path glibtoolize libtoolize 2> /dev/null` -lt_pversion=`$libtoolize --version 2>/dev/null|head -n 1|awk -F' ' '{print $NF}'` -if test "$lt_pversion" = ""; then -echo "buildconf: libtool not found." -echo " You need libtool version 1.4.3 or newer installed" -echo " to build PHP from CVS." -exit 1 -fi -IFS=.; set $lt_pversion; IFS=' ' - -if test "$3" = ""; then - third=0 -else - third=$3 -fi - -if test "$1" -gt "1" || test "$2" -ge "5" || (test "$2" -ge "4" && test "$third" -ge "3") -then -echo "buildconf: libtool version $lt_pversion (ok)" -else -echo "buildconf: libtool version $lt_pversion found." -echo " You need libtool version 1.4.3 or newer installed" -echo " to build PHP from CVS." -exit 1 -fi - -ltpath=`echo $libtoolize | sed -e 's#/[^/]*/[^/]*$##'` -ltfile="$ltpath/share/aclocal/libtool.m4" -if test -r "$ltfile"; then - : -else - echo "buildconf: $ltfile does not exist." - echo " Please reinstall libtool." - exit 1 -fi - test -n "$stamp" && touch $stamp exit 0 diff --git a/scripts/Makefile.frag b/scripts/Makefile.frag index 8ff40dabf4..6f4a1a06e2 100644 --- a/scripts/Makefile.frag +++ b/scripts/Makefile.frag @@ -10,11 +10,15 @@ BUILD_FILES = \ scripts/phpize.m4 \ build/mkdep.awk \ build/scan_makefile_in.awk \ + build/libtool.m4 \ Makefile.global \ - acinclude.m4 + acinclude.m4 \ + ltmain.sh BUILD_FILES_EXEC = \ - build/shtool + build/shtool \ + config.guess \ + config.sub bin_SCRIPTS = phpize php-config bin_src_SCRIPTS = phpextdist diff --git a/scripts/phpize.in b/scripts/phpize.in index 7dc031ccbc..4e7b709759 100644 --- a/scripts/phpize.in +++ b/scripts/phpize.in @@ -1,80 +1,150 @@ -#! /bin/sh +#!/bin/sh +# Variable declaration prefix='@prefix@' phpdir="$prefix/lib/php/build" includedir="$prefix/include/php" builddir="`pwd`" -FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool" -FILES="acinclude.m4 Makefile.global" -CLEAN_FILES="$FILES *.lo *.la *.o .deps .libs/ build/ include/ modules/ install-sh \ +FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4" +FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh" +CLEAN_FILES="$FILES *.o *.lo *.la .deps .libs/ build/ include/ modules/ install-sh \ mkinstalldirs missing config.nice config.sub config.guess configure configure.in \ aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache \ config.log config.status Makefile Makefile.fragments Makefile.objects confdefs.h" +# function declaration +phpize_usage() +{ + echo "Usage: $0 [--clean|--help|--version|-v]" +} + +phpize_no_configm4() +{ + if test $@ -eq 1; then + clean=" --clean" + fi + + echo "Cannot find config.m4. " + echo "Make sure that you run '$0$clean' in the top level source directory of the module" + echo +} + +phpize_clean() +{ + echo "Cleaning.." + for i in $CLEAN_FILES; do + test -e $i && rm -rf $i + done +} + +phpize_check_configm4() +{ + if test ! -r config.m4; then + phpize_no_configm4 $@ + exit 1 + fi + +} + +phpize_get_api_numbers() +{ + # extracting API NOs: + PHP_API_VERSION=`egrep '#define PHP_API_VERSION' $includedir/main/php.h|sed 's/#define PHP_API_VERSION//'` + ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO//'` + ZEND_EXTENSION_API_NO=`egrep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|sed 's/#define ZEND_EXTENSION_API_NO//'` +} + +phpize_print_api_numbers() +{ + phpize_get_api_numbers + echo "Configuring for:" + echo "PHP Api Version: "$PHP_API_VERSION + echo "Zend Module Api No: "$ZEND_MODULE_API_NO + echo "Zend Extension Api No: "$ZEND_EXTENSION_API_NO +} + +phpize_no_shtool() +{ + echo < configure.in +} + +phpize_autotools() +{ + cat acinclude.m4 ./build/libtool.m4 > aclocal.m4 || exit 1 + autoconf || exit 1 + autoheader || exit 1 +} + +# Main script + case "$1" in # Cleanup --clean) - if test -r config.m4; then - echo "Cleaning.." - for i in $CLEAN_FILES; do - test -e $i && rm -rf $i - done - exit 0 - else - echo "Cannot find config.m4. " - echo "Make sure that you run '$0 --clean' in the top level source directory of the module" - echo - exit 1 - fi + phpize_check_configm4 1 + phpize_clean + exit 0 ;; + # Usage --help) - echo "Usage: $0 [--clean|--help]" - exit 1 + phpize_usage + exit 0 ;; + + # Version + --version|-v) + phpize_print_api_numbers + exit 0 + ;; + + # Default *) - if test ! -r config.m4; then - echo "Cannot find config.m4. " - echo "Make sure that you run '$0' in the top level source directory of the module" - echo - exit 1 - fi - ;; -esac + phpize_check_configm4 0 -test -d build || mkdir build + phpize_print_api_numbers -(cd "$phpdir" && cp $FILES_BUILD "$builddir"/build) -(cd "$phpdir" && cp $FILES "$builddir") + phpize_copy_files -sed \ --e "s#@prefix@#$prefix#" \ -< "$phpdir/phpize.m4" > configure.in + phpize_replace_prefix -touch install-sh mkinstalldirs missing + touch install-sh mkinstalldirs missing -aclocal || exit 1 -autoconf || exit 1 -autoheader || exit 1 -test -x "$builddir/build/shtool" || chmod +x "$builddir/build/shtool" -if test ! -x "$builddir/build/shtool"; then - echo "shtool at '$builddir/build/shtool' not executable. " - echo "Make sure that the file exists and is executable and then rerun this script. " - echo - exit 1 -fi -libtoolize=`$builddir/build/shtool path glibtoolize libtoolize` -$libtoolize -f -c || exit 1 - -# dumping API NOs: -PHP_API_VERSION=`egrep '#define PHP_API_VERSION' $includedir/main/php.h|sed 's/#define PHP_API_VERSION//'` -ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO//'` -ZEND_EXTENSION_API_NO=`egrep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|sed 's/#define ZEND_EXTENSION_API_NO//'` - -echo "Configuring for:" -echo " PHP Api Version: "$PHP_API_VERSION -echo " Zend Module Api No: "$ZEND_MODULE_API_NO -echo " Zend Extension Api No: "$ZEND_EXTENSION_API_NO + phpize_autotools + + phpize_check_shtool + + ;; +esac exit 0