summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-12-13 16:18:53 +0900
committerSimon Horman <horms@verge.net.au>2007-12-19 14:50:06 +0900
commit1db6397fc7a335decfa7ed95a95225476a030390 (patch)
tree6334f72d5ba837df21f986810392fbd29b718398
parent3b34f687a851f84216bc0bbd601b82c40b197a61 (diff)
Use --target for target architecture specification
Instead of using a combination of ARCH and --host, use --target. It's possible to have host != target. For example, building a ppc kexec binary for a ppc64 kernel. In this case, the kexec binary is compiled for 32-bit, while the purgatory object is 64-bit. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--configure.ac40
1 files changed, 15 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac
index bcfbc58..032d9de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,50 +14,40 @@ dnl as there are only a small number of targets that kexec
dnl can support on a given host system. If it stops making
dnl sense compile support for all possible targets a given
dnl host can support AC_CANONICAL_TARGET may help
-dnl AC_CANONICAL_TARGET
+AC_CANONICAL_TARGET
-dnl Compute host cpu
-case $host_cpu in
- i?86 )
- host_cpu="i386"
+dnl Compute ARCH from target cpu info
+case $target_cpu in
+ i?86 )
+ ARCH="i386"
;;
powerpc )
- host_cpu="ppc"
+ ARCH="ppc"
;;
powerpc64 )
- host_cpu="ppc64"
+ ARCH="ppc64"
;;
- s390x )
- host_cpu="s390"
+ s390x|s390 )
+ ARCH="s390"
;;
- sh4|sh4a|sh3 )
- host_cpu="sh"
+ sh4|sh4a|sh3|sh )
+ ARCH="sh"
;;
- * )
- host_cpu="$host_cpu"
- ;;
-esac
-case $host_cpu in
- i386|ppc|x86_64|alpha|ppc64|ia64|s390|sh)
+ ia64|x86_64|alpha )
+ ARCH="$target_cpu"
;;
* )
- AC_MSG_ERROR([ unsupported architecture $host_cpu])
+ AC_MSG_ERROR([unsupported architecture $target_cpu])
;;
esac
-dnl Try to guess the kernel ARCH based on the autoconf host_cpu variable.
-
-if ! test "${ARCH}" ; then
- ARCH=$host_cpu
-fi
-
dnl ---Options
OBJDIR=`pwd`/objdir
if test "${host_alias}" ; then
OBJDIR="$OBJDIR-${host_alias}"
-fi
+fi
EXTRA_CFLAGS='-Wall -g -fno-strict-aliasing -Wstrict-prototypes $(CPPFLAGS) $(EXTRA_CPPFLAGS)'
BUILD_CFLAGS='-O2 -Wall $(CPPFLAGS)'