Commit 9c908ebb authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-04-23 13:39:14 by afrisch] Doc

Original author: afrisch
Date: 2004-04-23 13:39:14+00:00
parent 19f26192
......@@ -10,6 +10,19 @@ and Windows XP.
Prerequisites
------------------------------------------------------------------------------
An easy way to get a system ready to compile CDuce is to use
the GODI distribution:
http://www.ocaml-programming.de/godi/
It includes all the mandatory and optional packages listed below,
and also the special modules needed to build the OCaml/CDuce interface.
Mandatory packages:
-------------------
Before compiling CDuce, you need to install recent releases of the
following packages:
......@@ -26,58 +39,39 @@ ocamlnet => 0.94
pxp => 1.1.94.2
http://www.ocaml-programming.de/packages/documentation/pxp/index_dev.html
Furthermore if you want to load xml, html, and schema files remotely on the
Additional optional packages:
-----------------------------
* If you want to load xml, html, and schema files remotely on the
web (http, https, ftp, ...: e.g. load_html "http://www.cduce.org") you will
also need either:
need one of:
ocurl => 0.15
http://sourceforge.net/projects/ocurl/
or
netclient => 0.90.1
http://www.ocaml-programming.de/programming/netclient.html
netclient support only the http protocol. curl supports in addition https,
ftp, and other protocols.
netclient support only the http protocol.
curl supports in addition https, ftp, and other protocols.
* You can also use the expat parser instead of PXP to load XML documents
(PXP is still needed):
There is a configure script. It will check for the presence of
mandatory packages, and detect automatically optional ones. It will
also set installation directories. Running the script produces a
Makefile.conf file. You can get usage information about the script
with: ./configure --help
ocaml-expat => 0.1.0
http://home.wanadoo.nl/maas/ocaml/
Alternatively, it is also possible to copy Makefile.conf.template to
Makefile.conf and modify it by hand. The Makefile variables mentioned
below are set in this Makefile.conf file.
Important notes:
- OCaml: cduce uses recursive modules so versions of OCaml before 3.07
will not work. Also early standard distribution of 3.07 had two bugs
that made CDuce compilation fail. Use patchlevel 2 distribution or patch
OCaml source by
http://caml.inria.fr/bin/caml-bugs/fixed?id=1863;page=77;user=guest
http://www.cduce.org/download/patch-ocaml-3.07
or (risky) install OCaml cvs version
cvs -d":pserver:anoncvs@camlcvs.inria.fr:/caml" login
<hit enter key when asked for password>
cvs -z3 -d":pserver:anoncvs@camlcvs.inria.fr:/caml" co ocaml
Furthermore cduce can be interfaced with OCaml language to be called from
it. In order to be able to use this feature, you will have to set the
CDuce environment variable ML_INTERFACE to true, patch OCaml
Makefile and build a special library. Everything is explained bellow.
----------------
- pcre-ocaml: you may also need to install the PCRE library
from http://www.pcre.org/ (use version >=4.4)
[red-hat users: pcre (rawhide) packages may not work with the
latest pcre-ocaml versions, use tarballs]
In this case configure it with the --enable-utf8 option.
In this case, configure it with the --enable-utf8 option.
>= 5.03 recommended but previous versions may work
- PXP:
......@@ -88,11 +82,14 @@ Important notes:
can be done by installing wlex runtime support library *before* pxp
http://www.eleves.ens.fr/home/frisch/soft.html#wlex
and build pxp -with-wlex*. When building CDuce you still have the
choice whether to use wlex or camllex (see PXP_WLEX option below)
choice whether to use wlex or ocamllex (to choose wlex,
do ./configure --with-pxp_wlex or set PXP_WLEX=true in Makefile.conf).
- ocurl:
you may also need to install libcurl (http://curl.haxx.se/libcurl/)
To use it you have to set the variable CURL = true.
- ocaml-expat:
you may also need to install libexpat (http://expat.sourceforge.net/)
Efficiency issues:
......@@ -102,42 +99,32 @@ Efficiency issues:
Indeed, the netconversion module in the previous release (0.95) was
very slow, and it has been rewritten since then.
- PXP: for better efficiency wlex is disabled by default.
- PXP: ocamllex lexers are more efficient than wlex lexers.
------------------------------------------------------------------------------
Compilation
------------------------------------------------------------------------------
IF YOU SET ML_INTERFACE TO TRUE ...
that is if you want to be able to call CDuce functions from OCaml
then you have to build OCaml compiler lib:
- Copy ocaml_cdo2cmo_patch (located in cdo2cmo directory of your cduce
archive) in the directory where you extracted OCaml sources.
- Patch OCaml's Makefile with:
patch -Np1 < ocaml_cdo2cmo_patch
- Build OCaml's special library:
make install_liball
and if you want to compile CDuce with ocamlopt then
make install_liball.opt
ELSE
There is a configure script. It will check for the presence of
mandatory packages, and detect automatically optional ones. It will
also set installation directories. Running the script produces a
Makefile.conf file. You can get usage information about the script
with: ./configure --help
Alternatively, it is also possible to copy Makefile.conf.template to
Makefile.conf and modify it by hand.
THE FAST WAY:
./configure && make all && make install
The usual command line for configuring and building CDuce:
./configure && make all && make install
THE WISE WAY:
To see all the configuration options:
./configure --help
So you see all the configuration options
Then
./configure <your preferred options>
You need a GNU Make (or equivalent) to use the Makefile generated at
the previous step. It defines the following goals:
You need a GNU Make (or equivalent). The Makefile defines the following goals:
- make help
print a summary of what follows
......@@ -160,16 +147,15 @@ the previous step. It defines the following goals:
- make install_web
compiles webiface and webpages, and install everything
in the under the $WEB_PREFIX directory (see Makefile.conf)
in the under the $(WEB_PREFIX) directory (see Makefile.conf)
- make all
equivalent to (make cduce dtd2cduce validate)
- make install
it installs
cduce validate and dtd2cduce into $(PREFIX)/bin
cduce.1 into $(PREFIX)/man/man1
(see PREFIX below)
cduce validate and dtd2cduce into $(BINDIR)
cduce.1 into $(MANDIR)/man1
- make clean
back to the starting point
......@@ -178,25 +164,46 @@ the previous step. It defines the following goals:
removes installed files
------------------------------------------------------------------------------
Support for the expat parser
Building the CDuce/OCaml interface
------------------------------------------------------------------------------
CDuce can uses two XML parsers: PXP and expat. PXP is needed
to build CDuce, and expat support can be additionnaly added.
Here is how to do so.
If you want to build the OCaml/CDuce interface, you will need some
parts of the OCaml compilers which are not installed by default with
OCaml. The files you need are the compiled units from the
subdirectories utils/ parsing/ and typing/ of the OCaml standard
distribution (the .cmi files, and either the corresponding .cmo or the
.cmx+.o). If you still have the compiled OCaml source tree that you used
to build the current version of ocamlc/ocamlopt, in, say
$HOME/ocaml-3.07, you can activate the OCaml/CDuce interface with:
You need to install the expat C library and the OCaml wrapper.
The wrapper can be found at:
./configure --mliface=$HOME/ocaml-3.07
http://home.wanadoo.nl/maas/ocaml/
Another option is to copy all the needed files (.cmi,.cmo/.cmx+.o)
to a single directory, say $HOME/ocaml-modules. Then you can do:
Once the wrapper and be installed, you can build CDuce with
the Makefile option EXPAT=true (which can be set on make command
line or in Makefile.conf).
./configure --mliface=$HOME/ocaml-modules
(the configure script automatically detect whether the files
are directly in the specified directory, or in utils/ parsing/ typing/
subdirectories)
Note for GODI users:
====================
The GODI distribution *does* install the files in
$(LOCALBASE)/lib/ocaml/compiler-lib.
------------------------------------------------------------------------------
Note on using the expat parser
------------------------------------------------------------------------------
CDuce can uses two XML parsers: PXP and expat. PXP is needed
to build CDuce, and expat support can be additionnaly added.
The interpreter is now using expat for loading XML files.
You can still use PXP by providing the --pxp switch on the command
line.
When CDuce is built with expat support, it uses by default expat to
load XML files. You can still use PXP by providing the --pxp switch on
the command line.
Note: the current wrapper for expat does not support inclusion
of external entities. Moreover, the error messages in case of
......
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