From 484511cebe6055c13bedf6b9c773f96ae9d63dc3 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 24 Mar 2010 17:14:22 +0000 Subject: [PATCH] Change how perl scripts get installed; partially fixes #3863 We now regenerate them when installing, which means the path for perl doesn't get baked in --- driver/mangler/ghc.mk | 2 +- driver/split/ghc.mk | 2 +- ghc.mk | 10 ++-------- rules/build-perl.mk | 12 +++++++++++- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/driver/mangler/ghc.mk b/driver/mangler/ghc.mk index 92b00c4..c5e3bdf 100644 --- a/driver/mangler/ghc.mk +++ b/driver/mangler/ghc.mk @@ -13,7 +13,7 @@ driver/mangler_PERL_SRC = ghc-asm.lprl driver/mangler_dist_PROG = $(GHC_MANGLER_PGM) driver/mangler_dist_TOPDIR = YES +driver/mangler_dist_INSTALL_IN = $(DESTDIR)$(topdir) $(eval $(call build-perl,driver/mangler,dist)) -INSTALL_TOPDIR_SCRIPTS += driver/mangler/dist/$(GHC_MANGLER_PGM) diff --git a/driver/split/ghc.mk b/driver/split/ghc.mk index 388e212..0272652 100644 --- a/driver/split/ghc.mk +++ b/driver/split/ghc.mk @@ -13,7 +13,7 @@ driver/split_PERL_SRC = ghc-split.lprl driver/split_dist_PROG = $(GHC_SPLIT_PGM) driver/split_dist_TOPDIR = YES +driver/split_dist_INSTALL_IN = $(DESTDIR)$(topdir) $(eval $(call build-perl,driver/split,dist)) -INSTALL_TOPDIR_SCRIPTS += driver/split/dist/$(GHC_SPLIT_PGM) diff --git a/ghc.mk b/ghc.mk index cc5e527..69bb286 100644 --- a/ghc.mk +++ b/ghc.mk @@ -760,7 +760,7 @@ TAGS: TAGS_compiler install: install_packages install_libs install_libexecs install_headers \ install_libexec_scripts install_bins install_docs \ - install_topdirs install_topdir_scripts + install_topdirs install_bins: $(INSTALL_BINS) $(INSTALL_DIR) "$(DESTDIR)$(bindir)" @@ -809,12 +809,6 @@ else "$(MV)" "$(DESTDIR)$(ghclibexecdir)/ghc-stage2" "$(DESTDIR)$(ghclibexecdir)/ghc" endif -install_topdir_scripts: $(INSTALL_TOPDIR_SCRIPTS) - $(INSTALL_DIR) "$(DESTDIR)$(topdir)" - for i in $(INSTALL_TOPDIR_SCRIPTS); do \ - $(INSTALL_SCRIPT) $(INSTALL_OPTS) $$i "$(DESTDIR)$(topdir)"; \ - done - install_topdirs: $(INSTALL_TOPDIRS) $(INSTALL_DIR) "$(DESTDIR)$(topdir)" for i in $(INSTALL_TOPDIRS); do \ @@ -920,6 +914,7 @@ $(eval $(call bindist,.,\ $(INPLACE_BIN)/ghc-cabal \ utils/ghc-pwd/ghc-pwd \ $(BINDIST_WRAPPERS) \ + $(BINDIST_PERL_SOURCES) \ $(BINDIST_LIBS) \ $(BINDIST_HI) \ $(BINDIST_EXTRAS) \ @@ -932,7 +927,6 @@ $(eval $(call bindist,.,\ $(INSTALL_LIBEXECS) \ $(INSTALL_LIBEXEC_SCRIPTS) \ $(INSTALL_TOPDIRS) \ - $(INSTALL_TOPDIR_SCRIPTS) \ $(INSTALL_BINS) \ $(INSTALL_MANPAGES) \ $(INSTALL_DOCS) \ diff --git a/rules/build-perl.mk b/rules/build-perl.mk index f3ea2b6..cfa71cc 100644 --- a/rules/build-perl.mk +++ b/rules/build-perl.mk @@ -39,17 +39,27 @@ ifeq "$(findstring clean,$(MAKECMDGOALS))" "" ifneq "$$(BINDIST)" "YES" $1/$2/$$($1_$2_PROG).prl: $1/$$($1_PERL_SRC) $$(UNLIT) | $$$$(dir $$$$@)/. "$$(UNLIT)" $$(UNLIT_OPTS) $$< $$@ +endif $1/$2/$$($1_$2_PROG): $1/$2/$$($1_$2_PROG).prl "$$(RM)" $$(RM_OPTS) $$@ echo '#!$$(PERL)' >> $$@ echo '$$$$TARGETPLATFORM = "$$(TARGETPLATFORM)";' >> $$@ cat $$< >> $$@ - $$(EXECUTABLE_FILE) $$@ $$($1_$2_INPLACE): $1/$2/$$($1_$2_PROG) | $$$$(dir $$$$@)/. "$$(CP)" $$< $$@ $$(EXECUTABLE_FILE) $$@ + +ifneq "$$($1_$2_INSTALL_IN)" "" +BINDIST_PERL_SOURCES += $1/$2/$$($1_$2_PROG).prl + +install: install_$1_$2 + +.PHONY: install_$1_$2 +install_$1_$2: $1/$2/$$($1_$2_PROG) + $$(INSTALL_DIR) "$$($1_$2_INSTALL_IN)" + $$(INSTALL_SCRIPT) $$(INSTALL_OPTS) $$< "$$($1_$2_INSTALL_IN)" endif endif -- 1.7.10.4