Fix building libgmp on cygwin
authorIan Lynagh <igloo@earth.li>
Fri, 16 Mar 2012 01:00:30 +0000 (01:00 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 16 Mar 2012 01:00:30 +0000 (01:00 +0000)
gmp/ghc.mk

index 78dfa8a..8c60e6f 100644 (file)
@@ -125,6 +125,12 @@ libraries/integer-gmp/gmp/libgmp.a libraries/integer-gmp/gmp/gmp.h:
        cat $(GMP_TARBALL) | $(BZIP2_CMD) -d | { cd libraries/integer-gmp/gmp && $(TAR_CMD) -xf - ; }
        mv libraries/integer-gmp/gmp/$(GMP_DIR) libraries/integer-gmp/gmp/gmpbuild
        chmod +x libraries/integer-gmp/gmp/ln
        cat $(GMP_TARBALL) | $(BZIP2_CMD) -d | { cd libraries/integer-gmp/gmp && $(TAR_CMD) -xf - ; }
        mv libraries/integer-gmp/gmp/$(GMP_DIR) libraries/integer-gmp/gmp/gmpbuild
        chmod +x libraries/integer-gmp/gmp/ln
+
+       # Their cmd invocation only works on msys. On cygwin it starts
+       # a cmd interactive shell. The replacement works in both environments.
+       mv libraries/integer-gmp/gmp/gmpbuild/ltmain.sh libraries/integer-gmp/gmp/gmpbuild/ltmain.sh.orig
+       sed 's#cmd //c echo "\$$1"#cmd /c "echo $$1"#' < libraries/integer-gmp/gmp/gmpbuild/ltmain.sh.orig > libraries/integer-gmp/gmp/gmpbuild/ltmain.sh
+
        cd libraries/integer-gmp/gmp; (set -o igncr 2>/dev/null) && set -o igncr; export SHELLOPTS; \
            PATH=`pwd`:$$PATH; \
            export PATH; \
        cd libraries/integer-gmp/gmp; (set -o igncr 2>/dev/null) && set -o igncr; export SHELLOPTS; \
            PATH=`pwd`:$$PATH; \
            export PATH; \