From aa35c9d31be311972cc6b82250d913355f9bee9b Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 27 Mar 2001 13:38:03 +0000 Subject: [PATCH] [project @ 2001-03-27 13:38:03 by simonmar] - add ghc-pkg-$(ProjectVersion) and ghc-pkg-inplace scripts - add ghc-pkg script link - rename ghc-pkg to ghc-pkg.bin and put it in $(libdir) - remove the hacky passing of $(libdir) to the binary --- ghc/utils/ghc-pkg/Main.hs | 11 ++------- ghc/utils/ghc-pkg/Makefile | 54 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 13 deletions(-) diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index c9ef3b7..f126609 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.6 2001/03/25 19:30:23 qrczak Exp $ +-- $Id: Main.hs,v 1.7 2001/03/27 13:38:03 simonmar Exp $ -- -- Package management tool ----------------------------------------------------------------------------- @@ -18,13 +18,6 @@ import Directory import System import IO --- HACK: 'tail' below deletes a leading space introduced by a confusing --- cpp trick. Note that cpp's stringify operator # doesn't work --- because of the -traditional flag. TEXT SUBSTITUTION IS EVIL. --- TEXT SUBSTITUTION IS EVIL. TEXT SUBSTITUTION... -default_pkgconf = tail $ "\ - \ clibdir" ++ "/package.conf" - main = do args <- getArgs @@ -53,7 +46,7 @@ flags = [ runit clis = do conf_file <- case [ f | Config f <- clis ] of - [] -> return default_pkgconf + [] -> die "missing -f option, location of package.conf unknown" [f] -> return f _ -> die (usageInfo usageHeader flags) diff --git a/ghc/utils/ghc-pkg/Makefile b/ghc/utils/ghc-pkg/Makefile index 00f9ede..e12187c 100644 --- a/ghc/utils/ghc-pkg/Makefile +++ b/ghc/utils/ghc-pkg/Makefile @@ -1,13 +1,59 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.6 2001/03/25 11:08:42 panne Exp $ +# $Id: Makefile,v 1.7 2001/03/27 13:38:03 simonmar Exp $ TOP=../.. include $(TOP)/mk/boilerplate.mk -HS_PROG = ghc-pkg +# hack for ghci-inplace script, see below +INSTALLING=1 + +# ----------------------------------------------------------------------------- +# ghc-pkg.bin + +HS_PROG = ghc-pkg.bin SRC_HC_OPTS += -cpp -DPKG_TOOL -DWANT_PRETTY -package lang \ - -package util -package text -Dclibdir="$(libdir)" + -package util -package text + +INSTALL_LIBEXECS = $(HS_PROG) + +# ----------------------------------------------------------------------------- +# ghc-pkg script -INSTALL_PROGS = $(HS_PROG) +ifeq "$(INSTALLING)" "1" +ifeq "$(BIN_DIST)" "1" +GHCPKGBIN=$$\"\"libdir/$(HS_PROG) +PKGCONF=$$\"\"libdir/package.conf +else +GHCPKGBIN=$(libdir)/$(HS_PROG) +PKGCONF=$(libdir)/package.conf +endif # BIN_DIST +else +GHCPKGBIN=$(FPTOOLS_TOP_ABS)/ghc/utils/ghc-pkg/$(HS_PROG) +PKGCONF=$(FPTOOLS_TOP_ABS)/ghc/driver/package.conf.inplace +endif + +INSTALLED_SCRIPT_PROG = ghc-pkg-$(ProjectVersion) +INPLACE_SCRIPT_PROG = ghc-pkg-inplace + +SCRIPT_OBJS = ghc-pkg.sh +INTERP = $(SHELL) +SCRIPT_SUBST_VARS = GHCPKGBIN PKGCONFOPT +INSTALL_SCRIPTS += $(SCRIPT_PROG) +PKGCONFOPT = -f $(PKGCONF) + +ifeq "$(INSTALLING)" "1" +SCRIPT_PROG = $(INSTALLED_SCRIPT_PROG) +LINK = ghc-pkg +else +SCRIPT_PROG = $(INPLACE_SCRIPT_PROG) +endif + +# ----------------------------------------------------------------------------- +# don't recurse on 'make install' +# +ifeq "$(INSTALLING)" "1" +all clean distclean maintainer-clean :: + $(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@ +endif include $(TOP)/mk/target.mk -- 1.7.10.4