Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
6e9db312
Commit
6e9db312
authored
Sep 17, 2010
by
Ian Lynagh
Browse files
extra packages info is now read from packages file
rather than being repeated in the build system
parent
44af0575
Changes
2
Hide whitespace changes
Inline
Side-by-side
ghc.mk
View file @
6e9db312
...
...
@@ -279,6 +279,7 @@ include rules/build-package.mk
include
rules/build-package-way.mk
include
rules/haddock.mk
include
rules/tags-package.mk
include
rules/extra-packages.mk
# -----------------------------------------------------------------------------
# Registering hand-written package descriptions (used in libffi and rts)
...
...
@@ -298,20 +299,29 @@ include rules/bindist.mk
# -----------------------------------------------------------------------------
# Building libraries
define addPackage # args
:
$1 = package
,
$2 = condition
ifneq
"$2" ""
define
addPackageGeneral
# args: $1 = PACKAGES variable, $2 = package, $3 = condition
ifeq
"$3" ""
$1
+=
$2
else
ifeq
"$$(CLEANING)" "YES"
PACKAGES
+=
$
1
$1
+=
$
2
else
ifeq
$
2
PACKAGES
+=
$
1
ifeq
$
3
$1
+=
$
2
endif
endif
else
PACKAGES
+=
$1
endif
endef
define addPackage # args
:
$1 = package
,
$2 = condition
$(call
addPackageGeneral,PACKAGES,$1,$2)
endef
define addPackage2 # args
:
$1 = package
,
$2 = condition
$(call
addPackageGeneral,PACKAGES_STAGE2,$1,$2)
endef
INTREE_ONLY_PACKAGES
:=
haskeline mtl terminfo utf8-string xhtml
$(foreach
p,$(INTREE_ONLY_PACKAGES),$(eval
libraries/
$p_dist-install_HADDOCK_ME
=
NO
))
...
...
@@ -355,28 +365,8 @@ $(eval $(call addPackage,terminfo,($$(Windows),NO)))
$(eval
$(call
addPackage,haskeline))
$(foreach
pkg,$(EXTRA_PACKAGES),$(eval
$(call
addPackage,$(pkg))))
$(eval
$(call
extra-packages))
# ------------------- Adding DPH packaes ---------------
# The DPH packages are added when:
# * not BootingFromHc (they aren't necessary for bootstrapping), and
# * not GhcProfiled (they need TH, so can't be compiled by a -prof GHC), or
# * CLEANING: when cleaning we always enable everything
# if !BootingFromHc && (!GhcProfiled || CLEANING)
ifneq
"$(BootingFromHc)" "YES"
ifneq
"$(GhcProfiled) $(CLEANING)" "NO YES"
PACKAGES_STAGE2
+=
dph/dph-base
\
dph/dph-prim-interface
\
dph/dph-prim-seq
\
dph/dph-prim-par
\
dph/dph-seq
\
dph/dph-par
endif
endif
# BootingFromHc
# -------------------------------------------------------
...
...
@@ -516,8 +506,6 @@ libraries/ghc-prim_dist-install_EXTRA_HADDOCK_SRCS = libraries/ghc-prim/dist-ins
#
# The rest : libraries/*/dist-install, compiler/stage2, ghc/stage2
BUILD_DIRS
=
ifneq
"$(BINDIST)" "YES"
BUILD_DIRS
+=
\
$(GHC_MKDIRHIER_DIR)
...
...
@@ -567,11 +555,6 @@ BUILD_DIRS += \
$(
patsubst
%, libraries/%,
$(PACKAGES)
)
endif
ifneq
"$(BootingFromHc)" "YES"
BUILD_DIRS
+=
\
libraries/dph
endif
ifeq
"$(INTEGER_LIBRARY)" "integer-gmp"
BUILD_DIRS
+=
libraries/integer-gmp/gmp
endif
...
...
@@ -961,6 +944,7 @@ $(eval $(call bindist,.,\
INSTALL
\
configure
config.sub
config.guess
install-sh
\
extra-gcc-opts.in
\
packages
\
Makefile
\
mk/config.mk.in
\
$(INPLACE_BIN)/mkdirhier
\
...
...
@@ -997,6 +981,9 @@ $(eval $(call bindist,.,\
libraries/gen_contents_index
\
libraries/prologue.txt
\
libraries/dph/LICENSE
\
libraries/dph/ghc-packages
\
libraries/dph/ghc-packages2
\
libraries/dph/ghc-stage2-package
\
))
endif
# mk/project.mk gets an absolute path, so we manually include it in
...
...
@@ -1007,7 +994,7 @@ BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk
unix-binary-dist-prep
:
"
$(RM)
"
$(RM_OPTS_REC)
bindistprep/
"
$(MKDIRHIER)
"
$(BIN_DIST_PREP_DIR)
set
-e
;
for
i
in
LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh extra-gcc-opts.in ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL
;
do
ln
-s
../../
$$
i
$(BIN_DIST_PREP_DIR)
/
;
done
set
-e
;
for
i
in
packages
LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh extra-gcc-opts.in ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL
;
do
ln
-s
../../
$$
i
$(BIN_DIST_PREP_DIR)
/
;
done
echo
"HADDOCK_DOCS =
$(HADDOCK_DOCS)
"
>>
$(BIN_DIST_MK)
echo
"LATEX_DOCS =
$(LATEX_DOCS)
"
>>
$(BIN_DIST_MK)
echo
"BUILD_DOCBOOK_HTML =
$(BUILD_DOCBOOK_HTML)
"
>>
$(BIN_DIST_MK)
...
...
rules/extra-packages.mk
0 → 100644
View file @
6e9db312
# -----------------------------------------------------------------------------
#
# (c) 2010 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
# http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
# http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------
define
extra-packages
$$(foreach
p,$$(patsubst
libraries/%,%,$$(wildcard
$$(shell
grep
'^[^ ]\+ \+\(dph\|extra\) \+[^ ]\+ \+[^ ]\+ \+[^ ]\+'
packages
|
sed
's/ .*//'
))),\
$$(eval
BUILD_DIRS
+=
libraries/
$$
p
)
\
$
$(
if
$
$(
wildcard
libraries/
$$
p/ghc-packages
)
,
\
$
$(
foreach
q,
$
$(
shell
cat
libraries/
$$
p/ghc-packages2
)
,
$
$(
eval
$
$(
call
extra-package,
$$
p,
$$
p/
$$
q
)))
,
\
$
$(
eval
$
$(
call
extra-package,
$$
p,
$$
p
)))
\
)
endef
define
extra-package
# $1 = package root, $2 = package
ifeq
"$(wildcard libraries/$1/ghc-stage2-package)" ""
$$(eval
$$(call
addPackage,$2))
else
$$(eval
$$(call
addPackage2,$2))
endif
endef
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment