# 
# old_revision [2dbe16c664c34df6b096bd7293f9257047773b93]
# 
# add_file "packages/mono/files/configure-svnr87352.patch"
#  content [ee2b450e7b623338881e51ad58b6a8cd7c4bdeb2]
# 
# add_file "packages/mono/mono-mcs-intermediate.inc"
#  content [ece31464cff70bcaf69ba895f3b5b45659766426]
# 
# add_file "packages/mono/mono-mcs-intermediate_svn.bb"
#  content [7ee1dad6dca3b56f4da5bf058d4a71b636021918]
# 
# add_file "packages/mono/mono_svn.bb"
#  content [3328353eac6d44a486ea3348fd54ebaebde29a22]
# 
# add_file "packages/mono/mono_svn.inc"
#  content [cbd7a69e5c9d0f561dc9a539994fb5a2d2620fcd]
# 
# patch "packages/mono/mono-mcs-intermediate_1.2.5.1.bb"
#  from [2ee32eae113d1eb2ffece418f247aa0795b8d560]
#    to [b1c97b50bcd2738fbee4b780e60dc16d16bd3f5d]
# 
============================================================
--- packages/mono/files/configure-svnr87352.patch	ee2b450e7b623338881e51ad58b6a8cd7c4bdeb2
+++ packages/mono/files/configure-svnr87352.patch	ee2b450e7b623338881e51ad58b6a8cd7c4bdeb2
@@ -0,0 +1,21 @@
+--- mono/configure.in.orig	2007-10-11 21:05:59.000000000 +0200
++++ mono/configure.in	2007-10-11 23:44:23.000000000 +0200
+@@ -1148,6 +1148,8 @@
+ 		], [
+ 				AC_MSG_RESULT(no)
+ 				with_tls=pthread
++		], [
++				AC_MSG_RESULT(yes)
+ 		])
+ 	fi
+ 
+@@ -1250,6 +1252,9 @@
+ 		], [
+ 				with_sigaltstack=no
+ 				AC_MSG_RESULT(no)
++		], [
++				AC_MSG_RESULT(yes)
++				AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
+ 		])
+ 	fi
+ 
============================================================
--- packages/mono/mono-mcs-intermediate.inc	ece31464cff70bcaf69ba895f3b5b45659766426
+++ packages/mono/mono-mcs-intermediate.inc	ece31464cff70bcaf69ba895f3b5b45659766426
@@ -0,0 +1,60 @@
+# This is a straw-man recipe for step 1 in the two-step build of
+# mono. Because it's impossible to build the mcs directory
+# in cross-compile mode, this recipe will do a native build,
+# then tar the resulting install tree for usage by the mono
+# package in step 2.
+# See http://www.mono-project.com/Mono:ARM
+
+PR = "r0"
+DEPENDS = "mono-native glib-2.0-native perl-native"
+
+PARALLEL_MAKE = ""
+
+SRC_URI += "file://mono-fix-libdir-path.patch;patch=1"
+
+# Inherit native to set up compiler and paths ...
+inherit native
+# ... but override the target prefix
+prefix = "/usr"
+exec_prefix = "/usr"
+sysconfdir = "/etc"
+# TODO: Where does the mono package get
+# these paths from? Use the same source.
+
+do_fix_libtool_name() {
+	# inherit native will make that all native tools that are being
+	# built are prefixed with something like "i686-linux-",
+	# including libtool. Fix up some hardcoded libtool names:
+	for i in "${S}"/runtime/*-wrapper.in; do
+		sed -e "s/libtool/${BUILD_SYS}-libtool/" -i "${i}"
+	done
+}
+addtask fix_libtool_name after do_patch before do_configure
+
+do_stage() {
+	true
+}
+
+do_install() {
+	oe_runmake 'DESTDIR=${D}' install
+}
+
+do_package() {
+	true
+}
+
+do_populate_staging() {
+	cd ${D}
+	rm -f ${WORKDIR}/mono-mcs-${PV}.tar.gz
+	tar -cvzf ${WORKDIR}/mono-mcs-${PV}.tar.gz .
+	install -d ${STAGING_DIR}/share/mono-mcs
+	cp ${WORKDIR}/mono-mcs-${PV}.tar.gz ${STAGING_DIR}/share/mono-mcs/
+}
+
+do_package_write_ipk() {
+	true
+}
+
+do_package_write() {
+	true
+}
============================================================
--- packages/mono/mono-mcs-intermediate_svn.bb	7ee1dad6dca3b56f4da5bf058d4a71b636021918
+++ packages/mono/mono-mcs-intermediate_svn.bb	7ee1dad6dca3b56f4da5bf058d4a71b636021918
@@ -0,0 +1,12 @@
+# This is a straw-man recipe for step 1 in the two-step build of
+# mono. Because it's impossible to build the mcs directory
+# in cross-compile mode, this recipe will do a native build,
+# then tar the resulting install tree for usage by the mono
+# package in step 2.
+# See http://www.mono-project.com/Mono:ARM
+
+require mono_svn.inc
+require mono-mcs-intermediate.inc
+
+DEFAULT_PREFERENCE = "-1"
+EXTRA_OECONF_append = " --without-tls "
============================================================
--- packages/mono/mono_svn.bb	3328353eac6d44a486ea3348fd54ebaebde29a22
+++ packages/mono/mono_svn.bb	3328353eac6d44a486ea3348fd54ebaebde29a22
@@ -0,0 +1,95 @@
+require mono_svn.inc
+
+DEPENDS = "mono-native mono-mcs-intermediate glib-2.0 perl-native"
+
+PR = "r0"
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI += "file://configure-svnr87352.patch;patch=1"
+
+# Per http://www.mono-project.com/Mono:ARM
+EXTRA_OECONF += " --disable-mcs-build "
+# Instead, get the mcs tree from a different build (see mono-mcs-intermediate)
+
+do_install_prepend() {
+	install -d ${D}
+	pushd ${D}
+	tar -xzf ${STAGING_DIR}/share/mono-mcs/mono-mcs-${PV}.tar.gz
+	popd
+}
+
+do_install_append() {
+	# mono-mcs-intermediate builds and installs jay (a Yacc for Java and C#),
+	# however, jay is not being cross-compiled and thus only
+	# available for the buildhost architecture, so remove it
+	# entirely
+	pushd ${D}
+	rm -rf ./usr/share/man/man1/jay.1 ./usr/share/jay \
+	    ./usr/share/jay/README.jay \
+	    ./usr/bin/jay
+	popd
+
+	# Not packaged with the default rules and apparently
+	# not used for anything
+	rm -rf ${D}${datadir}/mono-1.0/mono/cil/cil-opcodes.xml
+}
+
+inherit mono
+
+# Import file definitions from Debian
+require mono_1.2.5.1-files.inc
+
+# Add some packages
+PACKAGES_append = " mono-doc mono mono-runtime"
+
+FILES_mono-doc_append = " /usr/share/libgc-mono/ "
+
+FILES_mono = ""
+ALLOW_EMPTY_mono = "1"
+RDEPENDS_mono = "mono-common mono-jit"
+
+FILES_mono-runtime = ""
+ALLOW_EMPTY_mono-runtime = "1"
+RDEPENDS_mono-runtime = "mono-jit mono-gac"
+
+RDEPENDS_mono-jit = "mono-common"
+
+FILES_libmono-dev =+ " /usr/lib/libmono.la /usr/lib/libmono-profiler-cov.la /usr/lib/libmono-profiler-aot.la \
+	/usr/lib/libMonoPosixHelper.la /usr/lib/libMonoSupportW.la"
+FILES_libmono-dbg =+ " /usr/lib/.debug/libmono*.so.* /usr/lib/.debug/libikvm-native.so \
+	/usr/lib/.debug/libMonoPosixHelper.so /usr/lib/.debug/libMonoSupportW.so"
+
+# Packages not included in Debian
+PACKAGES_prepend = "libnunit2.2-cil-dbg libnunit2.2-cil-dev libnunit2.2-cil \
+	libmono-cecil0.6-cil-dbg libmono-cecil0.6-cil-dev libmono-cecil0.6-cil \
+	libmono-cecil-mdb0.2-cil-dbg libmono-cecil-mdb0.2-cil \
+	libmono-db2-1.0-cil-dbg libmono-db2-1.0-cil-dev libmono-db2-1.0-cil \
+	libmono-mozilla0.1-cil-dbg libmono-mozilla0.1-cil \
+	libmono-system-web-extensions1.0-cil-dbg libmono-system-web-extensions1.0-cil"
+
+FILES_libnunit2.2-cil = "/usr/lib/mono/gac/nunit.*/2.2.* /usr/lib/mono/1.0/nunit.*.dll"
+FILES_libnunit2.2-cil-dev = "/usr/lib/pkgconfig/mono-nunit.pc"
+FILES_libnunit2.2-cil-dbg = "/usr/lib/mono/gac/nunit*/2.2.*/nunit.*.dll.mdb"
+
+FILES_libmono-cecil0.6-cil = "/usr/lib/mono/gac/Mono.Cecil*/0.6.*"
+FILES_libmono-cecil0.6-cil-dbg = "/usr/lib/mono/gac/Mono.Cecil*/0.6.*/Mono.Cecil*.dll.mdb"
+FILES_libmono-cecil0.6-cil-dev = "/usr/lib/pkgconfig/cecil.pc"
+
+FILES_libmono-cecil-mdb0.2-cil = "/usr/lib/mono/gac/Mono.Cecil.Mdb/0.2.*"
+FILES_libmono-cecil-mdb0.2-cil-dbg = "/usr/lib/mono/gac/Mono.Cecil.Mdb/0.2.*/Mono.Cecil*.dll.mdb"
+
+FILES_libmono-db2-1.0-cil = "/usr/lib/mono/gac/IBM.Data.DB2/1.0* /usr/lib/mono/1.0/IBM.Data.DB2.dll"
+FILES_libmono-db2-1.0-cil-dbg = "/usr/lib/mono/gac/IBM.Data.DB2/1.0*/IBM.Data.DB2.dll.mdb"
+
+FILES_libmono-system2.0-cil-dbg_append = " /usr/lib/mono/gac/System.Core/3.5.*/*.mdb "
+FILES_libmono-system2.0-cil_append = " /usr/lib/mono/gac/System.Core/3.5.* "
+
+FILES_libmono-mozilla0.1-cil-dbg = "/usr/lib/mono/gac/Mono.Mozilla/0.1.0.0*/Mono.Mozilla.dll.mdb"
+FILES_libmono-mozilla0.1-cil = "/usr/lib/mono/gac/Mono.Mozilla/0.1.0.0*/Mono.Mozilla.dll"
+
+FILES_libmono-system-web-extensions1.0-cil-dbg = "/usr/lib/mono/gac/System.Web.Extensions*/1.0*/*.mdb"
+FILES_libmono-system-web-extensions1.0-cil =  "/usr/lib/mono/gac/System.Web.Extensions*/1.0*/*.dll"
+
+# Move .pc files
+FILES_libmono-cairo1.0-cil-dev = "/usr/lib/pkgconfig/mono-cairo.pc"
+PACKAGES =+ " libmono-cairo1.0-cil-dev "
============================================================
--- packages/mono/mono_svn.inc	cbd7a69e5c9d0f561dc9a539994fb5a2d2620fcd
+++ packages/mono/mono_svn.inc	cbd7a69e5c9d0f561dc9a539994fb5a2d2620fcd
@@ -0,0 +1,15 @@
+DESCRIPTION = "Mono Programming Language"
+SECTION = "devel/mono"
+LICENSE = "GPL LGPL X11"
+
+SRCREV = "87352"
+SRC_URI = "svn://anonsvn.mono-project.com/source/trunk/;module=mcs;rev=${SRCREV} \
+	svn://anonsvn.mono-project.com/source/trunk/;module=mono;rev=${SRCREV} "
+
+PV = "1.2.5.1+svnr${SRCREV}"
+S = "${WORKDIR}/mono"
+
+inherit autotools
+EXTRA_OECONF_arm = "--without-tls"
+EXTRA_OECONF_mipsel = "--without-tls"
+
============================================================
--- packages/mono/mono-mcs-intermediate_1.2.5.1.bb	2ee32eae113d1eb2ffece418f247aa0795b8d560
+++ packages/mono/mono-mcs-intermediate_1.2.5.1.bb	b1c97b50bcd2738fbee4b780e60dc16d16bd3f5d
@@ -6,56 +6,4 @@ require mono_1.2.5.inc
 # See http://www.mono-project.com/Mono:ARM
 
 require mono_1.2.5.inc
+require mono-mcs-intermediate.inc
-PR = "r0"
-DEPENDS = "mono-native glib-2.0-native perl-native"
-
-PARALLEL_MAKE = ""
-
-SRC_URI += "file://mono-fix-libdir-path.patch;patch=1"
-
-# Inherit native to set up compiler and paths ...
-inherit native
-# ... but override the target prefix
-prefix = "/usr"
-exec_prefix = "/usr"
-sysconfdir = "/etc"
-# TODO: Where does the mono package get
-# these paths from? Use the same source.
-
-do_fix_libtool_name() {
-	# inherit native will make that all native tools that are being
-	# built are prefixed with something like "i686-linux-",
-	# including libtool. Fix up some hardcoded libtool names:
-	for i in "${S}"/runtime/*-wrapper.in; do
-		sed -e "s/libtool/${BUILD_SYS}-libtool/" -i "${i}"
-	done
-}
-addtask fix_libtool_name after do_patch before do_configure
-
-do_stage() {
-	true
-}
-
-do_install() {
-	oe_runmake 'DESTDIR=${D}' install
-}
-
-do_package() {
-	true
-}
-
-do_populate_staging() {
-	cd ${D}
-	rm -f ${WORKDIR}/mono-mcs-${PV}.tar.gz
-	tar -cvzf ${WORKDIR}/mono-mcs-${PV}.tar.gz .
-	install -d ${STAGING_DIR}/share/mono-mcs
-	cp ${WORKDIR}/mono-mcs-${PV}.tar.gz ${STAGING_DIR}/share/mono-mcs/
-}
-
-do_package_write_ipk() {
-	true
-}
-
-do_package_write() {
-	true
-}
