Work around build problem with OpenJDK, which defines X86 as a
authorDouglas Gregor <dgregor@apple.com>
Tue, 23 Jun 2009 17:21:35 +0000 (17:21 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 23 Jun 2009 17:21:35 +0000 (17:21 +0000)
macro. Fixes PR 4427. Patch by Xerxes RĂ„nby!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73961 91177308-0d34-0410-b5e6-96231b3b80d8

autoconf/configure.ac
include/llvm/Config/config.h.cmake
include/llvm/Target/TargetSelect.h

index bd05891a9dc7bbf3f164ec1291283e2121c09165..0abe2347957d7cdd0759101ae5a8878708475f24 100644 (file)
@@ -447,7 +447,8 @@ AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD)
 # If so, define LLVM_NATIVE_ARCH to that LLVM target.
 for a_target in $TARGETS_TO_BUILD; do
   if test "$a_target" = "$LLVM_NATIVE_ARCH"; then
-    AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCH,
+    LLVM_NATIVE_ARCHTARGET="${LLVM_NATIVE_ARCH}Target"
+    AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCHTARGET,
       [LLVM architecture name for the native architecture, if available])
   fi
 done
index c59ed23d8b25f58743e79a128455048d50f2c1f8..4356e7dc1452d1cd29ceb85b83909580a8ed0853 100644 (file)
 #cmakedefine strdup ${strdup}
 
 /* Native LLVM architecture */
-#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}
+#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}Target
index 8544eed76be7ebf35b2c9daa828820757ab4f09e..8aa314ac774733e2bf2cbc82dea8cd0c18c005b4 100644 (file)
@@ -50,9 +50,9 @@ namespace llvm {
   inline bool InitializeNativeTarget() {
   // If we have a native target, initialize it to ensure it is linked in.
 #ifdef LLVM_NATIVE_ARCH
-#define DoInit2(TARG, MOD)   llvm::Initialize ## TARG ## MOD()
-#define DoInit(T, M) DoInit2(T, M)
-    DoInit(LLVM_NATIVE_ARCH, Target);
+#define DoInit2(TARG)   llvm::Initialize ## TARG ()
+#define DoInit(T) DoInit2(T)
+    DoInit(LLVM_NATIVE_ARCH);
     return false;
 #undef DoInit
 #undef DoInit2