Skip to content

Commit 7a3d9ad

Browse files
author
foobar
committed
- Make sure $host_alias is never empty
1 parent f5c4529 commit 7a3d9ad

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

acinclude.m4

+16
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,24 @@ AC_DEFUN([PHP_DEFINE],[
2929
[echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h]
3030
])
3131

32+
dnl PHP_CANONICAL_HOST_TARGET
33+
dnl
34+
AC_DEFUN([PHP_CANONICAL_HOST_TARGET],[
35+
AC_REQUIRE([AC_CANONICAL_HOST])dnl
36+
AC_REQUIRE([AC_CANONICAL_TARGET])dnl
37+
dnl Make sure we do not continue if host_alias is empty.
38+
if test -z "$host_alias" && test -n "$host"; then
39+
host_alias=$host
40+
fi
41+
if test -z "$host_alias"; then
42+
AC_MSG_ERROR([host_alias is not set!])
43+
fi
44+
])
45+
3246
dnl PHP_INIT_BUILD_SYSTEM
3347
dnl
3448
AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[
49+
AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
3550
test -d include || mkdir include
3651
> Makefile.objects
3752
> Makefile.fragments
@@ -273,6 +288,7 @@ int readdir_r(DIR *, struct dirent *);
273288
])
274289

275290
AC_DEFUN([PHP_SHLIB_SUFFIX_NAME],[
291+
AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
276292
PHP_SUBST(SHLIB_SUFFIX_NAME)
277293
SHLIB_SUFFIX_NAME=so
278294
case $host_alias in

configure.in

+1-7
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ for arg in $0 "$@"; do
3535
CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
3636
done
3737

38-
AC_CANONICAL_HOST
39-
AC_CANONICAL_TARGET
38+
PHP_CANONICAL_HOST_TARGET
4039

4140
AC_CONFIG_HEADER(main/php_config.h)
4241

@@ -208,11 +207,6 @@ PHP_C_BIGENDIAN
208207
dnl Platform-specific compile settings.
209208
dnl -------------------------------------------------------------------------
210209

211-
dnl if host_alias is empty, ac_cv_host_alias may still have the info
212-
if test -z "$host_alias"; then
213-
host_alias=$ac_cv_host_alias
214-
fi
215-
216210
case $host_alias in
217211
*solaris*)
218212
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"

scripts/phpize.m4

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ dnl This file becomes configure.in for self-contained extensions.
22

33
AC_INIT(config.m4)
44

5-
AC_CANONICAL_HOST
6-
75
PHP_INIT_BUILD_SYSTEM
86

97
AC_DEFUN([PHP_WITH_PHP_CONFIG],[

0 commit comments

Comments
 (0)