diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-11-05 14:13:10 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-11-05 14:13:10 +0000 |
commit | 723eb70f31b2b413a51387bbbfbe01bb9b8c5907 (patch) | |
tree | 2b801e6495e58c00a6f0dec1190e0ea4d565d66a /rules | |
parent | 4ea81579160f59983586ea11a56c60010e0c93ce (diff) | |
download | haskell-723eb70f31b2b413a51387bbbfbe01bb9b8c5907.tar.gz |
Fix #3642: m GHC builds using the Haskell Platform
Diffstat (limited to 'rules')
-rw-r--r-- | rules/build-package-way.mk | 4 | ||||
-rw-r--r-- | rules/distdir-way-opts.mk | 17 |
2 files changed, 15 insertions, 6 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index 95ec21b6b7..f7480aa258 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -54,11 +54,11 @@ else ifeq "$$($1_$2_SplitObjs)" "YES" $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) "$$(RM)" $$(RM_OPTS) $$@ - (echo $$($1_$2_$3_NON_HS_OBJS) `$$($1_$2_$3_MKSTUBOBJS)`; $$(FIND) $$(patsubst %.$$($3_osuf),%_$$($3_osuf)_split,$$($1_$2_$3_HS_OBJS)) -name '*.$$($3_osuf)' -print) | $$(XARGS) $$(AR) $$(EXTRA_AR_ARGS) $$@ + (echo $$($1_$2_$3_NON_HS_OBJS) `$$($1_$2_$3_MKSTUBOBJS)`; $$(FIND) $$(patsubst %.$$($3_osuf),%_$$($3_osuf)_split,$$($1_$2_$3_HS_OBJS)) -name '*.$$($3_osuf)' -print) | $$(XARGS) "$$(AR)" $(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ else $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) "$$(RM)" $$(RM_OPTS) $$@ - echo $$($1_$2_$3_ALL_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` | $$(XARGS) $$(AR) $$(EXTRA_AR_ARGS) $$@ + echo $$($1_$2_$3_ALL_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` | $$(XARGS) "$$(AR)" $(AR_OPTS) $$(EXTRA_AR_ARGS) $$@ endif endif diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk index 11d64c0ef7..e346dffda3 100644 --- a/rules/distdir-way-opts.mk +++ b/rules/distdir-way-opts.mk @@ -75,6 +75,10 @@ else $1_$2_DEP_INCLUDE_DIRS_FLAG = -I endif +# We have to do this mangling using the shell, because words may contain +# spaces and GNU make doesn't have any quoting interpretation. +$1_$2_CC_INC_FLAGS:=$$(shell for i in $$($1_$2_DEP_INCLUDE_DIRS); do echo $$($1_$2_DEP_INCLUDE_DIRS_FLAG)\"$$$$i\"; done) + $1_$2_DIST_CC_OPTS = \ $$(CONF_CC_OPTS) \ $$(SRC_CC_OPTS) \ @@ -83,21 +87,26 @@ $1_$2_DIST_CC_OPTS = \ $$(foreach dir,$$(filter /%,$$($1_$2_INCLUDE_DIRS)),-I$$(dir)) \ $$($1_$2_CC_OPTS) \ $$($1_$2_CPP_OPTS) \ - $$(foreach dir,$$($1_$2_DEP_INCLUDE_DIRS),$$($1_$2_DEP_INCLUDE_DIRS_FLAG)$$(dir)) \ + $$($1_$2_CC_INC_FLAGS) \ $$($1_$2_DEP_CC_OPTS) +$1_$2_DIST_LD_LIB_DIRS:=$$(shell for i in $$($1_$2_DEP_LIB_DIRS); do echo \"-L$$$$i\"; done) + $1_$2_DIST_LD_OPTS = \ $$(CONF_LD_OPTS) \ $$(SRC_LD_OPTS) \ $$($1_LD_OPTS) \ $$($1_$2_LD_OPTS) \ - $$(foreach opt,$$($1_$2_DEP_LIB_DIRS),-L$$(opt)) \ + $$($1_$2_DIST_LD_LIB_DIRS) \ $$(foreach opt,$$($1_$2_DEP_EXTRA_LIBS),-l$$(opt)) \ $$($1_$2_DEP_LD_OPTS) # c.f. Cabal's Distribution.Simple.PreProcess.ppHsc2hs # We use '' around cflags and lflags to handle paths with backslashes in # on Windows +$1_$2_$3_HSC2HS_CC_OPTS:=$$(shell for i in $$($1_$2_DIST_CC_OPTS); do echo \'--cflag=$$$$i\'; done) +$1_$2_$3_HSC2HS_LD_OPTS:=$$(shell for i in $$($1_$2_DIST_LD_OPTS); do echo \'--lflag=$$$$i\'; done) + $1_$2_$3_ALL_HSC2HS_OPTS = \ --cc=$$(WhatGccIsCalled) \ --ld=$$(WhatGccIsCalled) \ @@ -105,8 +114,8 @@ $1_$2_$3_ALL_HSC2HS_OPTS = \ $$(SRC_HSC2HS_OPTS) \ $$(WAY_$3_HSC2HS_OPTS) \ --cflag=-D__GLASGOW_HASKELL__=$$(ProjectVersionInt) \ - $$(foreach opt,$$($1_$2_DIST_CC_OPTS),'--cflag=$$(opt)') \ - $$(foreach opt,$$($1_$2_DIST_LD_OPTS),'--lflag=$$(opt)') \ + $$($1_$2_$3_HSC2HS_CC_OPTS) \ + $$($1_$2_$3_HSC2HS_LD_OPTS) \ $$($$(basename $$<)_HSC2HS_OPTS) \ $$(EXTRA_HSC2HS_OPTS) |