Commit 0065d5ab authored by Simon Marlow's avatar Simon Marlow

Reorganisation of the source tree

Most of the other users of the fptools build system have migrated to
Cabal, and with the move to darcs we can now flatten the source tree
without losing history, so here goes.

The main change is that the ghc/ subdir is gone, and most of what it
contained is now at the top level.  The build system now makes no
pretense at being multi-project, it is just the GHC build system.

No doubt this will break many things, and there will be a period of
instability while we fix the dependencies.  A straightforward build
should work, but I haven't yet fixed binary/source distributions.
Changes to the Building Guide will follow, too.
parent 28a464a7

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -175,6 +175,13 @@ A rough roadmap to the source tree:
The GHC Developer's Wiki
The home for GHC Developers, with information on accessing the latest sources,
the bug tracker, and further documentation on the code.
The Building Guide
Full documentation on the build system.
This diff is collapsed.
GHC build system
The Glasgow Haskell Compiler
This is the top-level directory of the fptools build system. Several
packages are part of this build system; if you got this as part of a
source distribution (eg. for GHC), then you will have one or more of
the following directories:
This is the source tree for GHC, a compiler and interactive
environment for the Haskell functional programming language.
ghc The Glasgow Haskell Compiler
hslibs A Collection of Haskell libraries
haddock A Haskell documentation tool
haggis The Haggis GUI toolkit
happy The Happy Haskell parser generator
hdirect Haskell interop tool
greencard A foreign function interface pre-processor for Haskell.
libraries Haskell libraries (reqd. by ghc)
nofib The NoFib Haskell benchmarking suite
For more information, visit GHC's web site:
Additional documentation for each project can be found in its
respective directory.
In addition, the following directories contain project-independent bits:
Information for developers of GHC can be found here:
mk GNU make setup used by all of fptools
glafp-utils Shared utility programs
docs Documentation on the installing and using
the fptools build system.
distrib Tools and additional bits for building distributions
Quick start: the following is *supposed* to work
Building & Installing
NB. you need GHC installed in order to build GHC, because the compiler
is itself written in Haskell. It is possible to build GHC using just
a C compiler, but we don't recommend this as the normal route. If you
*really* want to do it this way, then see the Building Guide (link
You also need a few other tools installed: Happy [4], Alex [5], and
Haddock [6] (for building library documentation), and a good DocBook
XML toolchain if you want to build the compiler documentation.
Quick start: the following gives you a default build:
$ autoreconf
$ ./configure
$ make
$ make install
where 'make' is whatever GNU make is called on your system (GNU make
is *required*). If there are any other tools required for the build,
then the configure script will detect them and tell you if any are
missing. For example, a working GHC installation is required for
building most of the tools (including GHC itself).
The autoreconf step is only necessary if this is a tree checked out
from darcs. For source distributions downloaded from GHC's web site,
this step has already been performed.
These steps give you the default build, which includes everything
optimised and built in various ways (eg. profiling libs are built).
It can take a long time. To customise the build, see the file
For full information on building GHC, see the GHC Building Guide [3],
which is also available in source form (DocBook XML) in docs/building.
The configuration script is a standard GNU autoconf script which
accepts all the normal arguments, eg. --prefix=<blah> to install the
package somewhere other than /usr/local. Try ./configure --help to
get a full list of the options.
There is usually an ANNOUNCE* file with any distribution. Please
consult that, or the <piece>/README file, to find out how to proceed.
Full documentation for the fptools build system can be found in the
Building Guide:
[1] GHC Home Page
[2] GHC Developer's Wiki
Building Guide
[4] Happy
[5] Alex
[6] Haddock
More information about GHC can be found here:
The GHC Team,
Please see
......@@ -1055,4 +1055,65 @@ else
# -------------------
AC_CACHE_CHECK([whether ghc has readline package], [fp_cv_ghc_has_readline],
[if "${GhcPkgCmd-ghc-pkg}" --show-package readline >/dev/null 2>&1; then
AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/'`])
# --------------------------
# Some OSs (Mandrake Linux, in particular) configure GCC with
# -momit-leaf-frame-pointer on by default. If this is the case, we need to turn
# it off for mangling to work. The test is currently a bit crude, using only the
# version number of gcc. Defines HAVE_GCC_MNO_OMIT_LFPTR.
AC_CACHE_CHECK([whether gcc needs -mno-omit-leaf-frame-pointer], [fp_cv_gcc_needs_no_omit_lfptr],
[FP_COMPARE_VERSIONS([$gcc_version_str], [-ge], [3.2],
if test "$fp_cv_gcc_needs_no_omit_lfptr" = "yes"; then
AC_DEFINE([HAVE_GCC_MNO_OMIT_LFPTR], [1], [Define to 1 if gcc supports -mno-omit-leaf-frame-pointer.])
# ---------------------
[# Some renamings
AC_SUBST([ProjectVersion], [$PACKAGE_VERSION])
# Split PACKAGE_VERSION into (possibly empty) parts
VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
# Calculate project version as an integer, using 2 digits for minor version
?) ProjectVersionInt=${VERSION_MAJOR}0${VERSION_MINOR} ;;
??) ProjectVersionInt=${VERSION_MAJOR}${VERSION_MINOR} ;;
*) AC_MSG_ERROR([bad minor version in $PACKAGE_VERSION]) ;;
# The project patchlevel is zero unless stated otherwise
test -z "$ProjectPatchLevel" && ProjectPatchLevel=0
# Remove dots from the patch level; this allows us to have versions like
ProjectPatchLevel=`echo $ProjectPatchLevel | sed 's/\.//'`