summaryrefslogtreecommitdiff
path: root/rules
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
parentb8da5dd3c55d766f0229abb46a1e5c7819d2cd73 (diff)
downloadhaskell-68ae113299dbf2928cf0a8c4400b960620136738.tar.gz
Make it possible to build with only way dyn
Diffstat (limited to 'rules')
-rw-r--r--rules/build-package-data.mk10
-rw-r--r--rules/library-path.mk21
-rw-r--r--rules/shell-wrapper.mk45
3 files changed, 61 insertions, 15 deletions
diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk
index 6f151a5adf..dd94493934 100644
--- a/rules/build-package-data.mk
+++ b/rules/build-package-data.mk
@@ -18,12 +18,22 @@ $(call profStart, build-package-data($1,$2,$3))
# $2 = distdir
# $3 = GHC stage to use (0 == bootstrapping compiler)
+ifeq "$$(filter p,$$($1_$2_WAYS))" "v"
+$1_$2_CONFIGURE_OPTS += --enable-library-vanilla
+else
+$1_$2_CONFIGURE_OPTS += --disable-library-vanilla
+endif
+
ifeq "$$(filter p,$$($1_$2_WAYS))" "p"
$1_$2_CONFIGURE_OPTS += --enable-library-profiling
+else
+$1_$2_CONFIGURE_OPTS += --disable-library-profiling
endif
ifeq "$$(filter dyn,$$($1_$2_WAYS))" "dyn"
$1_$2_CONFIGURE_OPTS += --enable-shared
+else
+$1_$2_CONFIGURE_OPTS += --disable-shared
endif
$1_$2_CONFIGURE_OPTS += --disable-library-for-ghci
diff --git a/rules/library-path.mk b/rules/library-path.mk
new file mode 100644
index 0000000000..d6e39743e2
--- /dev/null
+++ b/rules/library-path.mk
@@ -0,0 +1,21 @@
+# -----------------------------------------------------------------------------
+#
+# (c) 2010 The University of Glasgow
+#
+# This file is part of the GHC build system.
+#
+# To understand how the build system works and how to modify it, see
+# http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
+# http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
+# $1 = paths to prepend
+ifeq "$(TargetOS_CPP)" "linux"
+prependLibraryPath = export LD_LIBRARY_PATH="$1:$$LD_LIBRARY_PATH"
+else ifeq "$(TargetOS_CPP)" "darwin"
+prependLibraryPath = export DYLD_LIBRARY_PATH="$1:$$DYLD_LIBRARY_PATH"
+else
+prependLibraryPath = $(error Do not know how to prependLibraryPath on $(TargetOS_CPP))
+endif
+
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