summaryrefslogtreecommitdiff
path: root/autoconf
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-08-18 00:40:33 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-08-18 00:40:33 +0000
commite55db741523b51f3f754b6dd62c5e0f52bb83b98 (patch)
treed8adf284f68ce9a035d8d34a2e8e188f0042d7d2 /autoconf
parente1b80b6946183a167b566f674235177338469a26 (diff)
downloadllvm-e55db741523b51f3f754b6dd62c5e0f52bb83b98.tar.gz
llvm-e55db741523b51f3f754b6dd62c5e0f52bb83b98.tar.bz2
llvm-e55db741523b51f3f754b6dd62c5e0f52bb83b98.tar.xz
The attached patches attempt to fix cross builds. For example, if you
try to use i686-darwin to build for arm-eabi, you'll quickly run into several false assumptions that the target OS must be the same as the host OS. These patches split $(OS) into $(HOST_OS) and $(TARGET_OS) to help builds like "make check" and the test-suite able to cross compile. Along the way a target of *-unknown-eabi is defined as "Freestanding" so that TARGET_OS checks have something to work with. Patch by Sandeep Patel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/configure.ac49
1 files changed, 49 insertions, 0 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 149ddd1e02..3093ae1b07 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -175,6 +175,16 @@ AC_CACHE_CHECK([type of operating system we're going to host on],
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="MingW"
llvm_cv_platform_type="Win32" ;;
+ *-unknown-eabi*)
+ llvm_cv_link_all_option="-Wl,--whole-archive"
+ llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
+ llvm_cv_os_type="Freestanding"
+ llvm_cv_platform_type="Unix" ;;
+ *-unknown-elf*)
+ llvm_cv_link_all_option="-Wl,--whole-archive"
+ llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
+ llvm_cv_os_type="Freestanding"
+ llvm_cv_platform_type="Unix" ;;
*)
llvm_cv_link_all_option=""
llvm_cv_no_link_all_option=""
@@ -182,6 +192,43 @@ AC_CACHE_CHECK([type of operating system we're going to host on],
llvm_cv_platform_type="Unknown" ;;
esac])
+AC_CACHE_CHECK([type of operating system we're going to target],
+ [llvm_cv_target_os_type],
+[case $target in
+ *-*-aix*)
+ llvm_cv_target_os_type="AIX" ;;
+ *-*-irix*)
+ llvm_cv_target_os_type="IRIX" ;;
+ *-*-cygwin*)
+ llvm_cv_target_os_type="Cygwin" ;;
+ *-*-darwin*)
+ llvm_cv_target_os_type="Darwin" ;;
+ *-*-freebsd*)
+ llvm_cv_target_os_type="FreeBSD" ;;
+ *-*-openbsd*)
+ llvm_cv_target_os_type="OpenBSD" ;;
+ *-*-netbsd*)
+ llvm_cv_target_os_type="NetBSD" ;;
+ *-*-dragonfly*)
+ llvm_cv_target_os_type="DragonFly" ;;
+ *-*-hpux*)
+ llvm_cv_target_os_type="HP-UX" ;;
+ *-*-interix*)
+ llvm_cv_target_os_type="Interix" ;;
+ *-*-linux*)
+ llvm_cv_target_os_type="Linux" ;;
+ *-*-solaris*)
+ llvm_cv_target_os_type="SunOS" ;;
+ *-*-win32*)
+ llvm_cv_target_os_type="Win32" ;;
+ *-*-mingw*)
+ llvm_cv_target_os_type="MingW" ;;
+ *-unknown-eabi*)
+ llvm_cv_target_os_type="Freestanding" ;;
+ *)
+ llvm_cv_target_os_type="Unknown" ;;
+esac])
+
dnl Make sure we aren't attempting to configure for an unknown system
if test "$llvm_cv_os_type" = "Unknown" ; then
AC_MSG_ERROR([Operating system is unknown, configure can't continue])
@@ -190,6 +237,8 @@ fi
dnl Set the "OS" Makefile variable based on the platform type so the
dnl makefile can configure itself to specific build hosts
AC_SUBST(OS,$llvm_cv_os_type)
+AC_SUBST(HOST_OS,$llvm_cv_os_type)
+AC_SUBST(TARGET_OS,$llvm_cv_target_os_type)
dnl Set the LINKALL and NOLINKALL Makefile variables based on the platform
AC_SUBST(LINKALL,$llvm_cv_link_all_option)