diff options
author | Ian Lynagh <igloo@earth.li> | 2008-01-12 23:42:15 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2008-01-12 23:42:15 +0000 |
commit | ff073cf32346caaa00f2c15161c88de6a3c5f8db (patch) | |
tree | f5564327a29fd3376ee4f05cb43b56f411566db0 /utils/hsc2hs | |
parent | 6c63d47d89e94125951b1a6d810623466af77d08 (diff) | |
download | haskell-ff073cf32346caaa00f2c15161c88de6a3c5f8db.tar.gz |
Add GMP_INCLUDE_DIRS in a couple of places
Fixes the build on OpenBSD (trac #2009). Based on a patch from kili.
Diffstat (limited to 'utils/hsc2hs')
-rw-r--r-- | utils/hsc2hs/Makefile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/utils/hsc2hs/Makefile b/utils/hsc2hs/Makefile index 70d027f1bb..de8d64f06b 100644 --- a/utils/hsc2hs/Makefile +++ b/utils/hsc2hs/Makefile @@ -39,9 +39,17 @@ else extra_flags= endif +nothing= +space=$(nothing) $(nothing) +# Given +# foo bar +# make +# :\"-Ifoo\":\"-Ibar\" +GMP_INCLUDE_DIRS_STRINGS = $(subst $(space),,$(foreach d,$(GMP_INCLUDE_DIRS),:\"-I$(d)\")) + $(INPLACE_HS): Makefile $(FPTOOLS_TOP)/mk/config.mk echo "import System.Cmd; import System.Environment; import System.Exit" > $@ - echo "main = do args <- getArgs; rawSystem \"$(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/$(HS_PROG)\" (\"--template=$(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/template-hsc.h\":\"--cc=$(CC)\":\"--ld=$(CC)\"$(patsubst %,:\"%\",$(extra_flags)):\"--cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt)\":\"-I$(FPTOOLS_TOP_ABS)/$(GHC_INCLUDE_DIR_REL)\":\"-I$(FPTOOLS_TOP_ABS)/gmp/gmpbuild\":args) >>= exitWith" >> $@ + echo "main = do args <- getArgs; rawSystem \"$(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/$(HS_PROG)\" (\"--template=$(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)/template-hsc.h\":\"--cc=$(CC)\":\"--ld=$(CC)\"$(patsubst %,:\"%\",$(extra_flags)):\"--cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt)\":\"-I$(FPTOOLS_TOP_ABS)/$(GHC_INCLUDE_DIR_REL)\":\"-I$(FPTOOLS_TOP_ABS)/gmp/gmpbuild\"$(GMP_INCLUDE_DIRS_STRINGS):args) >>= exitWith" >> $@ $(INPLACE_PROG): $(INPLACE_HS) $(HC) --make $< -o $@ |