Support building on 10.6
authorGeoff Norton <grompf@sublimeintervention.com>
Mon, 9 Nov 2009 23:02:52 +0000 (23:02 -0000)
committerGeoff Norton <grompf@sublimeintervention.com>
Mon, 9 Nov 2009 23:02:52 +0000 (23:02 -0000)
svn path=/trunk/mono/; revision=145784

configure.in
eglib/configure.ac

index 05662d6128672cf0128bbdcb5828d9d8522d595f..73a46eac4133dac2482fc9f8c75d703ee96a47d6 100644 (file)
@@ -40,6 +40,8 @@ fi
 # libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
 CPPFLAGS_FOR_LIBGC=$CPPFLAGS
 CFLAGS_FOR_LIBGC=$CFLAGS
+CPPFLAGS_FOR_EGLIB=$CPPFLAGS
+CFLAGS_FOR_EGLIB=$CFLAGS
 
 #
 # These are the flags that need to be stored in the mono.pc file for 
@@ -217,6 +219,22 @@ case "$host" in
                if test "x$cross_compiling" = "xyes"; then
                        has_broken_apple_cpp=yes
                fi
+               dnl Snow Leopard is horribly broken -- it reports itself as i386-apple-darwin10.0.0, but
+               dnl its gcc defaults to 64-bit mode.  They have also deprecated the usage of ucontext
+               dnl we need to set some flags to build our 32-bit binaries on 10.6 properly
+               case "$host" in
+                       i*86-*-darwin10*)
+                               BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE -mmacosx-version-min=10.5"
+                               CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_FLAGS"
+                               CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
+                               CXXFLAGS="$CXXFLAGS $BROKEN_DARWIN_FLAGS"
+                               CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS"
+                               CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
+                               CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
+                               CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
+                               CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
+                               ;;
+               esac
                ;;
        *)
                AC_MSG_WARN([*** Please add $host to configure.in checks!])
@@ -481,6 +499,7 @@ embedded)
   GMODULE_CFLAGS="$GLIB_CFLAGS"
   GMODULE_LIBS="$GLIB_LIBS"
   eglib_dir=eglib
+  ac_configure_args="$ac_configure_args \"CPPFLAGS_FOR_EGLIB=$EGLIB_CPPFLAGS\" \"CFLAGS_FOR_EGLIB=$CFLAGS_FOR_EGLIB\""
   AC_CONFIG_SUBDIRS(eglib)
   ;;
 system)
index a32caf55cfa8b84203c3805c7bd8cc91539f190a..ba00f9b2100e3908a9c22d74444c2635a081e7b3 100644 (file)
@@ -24,9 +24,17 @@ AC_SUBST(GNUC_UNUSED)
 AC_SUBST(GNUC_NORETURN)
 AC_SUBST(BREAKPOINT)
 
+# We use a separate variable to pass down CPPFLAGS and CFLAGS from the main mono 
+# configure, because of autoconf brokeness
+if test "x$CPPFLAGS_FOR_EGLIB" != "x"; then
+   CPPFLAGS=$CPPFLAGS_FOR_EGLIB
+fi
+if test "x$CFLAGS_FOR_EGLIB" != "x"; then
+   CFLAGS=$CFLAGS_FOR_EGLIB
+fi
+
 AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
 AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
-AC_SUBST(ORDER)
 
 case $host in
 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
@@ -45,8 +53,12 @@ case $target in
 arm*-darwin*)
     CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
     ;;
+i*86-*-darwin*)
+    ORDER=G_LITTLE_ENDIAN
+    ;;
 esac
 
+AC_SUBST(ORDER)
 AC_SUBST(CFLAGS)
 AC_SUBST(PATHSEP)
 AC_SUBST(SEARCHSEP)