Browse code

Fix bytecode and autoitea06 for Apple-style universal builds (bb #2030)

Bytecode needs to enable both PPC and X86, link in all targets,
and autoit needs fpu_endian == cpu_endian for universal builds.

Török Edvin authored on 2010/10/18 17:26:01
Showing 4 changed files
... ...
@@ -2064,7 +2064,11 @@ int bytecode_init(void)
2064 2064
 
2065 2065
     // If we have a native target, initialize it to ensure it is linked in and
2066 2066
     // usable by the JIT.
2067
+#ifndef AC_APPLE_UNIVERSAL_BUILD
2067 2068
     InitializeNativeTarget();
2069
+#else
2070
+    InitializeAllTargets();
2071
+#endif
2068 2072
 
2069 2073
     if (!llvm_is_multithreaded()) {
2070 2074
 	//TODO:cli_dbgmsg
... ...
@@ -25,6 +25,7 @@ AM_SILENT_RULES([yes])
25 25
 
26 26
 cxxset=${CXXFLAGS+set}
27 27
 AC_PROG_CXX
28
+AC_C_BIGENDIAN
28 29
 
29 30
 if test "$cxxset" != set; then
30 31
 # don't use the default -O2 -g because -g bloats the C++ binaries too much
... ...
@@ -210,6 +211,10 @@ if test "$enable_alltargets" = "yes"; then
210 210
 	build_ppc=yes
211 211
 	build_arm=yes
212 212
 fi
213
+if test "$ac_cv_c_bigendian" = "universal"; then
214
+    build_x86 = yes
215
+    build_ppc = yes
216
+fi
213 217
 AM_CONDITIONAL(BUILD_X86, [test "$build_x86" = "yes"])
214 218
 AM_CONDITIONAL(BUILD_PPC, [test "$build_ppc" = "yes"])
215 219
 AM_CONDITIONAL(BUILD_ARM, [test "$build_arm" = "yes"])
... ...
@@ -116,8 +116,10 @@ void cli_detect_env_jit(struct cli_environment *env)
116 116
 	    earch = arch_unknown;
117 117
 	    break;
118 118
     }
119
+#ifndef AC_APPLE_UNIVERSAL_BUILD
119 120
     if (conflicts)
120 121
 	warn_assumptions("CPU architecture", env->arch, earch);
122
+#endif
121 123
     if (earch != arch_unknown)
122 124
 	env->arch = earch;
123 125
 
... ...
@@ -605,6 +605,9 @@ fi
605 605
 if ${GREP-grep} elleemme conftest.$ac_objext >/dev/null 2>&1 ; then
606 606
 	ac_cv_c_fpu_bigendian=no
607 607
 fi
608
+if test "$ac_cv_c_bigendian" = "universal"; then
609
+        ac_cv_c_fpu_bigendian=universal
610
+fi
608 611
 ])
609 612
 fi
610 613
 
... ...
@@ -619,6 +622,10 @@ case $ac_cv_c_fpu_bigendian in
619 619
 		AC_DEFINE([FPU_WORDS_BIGENDIAN], 0, [FPU byte ordering is little endian])
620 620
                 have_autoitea06="yes"
621 621
 		;;
622
+	universal)
623
+	        AC_DEFINE([FPU_WORDS_BIGENDIAN], [WORDS_BIGENDIAN], [FPU byte ordering matches CPU])
624
+                have_autoitea06="yes"
625
+		;;
622 626
 	*)
623 627
 		AC_MSG_WARN([Unable to determine FPU endianess, some features may not be available in this build])
624 628
 esac