From: rrt Date: Tue, 21 Aug 2001 09:03:32 +0000 (+0000) Subject: [project @ 2001-08-21 09:03:32 by rrt] X-Git-Tag: Approximately_9120_patches~1164 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=ac227fdeb3b85f923194536cfaed490f4d683e01 [project @ 2001-08-21 09:03:32 by rrt] Fix ghc-pkg to find package.conf when installed on Windows --- diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 2a5f9a7..9d922e9 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.12 2001/08/13 16:32:22 simonmar Exp $ +-- $Id: Main.hs,v 1.13 2001/08/21 09:03:32 rrt Exp $ -- -- Package management tool ----------------------------------------------------------------------------- @@ -18,6 +18,8 @@ import Directory import System import IO +#include "../includes/config.h" + #ifdef mingw32_TARGET_OS import Win32DLL #endif @@ -53,6 +55,8 @@ flags = [ ] #ifdef mingw32_TARGET_OS +subst a b ls = map (\ x -> if x == a then b else x) ls + unDosifyPath xs = subst '\\' '/' xs #endif @@ -65,8 +69,9 @@ runit clis = do #else [] -> do h <- getModuleHandle Nothing n <- getModuleFileName h - return (reverse (tail (dropWhile (not . isSlash) - (reverse (unDosifyPath n)))) ++ "/package.conf") +-- return (reverse (tail (dropWhile (not . isSlash) + return (reverse (drop (length "/bin/ghc-pkg.exe") (reverse (unDosifyPath n))) ++ "/package.conf") +-- (reverse (unDosifyPath n)))) ++ "/package.conf") #endif let toField "import_dirs" = return import_dirs diff --git a/ghc/utils/ghc-pkg/Makefile b/ghc/utils/ghc-pkg/Makefile index 92ea134..a3df7b6 100644 --- a/ghc/utils/ghc-pkg/Makefile +++ b/ghc/utils/ghc-pkg/Makefile @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: Makefile,v 1.8 2001/06/23 12:54:18 panne Exp $ +# $Id: Makefile,v 1.9 2001/08/21 09:03:32 rrt Exp $ TOP=../.. include $(TOP)/mk/boilerplate.mk @@ -14,6 +14,10 @@ HS_PROG = ghc-pkg.bin SRC_HC_OPTS += -cpp -DPKG_TOOL -DWANT_PRETTY -package lang \ -package util -package text +ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" +SRC_HC_OPTS += -package win32 +endif + INSTALL_LIBEXECS = $(HS_PROG) # -----------------------------------------------------------------------------