From 4ca6ebcdbe6cde690cf5cf337bde39e8b1e73861 Mon Sep 17 00:00:00 2001 From: panne Date: Sun, 25 Mar 2001 11:08:42 +0000 Subject: [PATCH] [project @ 2001-03-25 11:08:42 by panne] OK, here comes the third try to get a simple string from the Makefile into the Haskell sources in a "portable" way... Perhaps we should use compiler/main/Config.hs's technique here. --- ghc/utils/ghc-pkg/Main.hs | 10 +++++++--- ghc/utils/ghc-pkg/Makefile | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 0caefe6..c80912a 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.4 2001/03/24 18:34:05 qrczak Exp $ +-- $Id: Main.hs,v 1.5 2001/03/25 11:08:42 panne Exp $ -- -- Package management tool ----------------------------------------------------------------------------- @@ -18,7 +18,11 @@ import Directory import System import IO -default_pkgconf = clibdir ++ "/package.conf" +-- HACK: The confusing cpp tricks below introduce a leading space. 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 = "\ + \ clibdir" ++ "/package.conf" main = do args <- getArgs @@ -48,7 +52,7 @@ flags = [ runit clis = do conf_file <- case [ f | Config f <- clis ] of - [] -> return default_pkgconf + [] -> return (tail default_pkgconf) -- HACK: Remove leading space [f] -> return f _ -> die (usageInfo usageHeader flags) diff --git a/ghc/utils/ghc-pkg/Makefile b/ghc/utils/ghc-pkg/Makefile index 0d22015..00f9ede 100644 --- a/ghc/utils/ghc-pkg/Makefile +++ b/ghc/utils/ghc-pkg/Makefile @@ -1,12 +1,12 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.5 2001/03/24 18:34:05 qrczak Exp $ +# $Id: Makefile,v 1.6 2001/03/25 11:08:42 panne Exp $ TOP=../.. include $(TOP)/mk/boilerplate.mk HS_PROG = ghc-pkg SRC_HC_OPTS += -cpp -DPKG_TOOL -DWANT_PRETTY -package lang \ - -package util -package text -Dclibdir="\"$(libdir)\"" + -package util -package text -Dclibdir="$(libdir)" INSTALL_PROGS = $(HS_PROG) -- 1.7.10.4