Commit 4a5569ff authored by Ian Lynagh's avatar Ian Lynagh

Fix permissions when installing

parent 6f476448
......@@ -17,8 +17,9 @@ install: install_driver_ghci
.PHONY: install_driver_ghci
install_driver_ghci: WRAPPER=$(DESTDIR)$(bindir)/ghci-$(ProjectVersion)
install_driver_ghci:
"$(MKDIRHIER)" $(DESTDIR)$(bindir)
$(INSTALL_DIR) $(DESTDIR)$(bindir)
"$(RM)" $(RM_OPTS) $(WRAPPER)
$(CREATE_SCRIPT) $(WRAPPER)
echo '#!$(SHELL)' >> $(WRAPPER)
echo 'exec $(bindir)/ghc-$(ProjectVersion) --interactive $${1+"$$@"}' >> $(WRAPPER)
$(EXECUTABLE_FILE) $(WRAPPER)
......
......@@ -713,13 +713,13 @@ install_libs: $(INSTALL_LIBS)
done
install_libexec_scripts: $(INSTALL_LIBEXEC_SCRIPTS)
"$(MKDIRHIER)" $(DESTDIR)$(libexecdir)
$(INSTALL_DIR) $(DESTDIR)$(libexecdir)
for i in $(INSTALL_LIBEXEC_SCRIPTS); do \
$(INSTALL_SCRIPT) $(INSTALL_OPTS) $$i $(DESTDIR)$(libexecdir); \
done
install_libexecs: $(INSTALL_LIBEXECS)
"$(MKDIRHIER)" $(DESTDIR)$(libexecdir)
$(INSTALL_DIR) $(DESTDIR)$(libexecdir)
for i in $(INSTALL_LIBEXECS); do \
$(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i $(DESTDIR)$(libexecdir); \
done
......@@ -756,8 +756,10 @@ endif
install_packages: install_libexecs
install_packages: libffi/package.conf.install rts/package.conf.install
"$(MKDIRHIER)" $(DESTDIR)$(libdir)
echo "[]" > $(INSTALLED_PACKAGE_CONF)
$(INSTALL_DIR) $(DESTDIR)$(libdir)
"$(RM)" $(RM_OPTS) $(INSTALLED_PACKAGE_CONF)
$(CREATE_DATA) $(INSTALLED_PACKAGE_CONF)
echo "[]" >> $(INSTALLED_PACKAGE_CONF)
"$(INSTALLED_GHC_PKG_REAL)" --force --global-conf $(INSTALLED_PACKAGE_CONF) update libffi/package.conf.install
"$(INSTALLED_GHC_PKG_REAL)" --force --global-conf $(INSTALLED_PACKAGE_CONF) update rts/package.conf.install
$(foreach p, $(PACKAGES) $(PACKAGES_STAGE2),\
......
......@@ -494,6 +494,8 @@ INSTALL_GROUP =
# Invocations of `install' for the four different classes
# of targets:
#
CREATE_SCRIPT = create () { touch $$1 && chmod 755 $$1 ; } && create
CREATE_DATA = create () { touch $$1 && chmod 644 $$1 ; } && create
INSTALL_PROGRAM = $(INSTALL) -m 755
INSTALL_SCRIPT = $(INSTALL) -m 755
INSTALL_SHLIB = $(INSTALL) -m 755
......@@ -501,7 +503,7 @@ INSTALL_DATA = $(INSTALL) -m 644
INSTALL_HEADER = $(INSTALL) -m 644
INSTALL_MAN = $(INSTALL) -m 644
INSTALL_DOC = $(INSTALL) -m 644
INSTALL_DIR = $(MKDIRHIER)
INSTALL_DIR = $(INSTALL) -m 755 -d
#
# runhaskell and hsc2hs are special, in that other compilers besides
......
......@@ -368,8 +368,8 @@ install : install_rts
.PHONY: install_rts
install_rts:
"$(MKDIRHIER)" $(DESTDIR)$(libdir)
"$(MKDIRHIER)" $(DESTDIR)$(libdir)/include
$(INSTALL_DIR) $(DESTDIR)$(libdir)
$(INSTALL_DIR) $(DESTDIR)$(libdir)/include
"$(CP)" $(ALL_RTS_LIBS) $(DESTDIR)$(libdir)
# -----------------------------------------------------------------------------
......
......@@ -57,8 +57,9 @@ install: install_$1_$2_wrapper
.PHONY: install_$1_$2_wrapper
install_$1_$2_wrapper: WRAPPER=$$(DESTDIR)$$(bindir)/$$($1_$2_INSTALL_SHELL_WRAPPER_NAME)
install_$1_$2_wrapper:
"$$(MKDIRHIER)" $$(DESTDIR)$$(bindir)
$$(INSTALL_DIR) $$(DESTDIR)$$(bindir)
"$$(RM)" $$(RM_OPTS) $$(WRAPPER)
$$(CREATE_SCRIPT) $$(WRAPPER)
echo '#!$$(SHELL)' >> $$(WRAPPER)
echo 'executablename=$$(libexecdir)/$$($1_$2_PROG)' >> $$(WRAPPER)
echo 'datadir=$$(datadir)' >> $$(WRAPPER)
......
......@@ -95,7 +95,7 @@ install: install_utils/ghc-pkg_link
.PNONY: install_utils/ghc-pkg_link
install_utils/ghc-pkg_link:
"$(MKDIRHIER)" $(DESTDIR)$(bindir)
$(INSTALL_DIR) $(DESTDIR)$(bindir)
"$(RM)" $(RM_OPTS) $(DESTDIR)$(bindir)/ghc-pkg
$(LN_S) ghc-pkg-$(ProjectVersion) $(DESTDIR)$(bindir)/ghc-pkg
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