Fixes for building on machines that don't have gmp
authorIan Lynagh <igloo@earth.li>
Mon, 15 Jun 2009 20:23:52 +0000 (20:23 +0000)
committerIan Lynagh <igloo@earth.li>
Mon, 15 Jun 2009 20:23:52 +0000 (20:23 +0000)
cbits/mkGmpDerivedConstants.c
configure.ac
gmp/ghc.mk

index f3d551d..ed07111 100644 (file)
 
 #define OFFSET(s_type, field) ((size_t)&(((s_type*)0)->field))
 
-#ifdef mingw32_HOST_OS
-#define SIZET_FMT "d"
-#else
-#define SIZET_FMT "zd"
-#endif
-
-
 /* struct_size(TYPE)
  *
  */
@@ -41,7 +34,7 @@
  *
  */
 #define def_offset(str, offset) \
-    printf("#define OFFSET_" str " %" SIZET_FMT "\n", offset);
+    printf("#define OFFSET_" str " %d\n", (int)(offset));
 
 #define field_offset_(str, s_type, field) \
     def_offset(str, OFFSET(s_type,field));
index 1feae2c..bac536d 100644 (file)
@@ -81,7 +81,7 @@ dnl * Generate the header cbits/GmpDerivedConstants.h
 dnl--------------------------------------------------------------------
 
 AC_MSG_NOTICE([generating GmpDerivedConstants.h])
-${CC} cbits/mkGmpDerivedConstants.c -o cbits/mkGmpDerivedConstants
+${CC} $CFLAGS cbits/mkGmpDerivedConstants.c -o cbits/mkGmpDerivedConstants
 cbits/mkGmpDerivedConstants > cbits/GmpDerivedConstants.h
 rm cbits/mkGmpDerivedConstants
 
index ba0c8bc..76350f7 100644 (file)
@@ -39,6 +39,12 @@ ifneq "$(HaveFrameworkGMP)" "YES"
 GMP_LIB = libraries/integer-gmp/gmp/libgmp.a
 OTHER_LIBS += $(GMP_LIB)
 
+SRC_CC_OPTS += -I$(TOP)/libraries/integer-gmp/gmp
+SRC_LD_OPTS += -L$(TOP)/libraries/integer-gmp/gmp
+libraries/integer-gmp_dist-install_CONFIGURE_OPTS += --extra-lib-dirs=$(TOP)/libraries/integer-gmp/gmp
+
+libraries/integer-gmp/dist-install/package-data.mk: libraries/integer-gmp/gmp/gmp.h
+
 INSTALL_LIBS += libraries/integer-gmp/gmp/libgmp.a
 INSTALL_HEADERS += libraries/integer-gmp/gmp/gmp.h