#-----------------------------------------------------------------------------
-# $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=..
# 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
# -----------------------------------------------------------------------------
# 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
package.conf : pkgconf
./pkgconf install >$@
+Package.o : ../utils/ghc-pkg/Package.hs
+
INSTALL_DATAS += package.conf
CLEAN_FILES += pkgconf package.conf.inplace package.conf
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"
_ -> 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
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 ],
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"
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"
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" ],
, 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" ],
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"
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"
, 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"
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"
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" ],
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" ],
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" ],
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" ],