For PR814:
Provide support for making cross-compiling builds. See the PR for details.
Patch provided by Anton Korobeynikov. Thanks, Anton!
llvm-svn: 29309
diff --git a/llvm/autoconf/configure.ac b/llvm/autoconf/configure.ac
index 4a276aa..b5fcccb 100644
--- a/llvm/autoconf/configure.ac
+++ b/llvm/autoconf/configure.ac
@@ -98,9 +98,9 @@
dnl Determine the platform type and cache its value. This helps us configure
dnl the System library to the correct build platform.
-AC_CACHE_CHECK([type of operating system we're on],
+AC_CACHE_CHECK([type of operating system we're going to host on],
[llvm_cv_os_type],
-[case $build in
+[case $host in
*-*-aix*)
llvm_cv_os_type="AIX"
llvm_cv_platform_type="Unix" ;;
@@ -188,6 +188,14 @@
dnl Check for the endianness of the target
AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
+dnl Check for build platform executable suffix if we're crosscompiling
+if test "$cross_compiling" = yes; then
+ AC_SUBST(LLVM_CROSS_COMPILING, [1])
+ AC_BUILD_EXEEXT
+else
+ AC_SUBST(LLVM_CROSS_COMPILING, [0])
+fi
+
dnl Check to see if there's a "CVS" directory indicating that this build is
dnl being done from a CVS checkout. This sets up several defaults for the
dnl command line switches. When we build with a CVS directory, we get a