# LIBRARY_VERSION(lib)
# --------------------------------
-# Gets the version number of a library
+# Gets the version number of a library.
+# If $1 is ghc-prim, then we define LIBRARY_ghc_prim_VERSION as 1.2.3
AC_DEFUN([LIBRARY_VERSION],[
-LIBRARY_$1_VERSION=`grep -i "^version:" libraries/$1/$1.cabal | sed "s/.* //"`
-AC_SUBST(LIBRARY_$1_VERSION)
+LIBRARY_[]translit([$1], [-], [_])[]_VERSION=`grep -i "^version:" libraries/$1/$1.cabal | sed "s/.* //"`
+AC_SUBST(LIBRARY_[]translit([$1], [-], [_])[]_VERSION)
])
# LocalWords: fi
AC_SUBST(BUILD_DOCBOOK_PDF)
LIBRARY_VERSION(base)
+LIBRARY_VERSION(Cabal)
+LIBRARY_VERSION(ghc-prim)
if grep ' ' compiler/ghc.cabal.in 2>&1 >/dev/null; then
AC_MSG_ERROR([compiler/ghc.cabal.in contains tab characters; please remove them])
<para>All these primitive data types and operations are exported by the
library <literal>GHC.Prim</literal>, for which there is
-<ulink url="../libraries/ghc-prim/GHC-Prim.html">detailed online documentation</ulink>.
+<ulink url="&libraryGhcPrimLocation;/GHC-Prim.html">detailed online documentation</ulink>.
(This documentation is generated from the file <filename>compiler/prelude/primops.txt.pp</filename>.)
</para>
<para>
<para>Any extension from the <literal>Extension</literal> type defined in
<ulink
- url="../libraries/Cabal/Language-Haskell-Extension.html"><literal>Language.Haskell.Extension</literal></ulink>
+ url="&libraryCabalLocation;/Language-Haskell-Extension.html"><literal>Language.Haskell.Extension</literal></ulink>
may be used. GHC will report an error if any of the requested extensions are not supported.</para>
</sect2>
<title>Special built-in functions</title>
<para>GHC has a few built-in functions with special behaviour. These
are now described in the module <ulink
-url="../libraries/ghc-prim/GHC-Prim.html"><literal>GHC.Prim</literal></ulink>
+url="&libraryGhcPrimLocation;/GHC-Prim.html"><literal>GHC.Prim</literal></ulink>
in the library documentation.</para>
</sect1>
a package. All you need to do is write a simple configuration file, put a
few files in the right places, and you have a package. See the
<ulink url="../Cabal/index.html">Cabal documentation</ulink>
- for details, and also the Cabal libraries (<ulink url="../libraries/Cabal/Distribution-Simple.html">Distribution.Simple</ulink>,
+ for details, and also the Cabal libraries (<ulink url="&libraryCabalLocation;/Distribution-Simple.html">Distribution.Simple</ulink>,
for example).</para>
<sect2 id="using-packages">
<para>A package specification is a Haskell record; in particular, it is the
record <ulink
- url="../libraries/Cabal/Distribution-InstalledPackageInfo.html#%tInstalledPackageInfo">InstalledPackageInfo</ulink> in the module Distribution.InstalledPackageInfo, which is part of the Cabal package distributed with GHC.</para>
+ url="&libraryCabalLocation;/Distribution-InstalledPackageInfo.html#%tInstalledPackageInfo">InstalledPackageInfo</ulink> in the module Distribution.InstalledPackageInfo, which is part of the Cabal package distributed with GHC.</para>
<para>An <literal>InstalledPackageInfo</literal> has a human
readable/writable syntax. The functions
<listitem>
<para>(string) The type of license under which this package is distributed.
This field is a value of the <ulink
- url="../libraries/Cabal/Distribution-License.html#t:License"><literal>License</literal></ulink> type.</para>
+ url="&libraryCabalLocation;/Distribution-License.html#t:License"><literal>License</literal></ulink> type.</para>
</listitem>
</varlistentry>
papers</ulink> are an excellent introduction to what STM is, and how to use
it.</para>
- <para>The main library you need to use STM is <ulink
- url="../libraries/stm/Control-Concurrent-STM.html">
- Control.Concurrent.STM</ulink>. The main features supported are these:
+ <para>The main library you need to use is the <ulink
+ url="http://hackage.haskell.org/package/stm">
+ stm library</ulink>. The main features supported are these:
<itemizedlist>
<listitem><para>Atomic blocks.</para></listitem>
<listitem><para>Transactional variables.</para></listitem>
One way to do so is forking threads using Concurrent Haskell (<xref
linkend="concurrent-haskell"/>), but the simplest mechanism for extracting parallelism from pure code is
to use the <literal>par</literal> combinator, which is closely related to (and often used
- with) <literal>seq</literal>. Both of these are available from <ulink
- url="../libraries/parallel/Control-Parallel.html"><literal>Control.Parallel</literal></ulink>:</para>
+ with) <literal>seq</literal>. Both of these are available from the <ulink
+ url="http://hackage.haskell.org/package/parallel">parallel library</ulink>:</para>
<programlisting>
infixr 0 `par`
statistics; see <xref linkend="rts-options-gc" />.</para>
<para>More sophisticated combinators for expressing parallelism are
- available from the <ulink
- url="../libraries/parallel/Control-Parallel-Strategies.html"><literal>Control.Parallel.Strategies</literal></ulink> module.
+ available from the <literal>Control.Parallel.Strategies</literal>
+ module in the <ulink
+ url="http://hackage.haskell.org/package/parallel">parallel package</ulink>.
This module builds functionality around <literal>par</literal>,
expressing more elaborate patterns of parallel computation, such as
parallel <literal>map</literal>.</para>
<!ENTITY win32-dll SYSTEM "win32-dlls.xml">
<!ENTITY ffi-chap SYSTEM "ffi-chap.xml">
<!ENTITY shared_libs SYSTEM "shared_libs.xml">
-<!ENTITY libraryBaseLocation "../libraries/base-@LIBRARY_base_VERSION@">
+<!ENTITY libraryBaseLocation "../libraries/base-@LIBRARY_base_VERSION@">
+<!ENTITY libraryCabalLocation "../libraries/Cabal-@LIBRARY_Cabal_VERSION@">
+<!ENTITY libraryGhcPrimLocation "../libraries/ghc-prim-@LIBRARY_ghc_prim_VERSION@">