diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-05-14 21:23:58 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-05-14 21:23:58 +0100 |
commit | 192c7b74eb439221c20203c603e5b3c5a9d98cc3 (patch) | |
tree | 25f9761b4f8cd15b258f44763b037f5058ec8707 /rules/build-prog.mk | |
parent | 2c9cb4d2c29eecb7bbe120601b1b47695773ccde (diff) | |
download | haskell-192c7b74eb439221c20203c603e5b3c5a9d98cc3.tar.gz |
Define the right RTS config in the Windows dyn wrapper programs
This is particularly important as without it validate fails, as it
tries to pass RTS options to haddock, and with the default RTS config
those options aren't permitted.
Diffstat (limited to 'rules/build-prog.mk')
-rw-r--r-- | rules/build-prog.mk | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 9d1e5890be..d362d4299f 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -213,15 +213,32 @@ endif ifeq "$$($1_$2_PROG_NEEDS_C_WRAPPER)" "YES" +$1_$2_RTS_OPTS_FLAG = $$(lastword $$(filter -rtsopts -rtsopts=all -rtsopts=some -rtsopts=none -no-rtsopts,$$($1_$2_$$($1_$2_PROGRAM_WAY)_ALL_HC_OPTS))) +ifeq "$$($1_$2_RTS_OPTS_FLAG)" "-rtsopts" +$1_$2_RTS_OPTS = RtsOptsAll +else ifeq "$$($1_$2_RTS_OPTS_FLAG)" "-rtsopts=all" +$1_$2_RTS_OPTS = RtsOptsAll +else ifeq "$$($1_$2_RTS_OPTS_FLAG)" "-rtsopts=some" +$1_$2_RTS_OPTS = RtsOptsSafeOnly +else ifeq "$$($1_$2_RTS_OPTS_FLAG)" "-rtsopts=none" +$1_$2_RTS_OPTS = RtsOptsNone +else ifeq "$$($1_$2_RTS_OPTS_FLAG)" "-no-rtsopts" +$1_$2_RTS_OPTS = RtsOptsNone +else +$1_$2_RTS_OPTS = RtsOptsSafeOnly +endif + $1/$2/build/tmp/$$($1_$2_PROG)-inplace-wrapper.c: driver/utils/dynwrapper.c | $$$$(dir $$$$@)/. $$(call removeFiles,$$@) echo '#include <Windows.h>' >> $$@ + echo '#include "Rts.h"' >> $$@ echo 'LPTSTR path_dirs[] = {' >> $$@ $$(foreach d,$$($1_$2_DEP_LIB_REL_DIRS),$$(call make-command,echo ' TEXT("$$d")$$(comma)' >> $$@)) echo ' TEXT("$1/$2/build/tmp/"),' >> $$@ echo ' NULL};' >> $$@ echo 'LPTSTR progDll = TEXT("../../$1/$2/build/tmp/$$($1_$2_PROG).dll");' >> $$@ echo 'LPTSTR rtsDll = TEXT("$$($$(WINDOWS_DYN_PROG_RTS))");' >> $$@ + echo 'int rtsOpts = $$($1_$2_RTS_OPTS);' >> $$@ cat driver/utils/dynwrapper.c >> $$@ $1/$2/build/tmp/$$($1_$2_PROG) : $1/$2/build/tmp/$$($1_$2_PROG)-inplace-wrapper.c $1/$2/build/tmp/$$($1_$2_PROG).dll | $$$$(dir $$$$@)/. |