Put libexec binaries in lib/bin/ rather than just lib/
authorIan Lynagh <ian@well-typed.com>
Thu, 27 Sep 2012 13:35:05 +0000 (14:35 +0100)
committerIan Lynagh <ian@well-typed.com>
Mon, 1 Oct 2012 20:36:53 +0000 (21:36 +0100)
Some binaries are installed in lib/, so if we wanted them to have a
shell wrapper then under the old scheme both the binary and the wrapper
would be installed under lib/. Now the binary is put under lib/bin/,
leaving lib/ for the wrapper.

ghc.mk
rules/build-prog.mk
rules/shell-wrapper.mk

diff --git a/ghc.mk b/ghc.mk
index 2118202..5df8e55 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -796,7 +796,7 @@ TAGS: TAGS_compiler
 # Installation
 
 install: install_libs install_packages install_libexecs \
-         install_libexec_scripts install_bins install_topdirs
+         install_bins install_topdirs
 ifeq "$(HADDOCK_DOCS)" "YES"
 install: install_docs
 endif
@@ -826,27 +826,17 @@ install_libs: $(INSTALL_LIBS)
                esac; \
        done
 
-install_libexec_scripts: $(INSTALL_LIBEXEC_SCRIPTS)
-ifeq "$(INSTALL_LIBEXEC_SCRIPTS)" ""
-       @:
-else
-       $(call INSTALL_DIR,"$(DESTDIR)$(ghclibexecdir)")
-       for i in $(INSTALL_LIBEXEC_SCRIPTS); do \
-               $(call INSTALL_SCRIPT,$(INSTALL_OPTS),$$i,"$(DESTDIR)$(ghclibexecdir)"); \
-       done
-endif
-
 install_libexecs:  $(INSTALL_LIBEXECS)
 ifeq "$(INSTALL_LIBEXECS)" ""
        @:
 else
-       $(call INSTALL_DIR,"$(DESTDIR)$(ghclibexecdir)")
+       $(call INSTALL_DIR,"$(DESTDIR)$(ghclibexecdir)/bin")
        for i in $(INSTALL_LIBEXECS); do \
-               $(call INSTALL_PROGRAM,$(INSTALL_BIN_OPTS),$$i,"$(DESTDIR)$(ghclibexecdir)"); \
+               $(call INSTALL_PROGRAM,$(INSTALL_BIN_OPTS),$$i,"$(DESTDIR)$(ghclibexecdir)/bin"); \
        done
 # We rename ghc-stage2, so that the right program name is used in error
 # messages etc.
-       "$(MV)" "$(DESTDIR)$(ghclibexecdir)/ghc-stage$(INSTALL_GHC_STAGE)" "$(DESTDIR)$(ghclibexecdir)/ghc"
+       "$(MV)" "$(DESTDIR)$(ghclibexecdir)/bin/ghc-stage$(INSTALL_GHC_STAGE)" "$(DESTDIR)$(ghclibexecdir)/bin/ghc"
 endif
 
 install_topdirs: $(INSTALL_TOPDIRS)
@@ -884,8 +874,8 @@ INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
 # Install packages in the right order, so that ghc-pkg doesn't complain.
 # Also, install ghc-pkg first.
 ifeq "$(Windows)" "NO"
-INSTALLED_GHC_REAL=$(DESTDIR)$(ghclibexecdir)/ghc
-INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(ghclibexecdir)/ghc-pkg
+INSTALLED_GHC_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc
+INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc-pkg
 else
 INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
 INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe
index 2a76943..5e8b4ba 100644 (file)
@@ -67,7 +67,7 @@ endif
 else
 # Where do we install the inplace version?
 ifeq "$$($1_$2_SHELL_WRAPPER) $$(Windows)" "YES NO"
-$1_$2_INPLACE = $$(INPLACE_LIB)/$$($1_$2_PROG)
+$1_$2_INPLACE = $$(INPLACE_LIB)/bin/$$($1_$2_PROG)
 else
 ifeq "$$($1_$2_TOPDIR)" "YES"
 $1_$2_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG)
index 1fab27f..6601e3c 100644 (file)
@@ -59,7 +59,7 @@ install_$1_$2_wrapper:
        $$(call removeFiles,                                        "$$(WRAPPER)")
        $$(CREATE_SCRIPT)                                           "$$(WRAPPER)"
        echo '#!$$(SHELL)'                                       >> "$$(WRAPPER)"
-       echo 'exedir="$$(ghclibexecdir)"'                        >> "$$(WRAPPER)"
+       echo 'exedir="$$(ghclibexecdir)/bin"'                    >> "$$(WRAPPER)"
        echo 'exeprog="$$($1_$2_PROG)"'                          >> "$$(WRAPPER)"
        echo 'executablename="$$$$exedir/$$$$exeprog"'           >> "$$(WRAPPER)"
        echo 'datadir="$$(datadir)"'                             >> "$$(WRAPPER)"