Template Haskell: improve lifting for strings
[ghc-hetmet.git] / libffi / ghc.mk
index ca6ee5e..0394d1d 100644 (file)
@@ -119,10 +119,13 @@ $(libffi_STAMP_CONFIGURE):
            PATH=`pwd`:$$PATH; \
            export PATH; \
            cd build && \
-           CC=$(WhatGccIsCalled) $(SHELL) configure \
-                 --enable-static=yes \
+           CC=$(WhatGccIsCalled) \
+        CFLAGS="$(SRC_CC_OPTS)" \
+        LDFLAGS="$(SRC_LD_OPTS)" \
+        $(SHELL) configure \
+                 --enable-static=yes \
                  --enable-shared=$(libffi_EnableShared) \
-                 --host=$(PLATFORM) --build=$(PLATFORM)
+                 --host=$(PLATFORM) --build=$(PLATFORM)
 
        # libffi.so needs to be built with the correct soname.
        # NOTE: this builds libffi_convience.so with the incorrect
@@ -145,6 +148,7 @@ $(libffi_STAMP_BUILD): $(libffi_STAMP_CONFIGURE)
        cd libffi && \
          $(MAKE) -C build MAKEFLAGS=; \
          (cd build; ./libtool --mode=install cp libffi.la $(TOP)/libffi)
+       touch $@
 
 $(libffi_STATIC_LIB): $(libffi_STAMP_BUILD)
 # Rename libffi.a to libHSffi.a
@@ -162,7 +166,7 @@ $(eval $(call all-target,libffi,libffi/libHSffi.a libffi/libHSffi_p.a))
 libffi/HSffi.o: libffi/libHSffi.a
        cd libffi && \
          touch empty.c; \
-         $(CC) -c empty.c -o HSffi.o
+         $(CC) $(SRC_CC_OPTS) -c empty.c -o HSffi.o
 
 $(eval $(call all-target,libffi,libffi/HSffi.o))