Browse Source

In .:
2008-03-12 Geoff Norton <[email protected]>

* build-iphone.sh: A autogen/make wrapper to define everything to build
mono for the iphone.
* configure.in: Add support for arm-apple-darwin (iPhone).


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

Geoff Norton 18 years ago
parent
commit
d94aec877f
3 changed files with 62 additions and 6 deletions
  1. 6 0
      ChangeLog
  2. 37 0
      build-iphone.sh
  3. 19 6
      configure.in

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2008-03-12  Geoff Norton  <[email protected]>
+
+	* build-iphone.sh: A autogen/make wrapper to define everything to build
+	mono for the iphone.
+	* configure.in: Add support for arm-apple-darwin (iPhone).
+
 2008-03-05  Wade Berrier  <[email protected]>
 
 	* scripts/Makefile.am: fix typo so that 'scripts_defaults' scripts get

+ 37 - 0
build-iphone.sh

@@ -0,0 +1,37 @@
+#!/bin/sh
+ASPEN_ROOT=/Developer/Platforms/Aspen.platform/Developer
+ASPEN_SDK=$ASPEN_ROOT/SDKs/Aspen1.2.sdk/
+
+export PATH=$ASPEN_ROOT/usr/bin:$PATH
+
+export C_INCLUDE_PATH="$ASPEN_SDK/usr/lib/gcc/arm-apple-darwin9/4.0.1/include:$ASPEN_SDK/usr/include"
+export CC=arm-apple-darwin9-gcc-4.0.1
+export CXX=arm-apple-darwin9-g++-4.0.1
+export CPP="cpp-4.0 -nostdinc -U__i386__ -D__arm__"
+export CXXPP="cpp-4.0 -nostdinc -U__i386__ -D__arm__"
+export LD=$CC
+export LDFLAGS=-Wl,-syslibroot,$ASPEN_SDK
+
+export mono_cv_uscore=yes
+export cv_mono_sizeof_sunpath=104
+export ac_cv_func_posix_getpwuid_r=yes
+export ac_cv_func_backtrace_symbols=no
+
+pushd eglib 
+./autogen.sh --host=arm-apple-darwin9
+popd
+
+./autogen.sh --disable-mcs-build --host=arm-apple-darwin9 --disable-shared-handles --with-tls=pthread --with-sigaltstack=no --with-glib=embedded --with-gc=none $@
+
+curl -o mono/mini/inssel.c http://primates.ximian.com/~gnorton/iphone/inssel.c
+curl -o mono/mini/inssel.h http://primates.ximian.com/~gnorton/iphone/inssel.h
+
+make
+
+# We dont use monoburg since I nicely provided the inssel's pregenerated above.
+pushd mono/monoburg
+$CC -o monoburg ./monoburg.c parser.c -I../../eglib/src -I../../eglib/src -I. -I../..  -Wl,-syslibroot,/Developer/Platforms/Aspen.platform/Developer/SDKs/Aspen1.2.sdk/ -pthread -L../../eglib/src/.libs -leglib -lm
+touch sample.c
+popd
+
+make

+ 19 - 6
configure.in

@@ -232,6 +232,9 @@ case "$host" in
 		no_version_script=yes
 		libdl=
 		libgc_threads=pthreads
+		if test "x$cross_compiling" = "xyes"; then
+			has_broken_apple_cpp=yes
+		fi
 		;;
 	*)
 		AC_MSG_WARN([*** Please add $host to configure.in checks!])
@@ -1300,11 +1303,13 @@ if test x$platform_win32 = xno; then
 	dnl *** Checks for math functions ***
 	dnl *********************************
         LIBS="$LIBS -lm";
-        AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
-                AC_TRY_LINK([#include <math.h>], 
-                [ finite(0.0); ], 
-                AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
-                AC_MSG_RESULT(no)))
+	if text "x$has_broken_apple_cpp" != "xyes"; then
+	        AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
+	                AC_TRY_LINK([#include <math.h>], 
+	                [ finite(0.0); ], 
+	                AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
+	                AC_MSG_RESULT(no)))
+	fi
         AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
                 AC_TRY_LINK([#include <math.h>], 
                 [ isfinite(0.0); ], 
@@ -1779,6 +1784,14 @@ case "$host" in
 		JIT_SUPPORTED=yes
 		jit_wanted=true
 		;;
+	arm*-darwin*)
+		TARGET=ARM;
+		arch_target=arm;
+		ACCESS_UNALIGNED="no"
+		JIT_SUPPORTED=yes
+		CPPFLAGS="$CPPFLAGS -DARM_FPU_NONE=1"
+		jit_wanted=true
+		;;
 	arm*-linux*)
 		TARGET=ARM;
 		arch_target=arm;
@@ -1949,7 +1962,7 @@ if test "x$with_tls" = "x__thread"; then
 	])
 fi
 
-if test ${TARGET} = ARM; then
+if test ${TARGET} = ARM && test x$cross_compiling = xno && test x$enable_mcs_build != xno; then
 	dnl ******************************************
 	dnl *** Check to see what FPU is available ***
 	dnl ******************************************