From 898cb090c8812704448ec4cb1c10d50df4b7d664 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 25 Sep 2012 19:50:09 +0100 Subject: Build the dynamic way by default on Linux/amd64 This required various build system changes to get the build to go through. In the inplace shell wrappers, we set LD_LIBRARY_PATH to allow programs to find their libraries. In the future, we might change the inplace tree to be the same shape as an installed tree instead. However, this would mean changing the way we do installation, as currently we use cabal's installation methods to install the libraries, but that only works if the libraries are under libraries/foo/dist-install/build/..., rather than in inplace/lib/... --- includes/ghc.mk | 5 +++++ includes/mkDerivedConstants.c | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'includes') diff --git a/includes/ghc.mk b/includes/ghc.mk index 065dd0a60b..dd38a6d6c0 100644 --- a/includes/ghc.mk +++ b/includes/ghc.mk @@ -44,6 +44,10 @@ ifneq "$(GhcWithSMP)" "YES" includes_CC_OPTS += -DNOSMP endif +ifeq "$(DYNAMIC_BY_DEFAULT)" "YES" +includes_CC_OPTS += -DDYNAMIC_BY_DEFAULT +endif + ifneq "$(BINDIST)" "YES" ifeq "$(PORTING_HOST)" "YES" @@ -148,6 +152,7 @@ else includes_dist-derivedconstants_C_SRCS = mkDerivedConstants.c includes_dist-derivedconstants_PROG = mkDerivedConstants$(exeext) +includes_dist-derivedconstants_INSTALL_INPLACE = YES $(eval $(call build-prog,includes,dist-derivedconstants,0)) diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c index 199e2edeb6..a58c500928 100644 --- a/includes/mkDerivedConstants.c +++ b/includes/mkDerivedConstants.c @@ -776,6 +776,14 @@ main(int argc, char *argv[]) #endif ); + constantBool("dYNAMIC_BY_DEFAULT", +#ifdef DYNAMIC_BY_DEFAULT + 1 +#else + 0 +#endif + ); + constantInt("lDV_SHIFT", LDV_SHIFT); constantInteger("iLDV_CREATE_MASK", LDV_CREATE_MASK); constantInteger("iLDV_STATE_CREATE", LDV_STATE_CREATE); -- cgit v1.2.1