From: simonmar Date: Thu, 15 Mar 2001 15:54:35 +0000 (+0000) Subject: [project @ 2001-03-15 15:54:35 by simonmar] X-Git-Tag: Approximately_9120_patches~2396 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=738d6d2c589df091786be8e71300de437c71df72 [project @ 2001-03-15 15:54:35 by simonmar] - Don't duplicate the definition of PackageConfig, instead hackily #include it from ../utils/ghc-pkg/Package.hs. - Add missing source_dir fields to PackageSrc.hs. --- diff --git a/ghc/driver/Makefile b/ghc/driver/Makefile index 3024d71..d57ff69 100644 --- a/ghc/driver/Makefile +++ b/ghc/driver/Makefile @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# $Id: Makefile,v 1.54 2001/02/26 16:50:30 simonmar Exp $ +# $Id: Makefile,v 1.55 2001/03/15 15:54:35 simonmar Exp $ # TOP=.. @@ -9,21 +9,6 @@ include $(TOP)/mk/boilerplate.mk # hack for ghci-inplace script, see below INSTALLING=1 -ifeq "$(GhcWithHscBuiltViaC)" "YES" -HC=$(GHC_INPLACE) -endif - -ghc_407_at_least = $(shell expr "$(GhcMinVersion)" \>= 7) -ifeq "$(ghc_407_at_least)" "1" -ifneq "$(mingw32_TARGET_OS)" "1" -SRC_HC_OPTS += -fglasgow-exts -cpp -package concurrent -package posix -package text -else -SRC_HC_OPTS += -fglasgow-exts -cpp -package concurrent -package text -endif -else -SRC_HC_OPTS += -fglasgow-exts -cpp -syslib concurrent -syslib posix -syslib misc -endif - ifeq "$(INSTALLING)" "1" SUBDIRS = mangler split endif @@ -56,6 +41,19 @@ CLEAN_FILES += $(CONFIG_HS) # ----------------------------------------------------------------------------- # package configuration files... +ghc_407_at_least = $(shell expr "$(GhcMinVersion)" \>= 7) +ifeq "$(ghc_407_at_least)" "1" +ifneq "$(mingw32_TARGET_OS)" "1" +SRC_HC_OPTS += -fglasgow-exts -cpp -package concurrent -package posix -package text +else +SRC_HC_OPTS += -fglasgow-exts -cpp -package concurrent -package text +endif +else +SRC_HC_OPTS += -fglasgow-exts -cpp -syslib concurrent -syslib posix -syslib misc +endif + +SRC_HC_OPTS += -DWANT_PRETTY + all :: package.conf package.conf.inplace pkgconf : Config.o Package.o PackageSrc.o Utils.o @@ -67,6 +65,8 @@ package.conf.inplace : pkgconf package.conf : pkgconf ./pkgconf install >$@ +Package.o : ../utils/ghc-pkg/Package.hs + INSTALL_DATAS += package.conf CLEAN_FILES += pkgconf package.conf.inplace package.conf diff --git a/ghc/driver/Package.hs b/ghc/driver/Package.hs index dac54f2..e3ea78d 100644 --- a/ghc/driver/Package.hs +++ b/ghc/driver/Package.hs @@ -1,47 +1,3 @@ module Package where -import Pretty - -data Package = Package { - name :: String, - import_dirs :: [String], - library_dirs :: [String], - hs_libraries :: [String], - extra_libraries :: [String], - include_dirs :: [String], - c_includes :: [String], - package_deps :: [String], - extra_ghc_opts :: [String], - extra_cc_opts :: [String], - extra_ld_opts :: [String] - } - deriving Read - -listPkgs :: [Package] -> String -listPkgs pkgs = render (fsep (punctuate comma (map (text . name) pkgs))) - -dumpPackages :: [Package] -> String -dumpPackages pkgs = - render (brackets (vcat (punctuate comma (map dumpPkgGuts pkgs)))) - -dumpPkgGuts :: Package -> Doc -dumpPkgGuts pkg = - text "Package" $$ nest 3 (braces ( - sep (punctuate comma [ - text "name = " <> text (show (name pkg)), - dumpField "import_dirs" (import_dirs pkg), - dumpField "library_dirs" (library_dirs pkg), - dumpField "hs_libraries" (hs_libraries pkg), - dumpField "extra_libraries" (extra_libraries pkg), - dumpField "include_dirs" (include_dirs pkg), - dumpField "c_includes" (c_includes pkg), - dumpField "package_deps" (package_deps pkg), - dumpField "extra_ghc_opts" (extra_ghc_opts pkg), - dumpField "extra_cc_opts" (extra_cc_opts pkg), - dumpField "extra_ld_opts" (extra_ld_opts pkg) - ]))) - -dumpField :: String -> [String] -> Doc -dumpField name val = - hang (text name <+> equals) 2 - (brackets (sep (punctuate comma (map (text . show) val)))) +#include "../utils/ghc-pkg/Package.hs" diff --git a/ghc/driver/PackageSrc.hs b/ghc/driver/PackageSrc.hs index 2eb3e6d..fcd545c 100644 --- a/ghc/driver/PackageSrc.hs +++ b/ghc/driver/PackageSrc.hs @@ -18,12 +18,13 @@ main = do _ -> do hPutStr stderr "usage: pkgconf (install | in-place)\n" exitWith (ExitFailure 1) -package_details :: Bool -> [Package] +package_details :: Bool -> [PackageConfig] package_details installing = [ Package { name = "gmp", -- GMP is at the bottom of the heap import_dirs = [], + source_dirs = [], library_dirs = if cHaveLibGmp == "YES" then [] else if installing @@ -42,6 +43,7 @@ package_details installing = Package { name = "rts", -- The RTS is just another package! import_dirs = [], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ ghc_src_dir cGHC_RUNTIME_DIR ], @@ -106,6 +108,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/std" ] else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ ghc_src_dir cGHC_LIB_DIR ++ "/std" @@ -134,6 +137,7 @@ package_details installing = then [ clibdir ++ "/imports/lang" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang" , cFPTOOLS_TOP_ABS ++ "/hslibs/lang/monads" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/lang" @@ -161,6 +165,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/concurrent" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/concurrent" ], @@ -185,6 +190,7 @@ package_details installing = , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Assoc" , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Coll" , cFPTOOLS_TOP_ABS ++ "/hslibs/data/edison/Seq" ], + source_dirs = [], library_dirs = if installing then [clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/data" ], @@ -205,6 +211,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/net" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/net" @@ -230,6 +237,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/posix" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/posix" @@ -254,6 +262,7 @@ package_details installing = , cFPTOOLS_TOP_ABS ++ "/hslibs/text/html" , cFPTOOLS_TOP_ABS ++ "/hslibs/text/HaXml/lib" , cFPTOOLS_TOP_ABS ++ "/hslibs/text/parsec" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/text" @@ -276,6 +285,7 @@ package_details installing = then [ clibdir ++ "/imports/util" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util" , cFPTOOLS_TOP_ABS ++ "/hslibs/util/check" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/util" @@ -303,6 +313,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/hssource" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/hssource" ], @@ -321,6 +332,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/greencard" ] else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/green-card/lib/ghc" ], @@ -339,6 +351,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/win32" ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hslibs/win32" ], @@ -357,6 +370,7 @@ package_details installing = import_dirs = if installing then [ clibdir ++ "/imports/com" ] else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ], + source_dirs = [], library_dirs = if installing then [ clibdir ] else [ cFPTOOLS_TOP_ABS ++ "/hdirect/lib" ],