changeset 3554:b1ca68ddd02c

build native-gcc using untared dependancies within gcc source tree * src/native-gcc.mk: untar gmp, mpc, mpfr, cloog and isl into the gcc source tree before configure and build, set sysroot. * src/native-binutils.mk: set sysroot path. * src/mingw-w64-1-math-h.patch, mingw-w64-2-float-h.patch: New files.
author John Donoghue <john.donoghue@ieee.org>
date Fri, 21 Feb 2014 06:05:39 -0500
parents c27b154dab6c
children a0eaddc0b7ba
files src/mingw-w64-1-math-h.patch src/mingw-w64-2-float-h.patch src/native-gcc.mk
diffstat 3 files changed, 60 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mingw-w64-1-math-h.patch	Fri Feb 21 06:05:39 2014 -0500
@@ -0,0 +1,18 @@
+This file is part of MXE.
+See index.html for further information.
+
+This patch was taken from:
+https://sourceforge.net/p/mingw-w64/code/6479/
+
+--- a/mingw-w64-headers/crt/math.h
++++ b/mingw-w64-headers/crt/math.h
+@@ -36,7 +36,7 @@
+ #endif
+ #endif
+ 
+-#ifndef __STRICT_ANSI__
++#if !defined(__STRICT_ANSI__) || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 
+ #define M_E		2.7182818284590452354
+ #define M_LOG2E		1.4426950408889634074
+ #define M_LOG10E	0.43429448190325182765
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mingw-w64-2-float-h.patch	Fri Feb 21 06:05:39 2014 -0500
@@ -0,0 +1,25 @@
+This file is part of MXE.
+See index.html for further information.
+
+workaround for -isystem flag messing up include order
+https://bugzilla.redhat.com/show_bug.cgi?id=843436
+
+diff -ur a/mingw-w64-headers/crt/float.h b/mingw-w64-headers/crt/float.h
+--- a/mingw-w64-headers/crt/float.h	2014-01-11 21:38:50.640418500 +1100
++++ b/mingw-w64-headers/crt/float.h	2014-01-11 21:44:08.528393903 +1100
+@@ -105,6 +105,15 @@
+ 	#define DBL_MAX_10_EXP	__DBL_MAX_10_EXP__
+ 	#define LDBL_MAX_10_EXP	__LDBL_MAX_10_EXP__
+ 
++    /* The difference between 1 and the least value greater than 1 that is
++    representable in the given floating point type, b**1-p.  */
++    #undef FLT_EPSILON
++    #undef DBL_EPSILON
++    #undef LDBL_EPSILON
++    #define FLT_EPSILON __FLT_EPSILON__
++    #define DBL_EPSILON __DBL_EPSILON__
++    #define LDBL_EPSILON    __LDBL_EPSILON__
++
+ 	/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown.  */
+ 	/* ??? This is supposed to change with calls to fesetround in <fenv.h>.  */
+ 	#undef FLT_ROUNDS
--- a/src/native-gcc.mk	Tue Feb 25 21:10:04 2014 -0500
+++ b/src/native-gcc.mk	Fri Feb 21 06:05:39 2014 -0500
@@ -24,8 +24,8 @@
     --disable-nls \
     --without-x \
     --disable-win32-registry \
-    --enable-threads=win32 \
-    --with-native-system-header-dir='$(HOST_PREFIX)/include'
+    --with-native-system-header-dir='$(HOST_PREFIX)/include' \
+    --enable-threads=win32 
   ifneq ($(ENABLE_64),yes)
     $(PKG)_SYSDEP_CONFIGURE_OPTIONS += \
       --disable-sjlj-exceptions
@@ -40,6 +40,19 @@
 endef
 
 define $(PKG)_BUILD
+    # unpack support libraries
+    cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gmp,$(TAR))
+    mv '$(1)/$(gmp_SUBDIR)' '$(1)/gmp'
+    cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,mpc,$(TAR))
+    mv '$(1)/$(mpc_SUBDIR)' '$(1)/mpc'
+    cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,mpfr,$(TAR))
+    mv '$(1)/$(mpfr_SUBDIR)' '$(1)/mpfr'
+    cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,cloog,$(TAR))
+    mv '$(1)/$(cloog_SUBDIR)' '$(1)/cloog'
+    cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,isl,$(TAR))
+    mv '$(1)/$(isl_SUBDIR)' '$(1)/isl'
+    #--with-native-system-header-dir='/include'
+
     # configure gcc
     mkdir '$(1).build'
     cd    '$(1).build' && '$(1)/configure' \
@@ -52,6 +65,8 @@
         $(ENABLE_SHARED_OR_STATIC) \
         --disable-libgomp \
         --disable-libmudflap \
+        --with-mpfr-include='$(1)/mpfr/src' \
+        --with-mpfr-lib='$(1).build/mpfr/src/.libs' \
         $(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'")
 
     $(MAKE) -C '$(1).build' -j '$(JOBS)'