Commit 484511ce authored by Ian Lynagh's avatar Ian Lynagh

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
parent 4a0b6d6c
......@@ -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)
......@@ -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)
......@@ -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) \
......
......@@ -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
......
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