Commit 68ae1132 authored by ian@well-typed.com's avatar ian@well-typed.com

Make it possible to build with only way dyn

parent b8da5dd3
......@@ -1794,7 +1794,7 @@ AC_MSG_NOTICE(Building in-tree ghc-pwd)
])
AC_DEFUN([FP_BINDIST_GHC_PWD],[
GHC_PWD=utils/ghc-pwd/dist-install/build/tmp/ghc-pwd
GHC_PWD=utils/ghc-pwd/dist-install/build/tmp/ghc-pwd-bindist
])
AC_DEFUN([FP_FIND_ROOT],[
......
......@@ -143,6 +143,7 @@ endif
include rules/prof.mk
include rules/trace.mk
include rules/library-path.mk
include rules/make-command.mk
include rules/pretty_commands.mk
......@@ -480,6 +481,7 @@ utils/ghc-pkg/dist-install/package-data.mk: compiler/stage2/package-data.mk
utils/hsc2hs/dist-install/package-data.mk: compiler/stage2/package-data.mk
utils/compare_sizes/dist-install/package-data.mk: compiler/stage2/package-data.mk
utils/runghc/dist-install/package-data.mk: compiler/stage2/package-data.mk
utils/mkUserGuidePart/dist/package-data.mk: compiler/stage2/package-data.mk
# add the final package.conf dependency: ghc-prim depends on RTS
libraries/ghc-prim/dist-install/package-data.mk : rts/package.conf.inplace
......@@ -1027,7 +1029,7 @@ unix-binary-dist-prep:
echo "BUILD_DOCBOOK_PS = $(BUILD_DOCBOOK_PS)" >> $(BIN_DIST_MK)
echo "BUILD_DOCBOOK_PDF = $(BUILD_DOCBOOK_PDF)" >> $(BIN_DIST_MK)
echo "BUILD_MAN = $(BUILD_MAN)" >> $(BIN_DIST_MK)
echo "GHC_CABAL_INPLACE = utils/ghc-cabal/dist-install/build/tmp/ghc-cabal" >> $(BIN_DIST_MK)
echo "GHC_CABAL_INPLACE = utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist" >> $(BIN_DIST_MK)
cd $(BIN_DIST_PREP_DIR) && autoreconf
$(call removeFiles,$(BIN_DIST_PREP_TAR))
# h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source
......
......@@ -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
......
# -----------------------------------------------------------------------------
#
# (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
......@@ -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
......@@ -366,10 +366,22 @@ generate config_args distdir directory
-- the RTS's library-dirs here.
_ -> error "No (or multiple) ghc rts package is registered!!"
dep_ids = map snd (externalPackageDeps lbi)
dep_ids = map snd (externalPackageDeps lbi)
deps = map display dep_ids
depNames = map (display . packageName) dep_ids
let libraryDirs = forDeps Installed.libraryDirs
transitive_dep_ids = map Installed.sourcePackageId dep_pkgs
transitiveDeps = map display transitive_dep_ids
transitiveDepNames = map (display . packageName) transitive_dep_ids
libraryDirs = forDeps Installed.libraryDirs
-- The mkLibraryRelDir function is a bit of a hack.
-- Ideally it should be handled in the makefiles instead.
mkLibraryRelDir "rts" = "rts/dist/build"
mkLibraryRelDir "ghc" = "compiler/stage2/build"
mkLibraryRelDir "Cabal" = "libraries/Cabal/Cabal/dist-install/build"
mkLibraryRelDir l = "libraries/" ++ l ++ "/dist-install/build"
libraryRelDirs = map mkLibraryRelDir transitiveDepNames
wrappedIncludeDirs <- wrap $ forDeps Installed.includeDirs
wrappedLibraryDirs <- wrap libraryDirs
......@@ -379,10 +391,10 @@ generate config_args distdir directory
variablePrefix ++ "_HIDDEN_MODULES = " ++ unwords (map display (otherModules bi)),
variablePrefix ++ "_SYNOPSIS =" ++ synopsis pd,
variablePrefix ++ "_HS_SRC_DIRS = " ++ unwords (hsSourceDirs bi),
variablePrefix ++ "_DEPS = " ++ unwords (map display dep_ids),
variablePrefix ++ "_DEP_NAMES = " ++ unwords (map (display . packageName) dep_ids),
variablePrefix ++ "_TRANSITIVE_DEPS = " ++ unwords (map display transitive_dep_ids),
variablePrefix ++ "_TRANSITIVE_DEP_NAMES = " ++ unwords (map (display . packageName) transitive_dep_ids),
variablePrefix ++ "_DEPS = " ++ unwords deps,
variablePrefix ++ "_DEP_NAMES = " ++ unwords depNames,
variablePrefix ++ "_TRANSITIVE_DEPS = " ++ unwords transitiveDeps,
variablePrefix ++ "_TRANSITIVE_DEP_NAMES = " ++ unwords transitiveDepNames,
variablePrefix ++ "_INCLUDE_DIRS = " ++ unwords (includeDirs bi),
variablePrefix ++ "_INCLUDES = " ++ unwords (includes bi),
variablePrefix ++ "_INSTALL_INCLUDES = " ++ unwords (installIncludes bi),
......@@ -406,6 +418,7 @@ generate config_args distdir directory
variablePrefix ++ "_DEP_CC_OPTS = " ++ unwords (forDeps Installed.ccOptions),
variablePrefix ++ "_DEP_LIB_DIRS_SINGLE_QUOTED = " ++ unwords wrappedLibraryDirs,
variablePrefix ++ "_DEP_LIB_DIRS_SEARCHPATH = " ++ mkSearchPath libraryDirs,
variablePrefix ++ "_DEP_LIB_REL_DIRS_SEARCHPATH = " ++ mkSearchPath libraryRelDirs,
variablePrefix ++ "_DEP_EXTRA_LIBS = " ++ unwords (forDeps Installed.extraLibraries),
variablePrefix ++ "_DEP_LD_OPTS = " ++ unwords (forDeps Installed.ldOptions),
variablePrefix ++ "_BUILD_GHCI_LIB = " ++ boolToYesNo (withGHCiLib lbi),
......
......@@ -54,8 +54,8 @@ $(GHC_CABAL_DIR)_USES_CABAL = YES
$(GHC_CABAL_DIR)_PACKAGE = ghc-cabal
$(GHC_CABAL_DIR)_dist-install_PROG = ghc-cabal$(exeext)
$(GHC_CABAL_DIR)_dist-install_INSTALL_INPLACE = NO
$(GHC_CABAL_DIR)_dist-install_WANT_BINDIST_WRAPPER = YES
$(GHC_CABAL_DIR)_dist-install_MODULES = Main
$(GHC_CABAL_DIR)_dist-install_MORE_HC_OPTS = -static
$(eval $(call build-prog,utils/ghc-cabal,dist-install,1))
......@@ -2,8 +2,8 @@
utils/ghc-pwd_USES_CABAL = YES
utils/ghc-pwd_PACKAGE = ghc-pwd
utils/ghc-pwd_dist-install_INSTALL_INPLACE = YES
utils/ghc-pwd_dist-install_WANT_BINDIST_WRAPPER = YES
utils/ghc-pwd_dist-install_PROG = ghc-pwd$(exeext)
utils/ghc-pwd_dist-install_MORE_HC_OPTS += -static
$(eval $(call build-prog,utils/ghc-pwd,dist-install,1))
......@@ -14,6 +14,5 @@ utils/mkUserGuidePart_USES_CABAL = YES
utils/mkUserGuidePart_PACKAGE = mkUserGuidePart
utils/mkUserGuidePart_dist_PROG = mkUserGuidePart$(exeext)
utils/mkUserGuidePart_dist_INSTALL_INPLACE = YES
utils/mkUserGuidePart_dist_PROGRAM_WAY = v
$(eval $(call build-prog,utils/mkUserGuidePart,dist,1))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment