Commit aa9e7b71 authored by Sylvain Henry's avatar Sylvain Henry Committed by Ben Gamari

Update `make` based build system

* replace integer-* package selection with ghc-bignum backend selection
parent 0f67e344
......@@ -420,7 +420,7 @@ PACKAGES_STAGE0 += terminfo
endif
PACKAGES_STAGE1 += ghc-prim
PACKAGES_STAGE1 += $(INTEGER_LIBRARY)
PACKAGES_STAGE1 += ghc-bignum
PACKAGES_STAGE1 += base
PACKAGES_STAGE1 += filepath
PACKAGES_STAGE1 += array
......@@ -451,6 +451,7 @@ PACKAGES_STAGE1 += parsec
PACKAGES_STAGE1 += Cabal/Cabal
PACKAGES_STAGE1 += ghc-compact
PACKAGES_STAGE1 += ghc-heap
PACKAGES_STAGE1 += integer-gmp # compat library
ifeq "$(HADDOCK_DOCS)" "YES"
PACKAGES_STAGE1 += xhtml
......@@ -466,6 +467,15 @@ endif
# and executables. This flag disables the latter.
libraries/haskeline_CONFIGURE_OPTS += --flags=-examples
libraries/ghc-bignum_CONFIGURE_OPTS += -f $(BIGNUM_BACKEND)
ifeq "$(BIGNUM_BACKEND)" "gmp"
GMP_ENABLED = YES
libraries/ghc-bignum_CONFIGURE_OPTS += --configure-option="--with-gmp"
else
GMP_ENABLED = NO
endif
PACKAGES_STAGE1 += stm
PACKAGES_STAGE1 += exceptions
PACKAGES_STAGE1 += haskeline
......@@ -605,21 +615,6 @@ libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs : $$(genprimopcode_I
# Required so that Haddock documents the primops.
libraries/ghc-prim_dist-install_EXTRA_HADDOCK_SRCS = libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs
# ----------------------------------------
# Special magic for the integer package
ifneq "$(CLEANING)" "YES"
ifeq "$(INTEGER_LIBRARY)" "integer-gmp"
libraries/base_dist-install_CONFIGURE_OPTS += --flags=integer-gmp
compiler_stage2_CONFIGURE_OPTS += --flags=integer-gmp
else ifeq "$(INTEGER_LIBRARY)" "integer-simple"
libraries/base_dist-install_CONFIGURE_OPTS += --flags=integer-simple
compiler_stage2_CONFIGURE_OPTS += --flags=integer-simple
else
$(error Unknown integer library: $(INTEGER_LIBRARY))
endif
endif
# -----------------------------------------------------------------------------
# Include build instructions from all subdirs
BUILD_DIRS += utils/mkdirhier
......@@ -656,7 +651,7 @@ BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE1))
BUILD_DIRS += $(patsubst %, libraries/%, $(filter-out $(PACKAGES_STAGE1),$(PACKAGES_STAGE0)))
endif
BUILD_DIRS += libraries/integer-gmp/gmp
BUILD_DIRS += libraries/ghc-bignum/gmp
BUILD_DIRS += utils/haddock
BUILD_DIRS += utils/haddock/doc
BUILD_DIRS += compiler
......@@ -702,9 +697,6 @@ ifeq "$(GhcWithInterpreter)" "NO"
# runghc is just GHCi in disguise
BUILD_DIRS := $(filter-out utils/runghc,$(BUILD_DIRS))
endif
ifneq "$(INTEGER_LIBRARY)" "integer-gmp"
BUILD_DIRS := $(filter-out libraries/integer-gmp/gmp,$(BUILD_DIRS))
endif
ifneq "$(CrossCompiling) $(Stage1Only)" "NO NO"
# See Note [No stage2 packages when CrossCompiling or Stage1Only].
# See Note [Stage1Only vs stage=1] in mk/config.mk.in.
......@@ -1301,7 +1293,8 @@ sdist_%:
.PHONY: clean
CLEAN_FILES += libraries/integer-gmp/include/HsIntegerGmp.h
CLEAN_FILES += libraries/ghc-bignum/include/ghc-gmp.h
CLEAN_FILES += libraries/ghc-bignum/include/HsIntegerGmp.h
CLEAN_FILES += libraries/base/include/EventConfig.h
CLEAN_FILES += mk/config.mk.old
CLEAN_FILES += mk/project.mk.old
......
......@@ -247,7 +247,7 @@ $(includes_SETTINGS) : includes/Makefile | $$(dir $$@)/.
@echo ',("LLVM opt command", "$(SettingsOptCommand)")' >> $@
@echo ',("LLVM clang command", "$(SettingsClangCommand)")' >> $@
@echo
@echo ',("integer library", "$(INTEGER_LIBRARY)")' >> $@
@echo ',("bignum backend", "$(BIGNUM_BACKEND)")' >> $@
@echo ',("Use interpreter", "$(GhcWithInterpreter)")' >> $@
@echo ',("Use native code generator", "$(GhcWithNativeCodeGen)")' >> $@
@echo ',("Support SMP", "$(GhcWithSMP)")' >> $@
......
......@@ -83,11 +83,10 @@ UseIntreeGmp = YES
endif
endif
# wrappers.c includes "ghc-gmp.h"
libraries/integer-gmp/cbits/wrappers.c: libraries/integer-gmp/include/ghc-gmp.h
# gmp_wrappers.c includes "ghc-gmp.h"
libraries/ghc-bignum/cbits/gmp_wrappers.c: libraries/ghc-bignum/include/ghc-gmp.h
ifeq "$(UseIntreeGmp)" "YES"
# Copy header from in-tree build (gmp.h => ghc-gmp.h)
libraries/ghc-bignum/include/ghc-gmp.h: libraries/ghc-bignum/gmp/gmp.h
$(CP) $< $@
......
......@@ -99,9 +99,9 @@ endif
# https://gitlab.haskell.org/ghc/ghc/wikis/building/running-tests/running#additional-packages
#BUILD_EXTRA_PKGS=YES
# Uncomment the following to force `integer-gmp` to use the in-tree GMP 6.1.2
# Uncomment the following to force `ghc-bignum` to use the in-tree GMP 6.1.2
# (other sometimes useful configure-options: `--with-gmp-{includes,libraries}`)
#libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp
#libraries/ghc-bignum_CONFIGURE_OPTS += --configure-option=--with-intree-gmp
# Enable pretty hyperlinked sources
#HADDOCK_DOCS = YES
......
......@@ -244,8 +244,8 @@ ExtraMakefileSanityChecks = NO
#------------------------------------------------------------------------------
# Options for Libraries
# Which directory (in libraries/) contains the integer library?
INTEGER_LIBRARY=integer-gmp
# Backend to use in ghc-bignum (gmp, native, etc.)
BIGNUM_BACKEND=gmp
# We build the libraries at least the "vanilla" way (way "v")
# Technically we don't need the v way if DYNAMIC_GHC_PROGRAMS is YES,
......
......@@ -10,7 +10,7 @@ BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
WITH_TERMINFO = NO
INTEGER_LIBRARY = integer-simple
BIGNUM_BACKEND = native
Stage1Only = YES
DYNAMIC_BY_DEFAULT = NO
DYNAMIC_GHC_PROGRAMS = NO
......@@ -10,7 +10,7 @@ BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
WITH_TERMINFO = NO
INTEGER_LIBRARY = integer-simple
BIGNUM_BACKEND = native
Stage1Only = YES
DYNAMIC_BY_DEFAULT = NO
DYNAMIC_GHC_PROGRAMS = NO
......@@ -9,7 +9,7 @@ BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
WITH_TERMINFO = NO
INTEGER_LIBRARY = integer-simple
BIGNUM_BACKEND = native
Stage1Only = YES
DYNAMIC_BY_DEFAULT = NO
DYNAMIC_GHC_PROGRAMS = NO
......@@ -9,7 +9,7 @@ BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
WITH_TERMINFO = NO
INTEGER_LIBRARY = integer-simple
BIGNUM_BACKEND = native
Stage1Only = YES
DYNAMIC_BY_DEFAULT = NO
DYNAMIC_GHC_PROGRAMS = NO
......@@ -10,7 +10,7 @@ BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
WITH_TERMINFO = NO
INTEGER_LIBRARY = integer-simple
BIGNUM_BACKEND = native
Stage1Only = YES
DYNAMIC_BY_DEFAULT = NO
DYNAMIC_GHC_PROGRAMS = NO
......@@ -10,7 +10,7 @@ BUILD_SPHINX_PDF = NO
BUILD_MAN = NO
WITH_TERMINFO = NO
INTEGER_LIBRARY = integer-simple
BIGNUM_BACKEND = native
Stage1Only = YES
DYNAMIC_BY_DEFAULT = NO
DYNAMIC_GHC_PROGRAMS = NO
......@@ -100,6 +100,11 @@ ifeq "$$(GMP_FORCE_INTREE)" "YES"
$1_$2_CONFIGURE_OPTS += --configure-option=--with-intree-gmp
endif
ifeq "$$(GMP_ENABLED)" "YES"
$1_$2_CONFIGURE_OPTS += --configure-option=--with-gmp
endif
ifneq "$$(CURSES_LIB_DIRS)" ""
$1_$2_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="$$(CURSES_LIB_DIRS)"
endif
......
......@@ -32,7 +32,7 @@
# - ghc-boot-th
# - ghc-prim
# - integer-gmp
# - integer-simple
# - ghc-bignum
# - template-haskell
define foreachLibrary
......@@ -44,7 +44,7 @@ $$(foreach hashline,libraries/ghc-boot-th#-#no-remote-repo#no-vcs \
libraries/base#-#no-remote-repo#no-vcs \
libraries/ghc-prim#-#no-remote-repo#no-vcs \
libraries/integer-gmp#-#no-remote-repo#no-vcs \
libraries/integer-simple#-#no-remote-repo#no-vcs \
libraries/ghc-bignum#-#no-remote-repo#no-vcs \
libraries/template-haskell#-#no-remote-repo#no-vcs \
$$(shell grep '^libraries/' packages | sed 's/ */#/g'),\
$$(eval FEL_line := $$(subst #,$$(space),$$(hashline))) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment