2009-10-27 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Tue, 27 Oct 2009 18:49:34 +0000 (18:49 -0000)
committerZoltan Varga <vargaz@gmail.com>
Tue, 27 Oct 2009 18:49:34 +0000 (18:49 -0000)
* configure.in: Add support for cross-compiling to ppc.

svn path=/trunk/mono/; revision=144911

ChangeLog
configure.in

index 218d4472b37a8363965f332ae8070c2d766f345f..39063c731303ddd4836b392943916122406d820f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-27  Zoltan Varga  <vargaz@gmail.com>
+
+       * configure.in: Add support for cross-compiling to ppc.
+
 2009-10-22  Rodrigo Kumpera  <rkumpera@novell.com>
 
        * configure.in: Add check for the deprecated attribute.
index a6f20bb03fb173668027251f05f73c57766e99ca..ddf375265e16c84fe248872f17c21a40d897e437 100644 (file)
@@ -829,6 +829,23 @@ dnl
 dnl End of libgc checks
 dnl
 
+dnl *************************************
+dnl *** Checks for zero length arrays ***
+dnl *************************************
+AC_MSG_CHECKING(whether $CC supports zero length arrays)
+AC_TRY_COMPILE([
+       struct s {
+               int  length;
+               char data [0];
+       };
+], [], [
+       AC_MSG_RESULT(yes)
+       AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 0, [Length of zero length arrays])
+], [
+       AC_MSG_RESULT(no)
+       AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 1, [Length of zero length arrays])
+])
+
 if test x$platform_win32 = xno; then
 
        dnl hires monotonic clock support
@@ -1142,23 +1159,6 @@ if test x$platform_win32 = xno; then
        AC_MSG_RESULT($mono_cv_sizeof_sunpath)
        AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $mono_cv_sizeof_sunpath, [Sizeof sock_un.sun_path])
 
-       dnl *************************************
-       dnl *** Checks for zero length arrays ***
-       dnl *************************************
-       AC_MSG_CHECKING(whether $CC supports zero length arrays)
-       AC_TRY_COMPILE([
-                struct s {
-                        int  length;
-                        char data [0];
-                };
-        ], [], [
-               AC_MSG_RESULT(yes)
-               AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 0, [Length of zero length arrays])
-       ], [
-               AC_MSG_RESULT(no)
-               AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 1, [Length of zero length arrays])
-       ])
-
        dnl *****************************
        dnl *** Checks for libxnet    ***
        dnl *****************************
@@ -2068,6 +2068,25 @@ case "$host" in
                ;;
 esac
 
+if test "x$host" != "x$target"; then
+   case "$target" in
+   powerpc64-ps3-linux-gnu)
+               TARGET=POWERPC64
+               arch_target=powerpc64
+               AC_DEFINE(TARGET_PS3, 1, [...])
+               AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
+               # It would be better to just use TARGET_POWERPC64, but lots of code already
+               # uses this define
+               AC_DEFINE(__mono_ppc64__, 1, [...])
+               AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
+               sizeof_register=8
+               target_byte_order=G_BIG_ENDIAN
+               ;;
+       *)
+               AC_MSG_ERROR([Cross compiling is only supported for targets matching 'powerpc64-ps3-linux-gnu'])
+       esac
+fi
+
 # FIXME: Define the others as well
 case "$TARGET" in
 X86)