Never try to use the system gmp on Windows
authorIan Lynagh <ian@well-typed.com>
Sat, 9 Feb 2013 21:55:20 +0000 (21:55 +0000)
committerIan Lynagh <ian@well-typed.com>
Sat, 9 Feb 2013 21:55:20 +0000 (21:55 +0000)
Apparently building on Windows failed when there is a system gmp
available.

configure.ac
gmp/ghc.mk
gmp/ln [changed mode: 0644->0755]

index d7c0b3e..5593ca2 100644 (file)
@@ -33,6 +33,12 @@ AC_ARG_WITH([gmp-framework-preferred],
     [GMP_PREFER_FRAMEWORK=YES],
     [GMP_PREFER_FRAMEWORK=NO])
 
+AC_ARG_WITH([intree-gmp],
+  [AC_HELP_STRING([--with-intree-gmp],
+    [force using the in-tree GMP])],
+    [GMP_FORCE_INTREE=YES],
+    [GMP_FORCE_INTREE=NO])
+
 dnl--------------------------------------------------------------------
 dnl * Detect gmp
 dnl--------------------------------------------------------------------
@@ -42,13 +48,16 @@ GMP_LIBS=
 HaveFrameworkGMP=NO
 GMP_FRAMEWORK=
 
-if test "$GMP_PREFER_FRAMEWORK" = "YES"
+if test "$GMP_FORCE_INTREE" != "YES"
 then
-    LOOK_FOR_GMP_FRAMEWORK
-    LOOK_FOR_GMP_LIB
-else
-    LOOK_FOR_GMP_LIB
-    LOOK_FOR_GMP_FRAMEWORK
+    if test "$GMP_PREFER_FRAMEWORK" = "YES"
+    then
+        LOOK_FOR_GMP_FRAMEWORK
+        LOOK_FOR_GMP_LIB
+    else
+        LOOK_FOR_GMP_LIB
+        LOOK_FOR_GMP_FRAMEWORK
+    fi
 fi
 if test "$HaveFrameworkGMP" = "YES" || test "$HaveLibGmp" = "YES"
 then
index b39f36a..227b52b 100644 (file)
@@ -33,6 +33,12 @@ clean_gmp:
        $(call removeTrees,libraries/integer-gmp/gmp/gmpbuild)
 endif
 
+ifeq "$(Windows)" "YES"
+# Apparently building on Windows fails when there is a system gmp
+# available, so we never try to use the system gmp on Windows
+libraries/integer-gmp_dist-install_CONFIGURE_OPTS += --configure-option=--with-intree-gmp
+endif
+
 ifeq "$(phase)" "final"
 
 ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
diff --git a/gmp/ln b/gmp/ln
old mode 100644 (file)
new mode 100755 (executable)