Change how perl scripts get installed; partially fixes #3863
authorIan Lynagh <igloo@earth.li>
Wed, 24 Mar 2010 17:14:22 +0000 (17:14 +0000)
committerIan Lynagh <igloo@earth.li>
Wed, 24 Mar 2010 17:14:22 +0000 (17:14 +0000)
We now regenerate them when installing, which means the path for perl
doesn't get baked in

driver/mangler/ghc.mk
driver/split/ghc.mk
ghc.mk
rules/build-perl.mk

index 92b00c4..c5e3bdf 100644 (file)
@@ -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)
index 388e212..0272652 100644 (file)
@@ -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 (file)
--- 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) \
index f3ea2b6..cfa71cc 100644 (file)
@@ -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