After spending a lot of time in Debian chroot's used for building
package I thought that there must be an easier way of building
circular dependencies.

The cunning feature is to build --with-sysroot & --with-build-sysroot.
Binutils & GCC support that.

In my debian packages I currently build with --prefix=/usr
--with-sysroot=/usr and now --with-build-sysroot=$(CURDIR)/sysroot

This way I can build each package in turn (binutils, headers, all-gcc,
crt, intall-gcc) with above configure options, and after each steps
doing $make install DESTDIR=$(CURDIR)/sysroot.

The benefit is that now you can do a local self-contained build with
$build_sysroot without installing anything into the intended $sysroot
for end-users.

The need is for debian packaging ;-) I can now walk into the buildd
jail with all sources and walk out with working cross-compiled
ready-for-consumption binary packages.

The hack is very crude and I understand that it might be rejected. Oh
well, at least I've tried.

Thanks.
=== modified file 'mingw-w64-crt/Makefile.am'
--- a/mingw-w64-crt/Makefile.am	2010-03-20 15:20:40 +0000
+++ b/mingw-w64-crt/Makefile.am	2010-03-25 12:09:20 +0000
@@ -13,7 +13,7 @@
 #AUTOMAKE_OPTIONS = color-tests
 
 if WITHSYSROOT
-  sysincludes...@target_system_root@/$(host)/include
+  sysincludes...@target_build_system_root@/$(host)/include
   withsys=--with-sysro...@target_system_root@
 else
   sysincludes=

=== modified file 'mingw-w64-crt/configure.ac'
--- a/mingw-w64-crt/configure.ac	2010-03-24 18:31:57 +0000
+++ b/mingw-w64-crt/configure.ac	2010-03-25 12:09:20 +0000
@@ -24,10 +24,27 @@
     ],[
       AC_MSG_RESULT([$with_sysroot])
       TARGET_SYSTEM_ROOT=$with_sysroot
+      AC_MSG_CHECKING([for build-sysroot])
+      AC_ARG_WITH([build-sysroot],
+      [AS_HELP_STRING([--with-build-sysroot=DIR],
+        [Search for include dir during build within DIR/mings.])],
+      [AS_CASE([$with_build_sysroot],
+        [no],[AC_MSG_RESULT([no])],
+        [yes],[AC_MSG_RESULT([none specified])
+          AC_MSG_ERROR([Please specify a directory to the --with-build-sysroot=DIR option])
+        ],[
+          AC_MSG_RESULT([$with_build_sysroot])
+	  TARGET_BUILD_SYSTEM_ROOT=$with_build_sysroot
+	  ])],
+	[
+	TARGET_BUILD_SYSTEM_ROOT=$with_sysroot
+	
+	])
       AC_MSG_CHECKING([if sysroot contains an include directory])
-      AS_IF([test -d $with_sysroot/$host/include],
-        [AC_MSG_RESULT([yes])],
-        [
+      AS_IF([test -d $with_build_sysroot/$host/include],
+        [AC_MSG_RESULT([yes])
+	export PATH=$TARGET_BUILD_SYSTEM_ROOT/bin$PATH_SEPARATOR$PATH
+	],[
           AC_MSG_RESULT([no])
           AC_MSG_ERROR([Sysroot directory does not contain $host/include])
           with_sysroot=no
@@ -37,10 +54,14 @@
   [
     AC_MSG_RESULT([no])
     TARGET_SYSTEM_ROOT=
+    TARGET_BUILD_SYSTEM_ROOT=
     with_sysroot=no
   ])
 AM_CONDITIONAL(WITHSYSROOT, test $with_sysroot != no)
 AC_SUBST(TARGET_SYSTEM_ROOT)
+AC_SUBST(TARGET_BUILD_SYSTEM_ROOT)
+
+echo $PATH
 
 # Checks for programs.
 # Checks for headers, libs, etc need to utilize the sysroot... no idea how

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to