Commit 6e6da3a0 authored by ian@well-typed.com's avatar ian@well-typed.com

Tweak the build system handling of shell wrappers

Rather than having a separate
    foo_INSTALL_SHELL_WRAPPER
variable, we just use
    foo_INSTALL && foo_SHELL_WRAPPER
parent 7724ecb7
......@@ -78,7 +78,7 @@ ghc_stage1_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage2_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage3_SHELL_WRAPPER_NAME = ghc/ghc.wrapper
ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER = YES
ghc_stage$(INSTALL_GHC_STAGE)_INSTALL = YES
ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER_NAME = ghc-$(ProjectVersion)
# We override the program name to be ghc, rather than ghc-stage2.
......
......@@ -184,10 +184,12 @@ endif
$(call clean-target,$1,$2_inplace,$$($1_$2_INPLACE))
ifeq "$$($1_$2_INSTALL)" "YES"
ifeq "$$($1_$2_TOPDIR)" "YES"
INSTALL_TOPDIRS += $1/$2/build/tmp/$$($1_$2_PROG)
ifeq "$$($1_$2_SHELL_WRAPPER) $$(Windows)" "YES NO"
INSTALL_LIBEXECS += $1/$2/build/tmp/$$($1_$2_PROG)
else ifeq "$$($1_$2_TOPDIR)" "YES"
INSTALL_TOPDIRS += $1/$2/build/tmp/$$($1_$2_PROG)
else
INSTALL_BINS += $1/$2/build/tmp/$$($1_$2_PROG)
INSTALL_BINS += $1/$2/build/tmp/$$($1_$2_PROG)
endif
endif
......
......@@ -16,16 +16,7 @@ $(call profStart, shell-wrapper($1,$2))
# $1 = dir
# $2 = distdir
ifeq "$$($1_$2_SHELL_WRAPPER)" "YES"
ifeq "$$(Windows)" "YES"
ifeq "$$($1_$2_INSTALL_SHELL_WRAPPER)" "YES"
# Just install the binary on Windows
$1_$2_INSTALL = YES
endif
else
ifeq "$$($1_$2_SHELL_WRAPPER) $$(Windows)" "YES NO"
ifeq "$$($1_$2_SHELL_WRAPPER_NAME)" ""
$1_$2_SHELL_WRAPPER_NAME = $1/$$($1_$2_PROG).wrapper
......@@ -49,7 +40,7 @@ $$(INPLACE_BIN)/$$($1_$2_PROG): $$($1_$2_INPLACE) $$($1_$2_SHELL_WRAPPER_NAME)
$$(EXECUTABLE_FILE) $$@
endif
ifeq "$$($1_$2_INSTALL_SHELL_WRAPPER)" "YES"
ifeq "$$($1_$2_INSTALL)" "YES"
ifeq "$$($1_$2_INSTALL_SHELL_WRAPPER_NAME)" ""
$1_$2_INSTALL_SHELL_WRAPPER_NAME = $$($1_$2_PROG)
......@@ -79,11 +70,9 @@ install_$1_$2_wrapper:
cat $$($1_$2_SHELL_WRAPPER_NAME) >> "$$(WRAPPER)"
$$(EXECUTABLE_FILE) "$$(WRAPPER)"
endif # $1_$2_INSTALL_SHELL_WRAPPER
endif
endif # $1_$2_INSTALL
endif # $1_$2_SHELL_WRAPPER
endif # $1_$2_SHELL_WRAPPER && !Windows
$(call profEnd, shell-wrapper($1,$2))
endef
......@@ -96,7 +96,7 @@ utils/ghc-pkg_PACKAGE = ghc-pkg
utils/ghc-pkg_$(GHC_PKG_DISTDIR)_PROG = ghc-pkg
utils/ghc-pkg_$(GHC_PKG_DISTDIR)_SHELL_WRAPPER = YES
utils/ghc-pkg_$(GHC_PKG_DISTDIR)_INSTALL_SHELL_WRAPPER = YES
utils/ghc-pkg_$(GHC_PKG_DISTDIR)_INSTALL = YES
utils/ghc-pkg_$(GHC_PKG_DISTDIR)_INSTALL_SHELL_WRAPPER_NAME = ghc-pkg-$(ProjectVersion)
utils/ghc-pkg_$(GHC_PKG_DISTDIR)_INSTALL_INPLACE = NO
......
......@@ -14,7 +14,7 @@ utils/runghc_PACKAGE = runghc
utils/runghc_dist-install_USES_CABAL = YES
utils/runghc_dist-install_PROG = runghc$(exeext)
utils/runghc_dist-install_SHELL_WRAPPER = YES
utils/runghc_dist-install_INSTALL_SHELL_WRAPPER = YES
utils/runghc_dist-install_INSTALL = YES
utils/runghc_dist-install_INSTALL_SHELL_WRAPPER_NAME = runghc-$(ProjectVersion)
utils/runghc_dist-install_EXTRA_HC_OPTS = -cpp -DVERSION="\"$(ProjectVersion)\""
......
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