474051074d2c55bbd2dd148a031045087736e594
[ghc-hetmet.git] / compat / compat.mk
1 # Settings for using the libghccompat.a library elsewhere in the build
2 # tree: this file is just included into Makefiles, see 
3 # utils/ghc-pkg/Makefile for example.
4 #
5 # This is a poor-mans package, but simpler because we don't
6 # have to deal with variations in the package support of different
7 # versions of GHC.
8
9 ifneq "$(UseStage1)" "YES"
10
11 SRC_HC_OPTS += -DUSING_COMPAT
12
13 # Use libghccompat.a:
14 SRC_HC_OPTS += -i$(GHC_COMPAT_DIR)
15 SRC_LD_OPTS += -L$(GHC_COMPAT_DIR) -lghccompat
16
17 # Do *not* use the installed Cabal:
18 SRC_HC_OPTS += -ignore-package Cabal
19
20 ifeq "$(ghc_ge_607)" "YES"
21 SRC_HC_OPTS += -package directory
22 SRC_HC_OPTS += -package pretty
23 SRC_HC_OPTS += -package containers
24 endif
25
26 # And similarly for when booting from .hc files:
27 HC_BOOT_LD_OPTS += -L$(GHC_COMPAT_DIR)
28 HC_BOOT_LIBS += -lghccompat
29
30 ifeq "$(Windows)" "YES"
31 # not very nice, but required for -lghccompat on Windows
32 SRC_LD_OPTS += -lshell32
33 HC_BOOT_LIBS += -lshell32
34 endif
35
36 # This is horrible.  We ought to be able to omit the entire directory
37 # from mkDependHS.
38 SRC_MKDEPENDHS_OPTS += \
39         -optdep--exclude-module=Compat.RawSystem \
40         -optdep--exclude-module=Compat.Directory \
41         -optdep--exclude-module=Compat.Unicode \
42         -optdep--exclude-module=Distribution.Compat.FilePath \
43         -optdep--exclude-module=Distribution.Compat.ReadP \
44         -optdep--exclude-module=Distribution.Extension \
45         -optdep--exclude-module=Distribution.GetOpt \
46         -optdep--exclude-module=Distribution.InstalledPackageInfo \
47         -optdep--exclude-module=Distribution.License \
48         -optdep--exclude-module=Distribution.Package \
49         -optdep--exclude-module=Distribution.ParseUtils \
50         -optdep--exclude-module=Distribution.Compiler \
51         -optdep--exclude-module=Distribution.Version \
52         -optdep--exclude-module=System.FilePath \
53         -optdep--exclude-module=System.FilePath.Posix \
54         -optdep--exclude-module=System.FilePath.Windows \
55         -optdep--exclude-module=System.Directory.Internals \
56         -optdep--exclude-module=Trace.Hpc.Mix \
57         -optdep--exclude-module=Trace.Hpc.Tix \
58         -optdep--exclude-module=Trace.Hpc.Util
59
60 PACKAGE_CABAL =
61 PACKAGE_HPC   =
62
63 else
64
65 PACKAGE_CABAL = -package Cabal
66 PACKAGE_HPC   = -package hpc
67
68 endif
69