summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMatthias Klose <doko@ubuntu.com>2012-03-15 21:19:28 (GMT)
committerMatthias Klose <doko@ubuntu.com>2012-03-15 21:19:28 (GMT)
commitdf2aecbf61a157b8a6a865cb2d946e65b887b774 (patch)
tree15243b72830854df8849d5311bb98272498f9f94 /configure.ac
parentabdb5528c06db31c195b1584ea5870258db35000 (diff)
downloadcpython-df2aecbf61a157b8a6a865cb2d946e65b887b774.zip
cpython-df2aecbf61a157b8a6a865cb2d946e65b887b774.tar.gz
cpython-df2aecbf61a157b8a6a865cb2d946e65b887b774.tar.bz2
- Issue #14327: Call AC_CANONICAL_HOST in configure.ac and check in
config.{guess,sub}. Don't use uname calls for cross builds.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac40
1 files changed, 28 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index dd09dc5..0ae5003 100644
--- a/configure.ac
+++ b/configure.ac
@@ -292,6 +292,25 @@ AC_SUBST(MACHDEP)
AC_MSG_CHECKING(MACHDEP)
if test -z "$MACHDEP"
then
+ # avoid using uname for cross builds
+ if test "$cross_compiling" = yes; then
+ # ac_sys_system and ac_sys_release are only used for setting
+ # `define_xopen_source' in the case statement below. For the
+ # current supported cross builds, this macro is not adjusted.
+ case "$host" in
+ *-*-linux*)
+ ac_sys_system=Linux
+ ;;
+ *-*-cygwin*)
+ ac_sys_system=Cygwin
+ ;;
+ *)
+ # for now, limit cross builds to known configurations
+ MACHDEP="unknown"
+ AC_MSG_ERROR([cross build not supported for $host])
+ esac
+ ac_sys_release=
+ else
ac_sys_system=`uname -s`
if test "$ac_sys_system" = "AIX" \
-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
@@ -299,19 +318,20 @@ then
else
ac_sys_release=`uname -r`
fi
- ac_md_system=`echo $ac_sys_system |
- tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
- ac_md_release=`echo $ac_sys_release |
- tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
- MACHDEP="$ac_md_system$ac_md_release"
+ fi
+ ac_md_system=`echo $ac_sys_system |
+ tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
+ ac_md_release=`echo $ac_sys_release |
+ tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
+ MACHDEP="$ac_md_system$ac_md_release"
- case $MACHDEP in
+ case $MACHDEP in
linux*) MACHDEP="linux";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
- esac
+ esac
fi
# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
@@ -439,10 +459,6 @@ AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
-AC_MSG_CHECKING(machine type as reported by uname -m)
-ac_sys_machine=`uname -m`
-AC_MSG_RESULT($ac_sys_machine)
-
# checks for alternative programs
# compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
@@ -1010,7 +1026,7 @@ yes)
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
# support. Without this, treatment of subnormals doesn't follow
# the standard.
- case $ac_sys_machine in
+ case $host in
alpha*)
BASECFLAGS="$BASECFLAGS -mieee"
;;