Fix SPARC build, missing #include
[ghc-hetmet.git] / mk / package.mk
index 60507db..079e4f6 100644 (file)
@@ -84,7 +84,9 @@ install::
               -x c $(PACKAGE_CPP_OPTS) package.conf.in \
            | grep -v '^#pragma GCC' \
            | sed -e 's/""//g' -e 's/:[   ]*,/: /g' \
-           | $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)/ghc-pkg-inplace --global-conf $(DESTDIR)$(libdir)/package.conf update - --force
+           | $(GHC_PKG_INSTALL_PROG) --global-conf $(DESTDIR)$(datadir)/package.conf update - --force
+
+GHC_PKG_INSTALL_PROG = $(FPTOOLS_TOP_ABS)/utils/ghc-pkg/dist-install/build/ghc-pkg/ghc-pkg
 
 # we could be more accurate here and add a dependency on
 # driver/package.conf, but that doesn't work too well because of
@@ -120,6 +122,7 @@ SRC_HSC2HS_OPTS += -I.
 
 ifneq "$(NO_SET_HC)" "YES"
 HC = $(GHC_INPLACE)
+BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS =
 endif
 IGNORE_PACKAGE_FLAG = -package-name  $(PACKAGE)-$(VERSION)
 
@@ -129,14 +132,15 @@ SRC_HC_OPTS       += $(GhcLibHcOpts)
 SRC_HC_OPTS     += $(patsubst %, -package %, $(PACKAGE_DEPS))
 endif
 
-#      -fgenerics switches on generation of support code for 
+#      -XGenerics switches on generation of support code for 
 #              derivable type classes.  This is now off by default,
 #              but we switch it on for the libraries so that we generate
 #              the code in case someone importing wants it.
 ifeq "$(NON_HS_PACKAGE)" ""
-SRC_HC_OPTS    += -fgenerics
+SRC_HC_OPTS    += -XGenerics
 endif
 
+ifndef DONT_WANT_STD_LIBRARY
 ifndef LIBRARY
 ifeq "$(_way:%_dyn=YES)" "YES"
 LIBRARY        = libHS$(PACKAGE)$(_way:%_dyn=%)-ghc$(ProjectVersion)$(soext)
@@ -144,11 +148,13 @@ else
 LIBRARY        = libHS$(PACKAGE)$(_way).a
 endif
 endif
+endif
 
 ifeq "$(WAYS)" ""
 WAYS = $(GhcLibWays)
 endif
 
+ifdef LIBRARY
 all :: $(LIBRARY)
 
 # POSSIBLE alternative version using --make:
@@ -173,6 +179,7 @@ ifeq "$(DLLized)" "YES"
 INSTALL_PROGS += $(DLL_NAME)
 INSTALL_LIBS += $(patsubst %.a,%_imp.a, $(LIBRARY))
 endif
+endif
 
 # The interface files are put inside the $(libdir), since they
 # might (potentially) be platform specific..
@@ -267,31 +274,18 @@ ifneq "$(HS_PPS)" ""
 
 CLEAN_FILES += $(HS_PPS) $(addsuffix .tmp, $(HS_SRCS))
 
-ifeq "$(HADDOCK)" ""
-html ::
-       @echo Haddock must be installed in order to build HTML library documentation.
-       @echo Please install Haddock and re-configure.
-       @exit 1
-endif
-
 html :: $(HTML_DOC)
 
 extraclean :: 
        $(RM) -rf $(HTML_DIR)
 
-ifneq "$(findstring $(PACKAGE), $(CorePackages))" ""
-HaddockSourceURL = $(CorePackageSourceURL)
-else
-HaddockSourceURL = $(ExtraPackageSourceURL)
-endif
-
 $(HTML_DOC) : $(HS_PPS)
        @$(INSTALL_DIR) $(HTML_DIR)
        $(HADDOCK) $(HADDOCK_OPTS) -h -o $(HTML_DIR) $(HS_PPS) \
                --package=$(PACKAGE) \
                --dump-interface=$(PACKAGE).haddock \
                --use-index=../doc-index.html --use-contents=../index.html \
-               --source-module=$(HaddockSourceURL) \
+               --source-module=$(PackageSourceURL) \
                $(foreach pkg, $(PACKAGE_DEPS), \
                   --read-interface=../$(pkg),../$(pkg)/$(pkg).haddock)