-# line 8 "only4-ghc.ljm"
+#if 0
+%************************************************************************
+%* *
+\section[mkworld-only4-ghc]{Extra things ``only for'' for the @ghc@ project}
+%* *
+%************************************************************************
+
+\begin{code}
+#endif /* 0 */
/* Project identification - name and version */
#ifndef ProjectName
#endif
/* ProjectVersion is something printable */
#ifndef ProjectVersion
-#define ProjectVersion 0.26
+#define ProjectVersion 2.01
#endif
/* A patchlevel change is something *very minor* */
#ifndef ProjectPatchLevel
#endif
/* GhcBuildeeVersion is something CPP-testable (ProjectVersion * 100) */
#ifndef GhcBuildeeVersion
-#define GhcBuildeeVersion 26
+#define GhcBuildeeVersion 201
#endif
-# line 29 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+Make variables that say where the source to main pieces of the system live:
+\begin{code}
+#endif /* 0 */
/* state of the source world */
GHC_DRIVERSRC = $(TOP)/ghc/driver
GHC_COMPILERSRC = $(TOP)/ghc/compiler
GHC_INCLUDESRC = $(TOP)/ghc/includes
GHC_UTILSRC = $(TOP)/ghc/utils
GHC_BOOKSRC = $(TOP)/ghc/book
-# line 41 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+Include definitions (usually to go with generated C):
+\begin{code}
+#endif /* 0 */
#ifndef GhcIncludesDir
#define GhcIncludesDir $(GHC_INCLUDESRC)
#endif
GHC_INCLUDES = GhcIncludesDir
-# line 51 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+A make variable that's occasionally very important: we use \tr{GHC_*}
+when we really mean GHC, rather than \tr{HC*}, which just means ``the
+standard Haskell compiler'' (whatever that is).
+\begin{code}
+#endif /* 0 */
#ifndef AllProjectsGhcOpts
#define AllProjectsGhcOpts /*none*/
#endif
GenerateOptionsMakeVars(GHC,OPTS,AllProjectsGhcOpts,PlatformGhcOpts,ProjectGhcOpts,SetupGhcOpts)
GHCFLAGS=$(GLUED_CPP_DEFINES) $(GLUED_GHC_OPTS)
-# line 95 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{What to build}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection{Include or leave out these individual ``features''}
+%* *
+%************************************************************************
+
+\begin{code}
+#endif /* 0 */
/* build York interpreter as well as Glasgow compiler
*/
#ifndef BuildYorkInterpreter
#ifndef UseSemantiqueStrictnessAnalyser
#define UseSemantiqueStrictnessAnalyser NO
#endif
-# line 116 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Installation: whether to, where to, what to}
+%* *
+%************************************************************************
+
+\begin{code}
+#endif /* 0 */
/* defaults for which pieces should be installed */
/* ToDo: possibly obsolete */
#ifndef DoInstallGHCSystem
#define DoInstallGHCSystem YES
#endif /* DoInstallGHCSystem */
-# line 124 "only4-ghc.ljm"
+
/* ------------------------------------------------------------------ */
/* compiler-proper subsystem:
the lib/data bits are installed w/ a version number as well
INSTSCRIPTDIR_GHC = InstScriptDir_GHC
INSTLIBDIR_GHC = InstLibDir_GHC
INSTDATADIR_GHC = InstDataDir_GHC
-# line 183 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Configuring the driver}
+%* *
+%************************************************************************
+
+The driver script is the thing that glues the compilation system
+together. It needs to know what is/isn't included in the system,
+e.g., what garbage-collectors are catered for.
+
+Mkworld records the needed information in make variables (e.g.,
+\tr{$(GHC_HSCPP)}), and we then `msub' that into the driver (perl)
+script. Note: ALL configuration info should be HERE (not hacked into
+the script)!
+
+The first chunk of stuff here is mkworld boilerplate and probably
+doesn't need fiddling. Once we get into what C compiler(s) to use for
+compiling .hc files, what libraries are available, etc., there may be
+something to tweak (but not here -- in a `setup' file, please!) There
+are further comments where the tweakables begin...
+
+First, the driver can be installed under any old name; here's the default:
+\begin{code}
+#endif /* 0 */
#ifndef GhcDriverInstallName
#define GhcDriverInstallName ghc
#endif /* ! GhcDriverInstallName */
GHC_DRIVER_INST_NAME = GhcDriverInstallName
-# line 197 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Where to find the programs for the various phases}
+%* *
+%************************************************************************
+
+First, the driver itself:
+\begin{code}
+#endif /* 0 */
/* ghc: std driver for compilation system */
#ifndef GhcDriverCmd
#define GhcDriverCmd $(GHC_DRIVERSRC)/ghc
/* could be GHC_DRIVER, but GHC is its common name */
GHC = GhcDriverCmd
-# line 218 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+\tr{unlit}, to de-literatise a source file, is from the HBC
+distribution. See utils-ghc.
+
+\tr{hscpp}: runs C pre-processor but converts \tr{#line}s to Haskell pragmas;
+is platform-independent.
+\begin{code}
+#endif /* 0 */
#ifndef HsCppCmd
#define HsCppCmd $(GHC_HSCPPSRC)/hscpp
#endif
GHC_HSCPP = HsCppCmd $(ALLPROJ_CPP_DEFINES)
GHC_HSCPPSRC = $(GHC_UTILSRC)/hscpp
-# line 233 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+\tr{hsp}: std Haskell parser.
+\begin{code}
+#endif /* 0 */
#ifndef HsParserCmd
#define HsParserCmd $(GHC_HSPSRC)/hsp
#endif
GHC_HSP = HsParserCmd
GHC_HSPSRC = $(GHC_HSCSRC)
-# line 248 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+\tr{hsc}: std Haskell compiler.
+\begin{code}
+#endif /* 0 */
#ifndef HsCompilerCmd
#define HsCompilerCmd $(GHC_HSCSRC)/hsc
#endif
GHC_HSC = HsCompilerCmd
GHC_HSCSRC = $(GHC_COMPILERSRC)
-# line 263 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+\tr{SysMan}: PVM-controlling program for parallel Haskell.
+\begin{code}
+#endif /* 0 */
#ifndef SysManCmd
#define SysManCmd $(GHC_RUNTIMESRC)/gum/SysMan
#endif
GHC_SYSMAN = SysManCmd
GHC_SYSMANSRC = $(GHC_RUNTIMESRC)
-# line 318 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+For an ``assembler'' and a ``linker,'' the driver uses the same
+program as it used for C compilation; this means libraries and things
+are likely to be picked up correctly.
+
+%************************************************************************
+%* *
+\subsubsection{Stuff for the C-compiling phase in particular...}
+%* *
+%************************************************************************
+
+{\em High-level assembler}: C compiler with which to compile \tr{.hc} files.
+
+There are {\em three} things to set:
+\begin{enumerate}
+\item
+C compilers to use:
+\begin{itemize}
+\item
+compiler to use for ``debugging'' compilation (@GHC_DEBUG_HILEV_ASM@)
+\item
+compiler to use for ``optimising'' compiling (w/ regs magic, etc)
+(@GHC_OPT_HILEV_ASM@)
+This must be GCC; otherwise opt compiling must be turned off.
+\end{itemize}
+
+\item
+Whether or not you can do the ``optimising''-style compilation (set
+@GHC_GCC_IS_AVAILABLE@).
+\end{enumerate}
+
+For options that should always be applied {\em for this project},
+set the @ProjectGhcOpts@ variable...
+
+Similarly, for a particular {\em setup}, use @SetupGhcOpts@...
+
+%************************************************************************
+%* *
+\subsubsubsection{Which C compiler to use (GCC is best)}
+%* *
+%************************************************************************
+
+\begin{code}
+#endif /* 0 */
/* NON-OPTIMISING C COMPILATION: ==================================
We can use GCC 2.n for the non-optimising (normal) .hc C
#endif /* ! gcc */
#endif /* GhcDebuggingHighLevelAsmCmd */
GHC_DEBUG_HILEV_ASM = GhcDebuggingHighLevelAsmCmd
-# line 342 "only4-ghc.ljm"
+
/* OPTIMISING C COMPILATION (regs, etc): ==========================
Must use GCC 2.n for this
#endif /* ! gcc */
#endif /* GhcOptHighLevelAsmCmd */
GHC_OPT_HILEV_ASM = GhcOptHighLevelAsmCmd
+#if 0
+\end{code}
+#endif /* 0 */