summaryrefslogtreecommitdiff
path: root/rules/shell-wrapper.mk
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-10-24 17:49:42 +0100
committerIan Lynagh <ian@well-typed.com>2012-10-24 18:03:34 +0100
commit68ae113299dbf2928cf0a8c4400b960620136738 (patch)
treedba89f6d09b9ba5ce19ebd287d9e5701e7fd6d26 /rules/shell-wrapper.mk
parentb8da5dd3c55d766f0229abb46a1e5c7819d2cd73 (diff)
downloadhaskell-68ae113299dbf2928cf0a8c4400b960620136738.tar.gz
Make it possible to build with only way dyn
Diffstat (limited to 'rules/shell-wrapper.mk')
-rw-r--r--rules/shell-wrapper.mk45
1 files changed, 30 insertions, 15 deletions
diff --git a/rules/shell-wrapper.mk b/rules/shell-wrapper.mk
index 86af3ac8d5..450c989e87 100644
--- a/rules/shell-wrapper.mk
+++ b/rules/shell-wrapper.mk
@@ -35,28 +35,24 @@ ifeq "$$($1_$2_SHELL_WRAPPER)" "YES"
$$(INPLACE_WRAPPER): $$($1_$2_SHELL_WRAPPER_NAME)
endif
$$(INPLACE_WRAPPER): $$($1_$2_INPLACE)
- $$(call removeFiles, $$@)
- echo '#!$$(SHELL)' >> $$@
- echo 'executablename="$$(TOP)/$$<"' >> $$@
- echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"' >> $$@
- echo 'bindir="$$(TOP)/$$(INPLACE_BIN)"' >> $$@
- echo 'topdir="$$(TOP)/$$(INPLACE_TOPDIR)"' >> $$@
- echo 'pgmgcc="$$(WhatGccIsCalled)"' >> $$@
+ $$(call removeFiles, $$@)
+ echo '#!$$(SHELL)' >> $$@
+ echo 'executablename="$$(TOP)/$$<"' >> $$@
+ echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"' >> $$@
+ echo 'bindir="$$(TOP)/$$(INPLACE_BIN)"' >> $$@
+ echo 'topdir="$$(TOP)/$$(INPLACE_TOPDIR)"' >> $$@
+ echo 'pgmgcc="$$(WhatGccIsCalled)"' >> $$@
$$($1_$2_SHELL_WRAPPER_EXTRA)
$$($1_$2_INPLACE_SHELL_WRAPPER_EXTRA)
ifeq "$$(DYNAMIC_BY_DEFAULT)" "YES"
-ifeq "$$(TargetOS_CPP)" "linux"
- echo 'export LD_LIBRARY_PATH="$$($1_$2_DEP_LIB_DIRS_SEARCHPATH):$$$$LD_LIBRARY_PATH"' >> $$@
-else ifeq "$$(TargetOS_CPP)" "darwin"
- echo 'export DYLD_LIBRARY_PATH="$$($1_$2_DEP_LIB_DIRS_SEARCHPATH):$$$$DYLD_LIBRARY_PATH"' >> $$@
-endif
+ echo '$$(call prependLibraryPath,$$($1_$2_DEP_LIB_DIRS_SEARCHPATH))' >> $$@
endif
ifeq "$$($1_$2_SHELL_WRAPPER)" "YES"
- cat $$($1_$2_SHELL_WRAPPER_NAME) >> $$@
+ cat $$($1_$2_SHELL_WRAPPER_NAME) >> $$@
else
- echo 'exec "$$$$executablename" $$$${1+"$$$$@"}' >> $$@
+ echo 'exec "$$$$executablename" $$$${1+"$$$$@"}' >> $$@
endif
- $$(EXECUTABLE_FILE) $$@
+ $$(EXECUTABLE_FILE) $$@
endif
@@ -92,5 +88,24 @@ install_$1_$2_wrapper:
endif
+ifeq "$$($1_$2_WANT_BINDIST_WRAPPER)" "YES"
+
+$1_$2_BINDIST_WRAPPER = $1/$2/build/tmp/$$($1_$2_PROG)-bindist
+
+all_$1_$2 : $$($1_$2_BINDIST_WRAPPER)
+
+BINDIST_EXTRAS += $$($1_$2_BINDIST_WRAPPER)
+
+$$($1_$2_BINDIST_WRAPPER): $1/$2/build/tmp/$$($1_$2_PROG)
+ $$(call removeFiles, $$@)
+ echo '#!$$(SHELL)' >> $$@
+ifeq "$$(DYNAMIC_BY_DEFAULT)" "YES"
+ echo '$$(call prependLibraryPath,$$($1_$2_DEP_LIB_REL_DIRS_SEARCHPATH))' >> $$@
+endif
+ echo 'exec "$$<" $$$${1+"$$$$@"}' >> $$@
+ $$(EXECUTABLE_FILE) $$@
+
+endif
+
$(call profEnd, shell-wrapper($1,$2))
endef