]> granicus.if.org Git - php/commitdiff
MFH: Use PHP_AUTOCONF / PHP_AUTOHEADER environment variables
authorfoobar <sniper@php.net>
Thu, 7 Apr 2005 20:43:27 +0000 (20:43 +0000)
committerfoobar <sniper@php.net>
Thu, 7 Apr 2005 20:43:27 +0000 (20:43 +0000)
build/build2.mk
build/buildcheck.sh
scripts/phpize.in

index c361d0d4259cabf66dd38d82daa800f237e86882..6de26fcad8135d37e411d5fdc4aea8bd1e034252 100644 (file)
@@ -32,6 +32,9 @@ acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
 
 targets = $(TOUCH_FILES) configure $(config_h_in)
 
+PHP_AUTOCONF ?= 'autoconf'
+PHP_AUTOHEADER ?= 'autoheader'
+
 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)
 
 all: $(targets)
@@ -45,7 +48,7 @@ $(config_h_in): configure acconfig.h
 # correctly otherwise (timestamps are not updated)
        @echo rebuilding $@
        @rm -f $@
-       autoheader $(SUPPRESS_WARNINGS)
+       $(PHP_AUTOHEADER) $(SUPPRESS_WARNINGS)
 
 $(TOUCH_FILES):
        touch $(TOUCH_FILES)
@@ -56,5 +59,5 @@ aclocal.m4: configure.in acinclude.m4
 
 configure: aclocal.m4 configure.in $(config_m4_files)
        @echo rebuilding $@
-       autoconf $(SUPPRESS_WARNINGS)
+       $(PHP_AUTOCONF) $(SUPPRESS_WARNINGS)
 
index dc47a6bc202e0ad2881ac11536df5b512e90cc21..c4aaedb09b7e03bdb6c2b844af8d68172c251e0d 100755 (executable)
 #  |          Sascha Schumann <sascha@schumann.cx>                        |
 #  +----------------------------------------------------------------------+
 #
-# $Id: buildcheck.sh,v 1.30.2.4 2005-01-20 01:41:52 sniper Exp $ 
+# $Id: buildcheck.sh,v 1.30.2.5 2005-04-07 20:43:26 sniper Exp $ 
 #
 
 echo "buildconf: checking installation..."
 
 stamp=$1
 
+# Allow the autoconf executable to be overriden by $PHP_AUTOCONF.
+if test -z "$PHP_AUTOCONF"; then
+  PHP_AUTOCONF='autoconf'
+fi
+
 # autoconf 2.13 or newer
-ac_version=`autoconf --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
+ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
 if test -z "$ac_version"; then
 echo "buildconf: autoconf not found."
 echo "           You need autoconf version 2.13 or newer installed"
index 1901323471d6da3da51418327b29e7dea6ab66b5..97439b4bb7c74d622a6802dae0ff6ec996680b47 100644 (file)
@@ -80,9 +80,33 @@ phpize_check_shtool()
   if test ! -x "$builddir/build/shtool"; then
     phpize_no_shtool
     exit 1
+  else
+    php_shtool=$builddir/build/shtool
   fi
 }
 
+phpize_check_autotools()
+{
+  test -z "$PHP_AUTOCONF" && PHP_AUTOCONF=autoconf
+  test -z "$PHP_AUTOHEADER" && PHP_AUTOHEADER=autoheader
+  
+  if ! test -x "$php_shtool path $PHP_AUTOCONF"; then
+    echo <<EOF
+Cannot find autoconf. Please check your autoconf installation and the \$PHP_AUTOCONF 
+environment variable is set correctly and then rerun this script. 
+
+EOF
+    exit 1
+  fi
+  if ! test -x "$php_shtool path $PHP_AUTOHEADER"; then
+    echo <<EOF
+Cannot find autoheader. Please check your autoconf installation and the \$PHP_AUTOHEADER 
+environment variable is set correctly and then rerun this script. 
+
+EOF
+    exit 1
+  fi
+}
 
 phpize_copy_files()
 {
@@ -102,9 +126,8 @@ phpize_replace_prefix()
 
 phpize_autotools()
 {
-  aclocal    || exit 1
-  autoconf   || exit 1
-  autoheader || exit 1
+  $PHP_AUTOCONF   || exit 1
+  $PHP_AUTOHEADER || exit 1
 }
 
 # Main script
@@ -141,10 +164,11 @@ case "$1" in
 
      touch install-sh mkinstalldirs missing
 
-     phpize_autotools
-
      phpize_check_shtool
 
+     phpize_check_autotools
+
+     phpize_autotools
      ;;
 esac