diff src/gmp.mk @ 3076:b39e8dc859f7

[MSVC] enable gmplib compilation - create clgfortran.exe wrapper (to make libtool happy) - make cc-msvc/clgcc/clg++ to ignore --export-all-symbols and --output-def
author Michael Goffioul <michael.goffioul@gmail.com>
date Fri, 21 Jun 2013 19:50:36 -0400
parents 5ef49fb3299d
children cf6f40cededb
line wrap: on
line diff
--- a/src/gmp.mk	Fri Jun 21 15:39:22 2013 -0400
+++ b/src/gmp.mk	Fri Jun 21 19:50:36 2013 -0400
@@ -10,6 +10,13 @@
 $(PKG)_URL_2    := ftp://ftp.cs.tu-berlin.de/pub/gnu/$(PKG)/$($(PKG)_FILE)
 $(PKG)_DEPS     :=
 
+ifeq ($(MXE_SYSTEM),msvc)
+    $(PKG)_CONFIGURE_OPTIONS := CC_FOR_BUILD='$(MXE_CC)' CCAS='gcc -c' ac_cv_func_memset='yes'
+    COMMA := ,
+else
+    $(PKG)_CONFIGURE_OPTIONS := CC_FOR_BUILD=gcc
+endif
+
 define $(PKG)_UPDATE
     $(WGET) -q -O- 'http://www.gmplib.org/' | \
     grep '<a href="' | \
@@ -19,12 +26,15 @@
 endef
 
 define $(PKG)_BUILD
-    cd '$(1)' && CC_FOR_BUILD=gcc ./configure \
+    $(if $(filter msvc,$(MXE_SYSTEM)), \
+        $(SED) -i -e '/^#ifdef _MSC_VER/$(COMMA)/^#endif/ {/^ *#define __GMP_EXTERN_INLINE .*/d}' '$(1)/gmp-h.in')
+    cd '$(1)' && ./configure \
         $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
+        $($(PKG)_CONFIGURE_OPTIONS) \
         --prefix='$(HOST_PREFIX)' \
         $(ENABLE_SHARED_OR_STATIC) \
         --enable-cxx \
-        --without-readline
+        --without-readline && $(CONFIGURE_POST_HOOK)
     $(MAKE) -C '$(1)' -j '$(JOBS)'
     $(MAKE) -C '$(1)' -j 1 install
 endef