FIX BUILD `set -o igncr'-issue on FreeBSD
[ghc-hetmet.git] / gmp / Makefile
index f09c523..750dfb6 100644 (file)
@@ -14,6 +14,11 @@ ifneq "$(HaveFrameworkGMP)" "YES"
 
 PLATFORM := $(shell echo $(HOSTPLATFORM) | sed 's/i[567]86/i486/g')
 
+# 2007-09-26
+#     set -o igncr 
+# is not a valid command on non-Cygwin-systems.
+# Let it fail silently instead of aborting the build.
+#
 # 2007-07-05
 # We do
 #     set -o igncr; export SHELLOPTS
@@ -40,8 +45,9 @@ BUILD_SHARED=no
 endif
 
 boot :: stamp.gmp.static
-all :: libgmp.a
-install :: libgmp.a
+all :: gmp.h libgmp.a
+install :: gmp.h libgmp.a
+INSTALL_HEADERS += gmp.h
 INSTALL_LIBS += libgmp.a
 
 ifeq "$(BUILD_SHARED)" "yes"
@@ -57,7 +63,7 @@ stamp.gmp.static:
        $(TAR) -zxf $(GMP_TARBALL)
        mv $(GMP_DIR) gmpbuild
        chmod +x ln
-       set -o igncr; export SHELLOPTS; \
+       (set -o igncr 2>/dev/null) && set -o igncr; export SHELLOPTS; \
            export PATH=`pwd`:$$PATH; \
            cd gmpbuild && \
            CC=$(WhatGccIsCalled) $(SHELL) configure \
@@ -69,13 +75,16 @@ stamp.gmp.shared:
        $(TAR) -zxf $(GMP_TARBALL)
        mv $(GMP_DIR) gmpbuild-shared
        chmod +x ln
-       set -o igncr; export SHELLOPTS; \
+       (set -o igncr 2>/dev/null) && set -o igncr; export SHELLOPTS; \
            export PATH=`pwd`:$$PATH; \
            cd gmpbuild-shared && \
            CC=$(WhatGccIsCalled) $(SHELL) configure \
                  --enable-shared=yes --disable-static --host=$(PLATFORM) --build=$(PLATFORM)
        touch $@
 
+gmp.h: stamp.gmp.static
+       $(CP) gmpbuild/gmp.h .
+
 libgmp.a: stamp.gmp.static
        $(MAKE) -C gmpbuild MAKEFLAGS=
        $(CP) gmpbuild/.libs/libgmp.a .
@@ -114,6 +123,9 @@ endif
 ifneq "$(INSTALL_LIBS)" ""
        $(INSTALL_DATA)    $(INSTALL_LIBS)     $(BIN_DIST_DIR)/gmp/
 endif
+ifneq "$(INSTALL_HEADERS)" ""
+       $(INSTALL_HEADER)  $(INSTALL_HEADERS)  $(BIN_DIST_DIR)/gmp/
+endif
 
 endif
 endif