]> granicus.if.org Git - php/commitdiff
MFH: - Make sure $host_alias is never empty
authorfoobar <sniper@php.net>
Fri, 7 Jan 2005 06:19:54 +0000 (06:19 +0000)
committerfoobar <sniper@php.net>
Fri, 7 Jan 2005 06:19:54 +0000 (06:19 +0000)
acinclude.m4
configure.in
scripts/phpize.m4

index 8ed52027892033ed15eb8f1ec07d4afc1ab02494..52e4a6fb7cf32678a73bcbb33cf8f96e2b305fb6 100644 (file)
@@ -29,9 +29,23 @@ AC_DEFUN([PHP_DEFINE],[
   [echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h]
 ])
 
+dnl PHP_CANONICAL_HOST
+dnl
+AC_DEFUN([PHP_CANONICAL_HOST],[
+  AC_REQUIRE([AC_CANONICAL_HOST])dnl
+  dnl Make sure we do not continue if host_alias is empty.
+  if test -z "$host_alias" && test -n "$host"; then
+    host_alias=$host
+  fi
+  if test -z "$host_alias"; then
+    AC_MSG_ERROR([host_alias is not set!])
+  fi
+])
+
 dnl PHP_INIT_BUILD_SYSTEM
 dnl
 AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[
+AC_REQUIRE([PHP_CANONICAL_HOST])dnl
 test -d include || mkdir include
 > Makefile.objects
 > Makefile.fragments
@@ -273,6 +287,7 @@ int readdir_r(DIR *, struct dirent *);
 ])
 
 AC_DEFUN([PHP_SHLIB_SUFFIX_NAME],[
+  AC_REQUIRE([PHP_CANONICAL_HOST])dnl
   PHP_SUBST(SHLIB_SUFFIX_NAME)
   SHLIB_SUFFIX_NAME=so
   case $host_alias in
index 9fbcda908beb6cf7809b591d086bdc045d315045..bf5b75334e0aaea14b759ee465bd1c1b1da15ce6 100644 (file)
@@ -35,7 +35,7 @@ for arg in $0 "$@"; do
   CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
 done
 
-AC_CANONICAL_HOST
+PHP_CANONICAL_HOST
 AC_CONFIG_HEADER(main/php_config.h)
 
 MAJOR_VERSION=5
@@ -177,11 +177,6 @@ PHP_C_BIGENDIAN
 dnl Platform-specific compile settings.
 dnl -------------------------------------------------------------------------
 
-dnl if host_alias is empty, ac_cv_host_alias may still have the info
-if test -z "$host_alias"; then
-    host_alias=$ac_cv_host_alias
-fi
-
 case $host_alias in
 *solaris*)
     CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
index 123acaef7f86c94b7993acce2a49f24c33913b9f..ea286179d49a1637dbc8d1bacb7c205464a8b86c 100644 (file)
@@ -2,8 +2,6 @@ dnl This file becomes configure.in for self-contained extensions.
 
 AC_INIT(config.m4)
 
-AC_CANONICAL_HOST
-
 PHP_INIT_BUILD_SYSTEM
 
 AC_DEFUN([PHP_WITH_PHP_CONFIG],[