• Home
Name Date Size #Lines LOC

..--

conftools/03-May-2024-16,85012,641

doc/03-May-2024-3,8443,349

examples/03-May-2024-1,244996

lib/03-May-2024-17,41014,006

m4/03-May-2024-9,0758,202

patches/03-May-2024-5343

tests/03-May-2024-16,18413,204

win32/03-May-2024-178144

xmlwf/03-May-2024-4,0483,151

.gitignoreD03-May-2024360 3837

AUTHORSD03-May-2024142 119

Android.bpD03-May-2024992 4741

CMake.READMED03-May-20241.7 KiB4336

CMakeLists.txtD03-May-20248 KiB237206

COPYINGD03-May-20241.1 KiB2218

ChangesD03-May-202429.8 KiB601558

ConfigureChecks.cmakeD03-May-20242.3 KiB7161

LICENSED03-May-20241.1 KiB2218

METADATAD03-May-2024379 1918

MODULE_LICENSE_MITD03-May-20240

Makefile.amD03-May-20244.5 KiB154108

Makefile.inD03-May-202432.4 KiB1,028892

NOTICED03-May-20241.1 KiB2218

OWNERSD03-May-202446 21

README.mdD03-May-20244.8 KiB12797

aclocal.m4D03-May-202441.3 KiB1,1581,052

configureD03-May-2024601.7 KiB19,91916,891

configure.acD03-May-20248.1 KiB265228

expat.pc.inD03-May-2024231 1210

expat.slnD03-May-20244.7 KiB7472

expat_config.hD03-May-20243.6 KiB13445

expat_config.h.cmakeD03-May-20243.4 KiB11880

expat_config.h.inD03-May-20243.1 KiB12382

run.sh.inD03-May-2024181 138

test-driver-wrapper.shD03-May-20241.8 KiB4410

CMake.README

1== How to build expat with cmake (experimental) ==
2
3The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual
4Studio) and should work on all other platform cmake supports.
5
6Assuming ~/expat-2.2.6 is the source directory of expat, add a subdirectory
7build and change into that directory:
8~/expat-2.2.6$ mkdir build && cd build
9~/expat-2.2.6/build$
10
11From that directory, call cmake first, then call make, make test and
12make install in the usual way:
13~/expat-2.2.6/build$ cmake ..
14-- The C compiler identification is GNU
15-- The CXX compiler identification is GNU
16....
17-- Configuring done
18-- Generating done
19-- Build files have been written to: /home/patrick/expat-2.2.6/build
20
21If you want to specify the install location for your files, append
22-DCMAKE_INSTALL_PREFIX=/your/install/path to the cmake call.
23
24~/expat-2.2.6/build$ make && make test && make install
25Scanning dependencies of target expat
26[  5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o
27[ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o
28....
29-- Installing: /usr/local/lib/pkgconfig/expat.pc
30-- Installing: /usr/local/bin/xmlwf
31-- Installing: /usr/local/share/man/man1/xmlwf.1
32
33For Windows builds, you must make sure to call cmake from an environment where
34your compiler is reachable, that means either you call it from the
35Visual Studio Command Prompt or when using mingw, you must open a cmd.exe and
36make sure that gcc can be called. On Windows, you also might want to specify a
37special Generator for CMake:
38for Visual Studio builds do:
39cmake .. -G "Visual Studio 10" && vcexpress expat.sln
40for mingw builds do:
41cmake .. -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=D:\expat-install
42    && gmake && gmake install
43

README.md

1[![Travis CI Build Status](https://travis-ci.org/libexpat/libexpat.svg?branch=master)](https://travis-ci.org/libexpat/libexpat)
2[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat)
3
4
5# Expat, Release 2.2.6
6
7This is Expat, a C library for parsing XML, started by
8[James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997.
9Expat is a stream-oriented XML parser.  This means that you register
10handlers with the parser before starting the parse.  These handlers
11are called when the parser discovers the associated structures in the
12document being parsed.  A start tag is an example of the kind of
13structures for which you may register handlers.
14
15Windows users should use the
16[`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/),
17which includes both precompiled libraries and executables, and source code for
18developers.
19
20Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html).
21You may copy, distribute, and modify it under the terms of the License
22contained in the file
23[`COPYING`](https://github.com/libexpat/libexpat/blob/master/expat/COPYING)
24distributed with this package.
25This license is the same as the MIT/X Consortium license.
26
27If you are building Expat from a check-out from the
28[Git repository](https://github.com/libexpat/libexpat/),
29you need to run a script that generates the configure script using the
30GNU autoconf and libtool tools.  To do this, you need to have
31autoconf 2.58 or newer. Run the script like this:
32
33```console
34./buildconf.sh
35```
36
37Once this has been done, follow the same instructions as for building
38from a source distribution.
39
40To build Expat from a source distribution, you first run the
41configuration shell script in the top level distribution directory:
42
43```console
44./configure
45```
46
47There are many options which you may provide to configure (which you
48can discover by running configure with the `--help` option).  But the
49one of most interest is the one that sets the installation directory.
50By default, the configure script will set things up to install
51libexpat into `/usr/local/lib`, `expat.h` into `/usr/local/include`, and
52`xmlwf` into `/usr/local/bin`.  If, for example, you'd prefer to install
53into `/home/me/mystuff/lib`, `/home/me/mystuff/include`, and
54`/home/me/mystuff/bin`, you can tell `configure` about that with:
55
56```console
57./configure --prefix=/home/me/mystuff
58```
59
60Another interesting option is to enable 64-bit integer support for
61line and column numbers and the over-all byte index:
62
63```console
64./configure CPPFLAGS=-DXML_LARGE_SIZE
65```
66
67However, such a modification would be a breaking change to the ABI
68and is therefore not recommended for general use — e.g. as part of
69a Linux distribution — but rather for builds with special requirements.
70
71After running the configure script, the `make` command will build
72things and `make install` will install things into their proper
73location.  Have a look at the `Makefile` to learn about additional
74`make` options.  Note that you need to have write permission into
75the directories into which things will be installed.
76
77If you are interested in building Expat to provide document
78information in UTF-16 encoding rather than the default UTF-8, follow
79these instructions (after having run `make distclean`).
80Please note that we configure with `--without-xmlwf` as xmlwf does not
81support this mode of compilation (yet):
82
831. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
84   <br/>
85   `find -name Makefile.am -exec sed
86       -e 's,libexpat\.la,libexpatw.la,'
87       -e 's,libexpat_la,libexpatw_la,'
88       -i {} +`
89
901. Run `automake` to re-write `Makefile.in` files:<br/>
91   `automake`
92
931. For UTF-16 output as unsigned short (and version/error strings as char),
94   run:<br/>
95   `./configure CPPFLAGS=-DXML_UNICODE --without-xmlwf`<br/>
96   For UTF-16 output as `wchar_t` (incl. version/error strings), run:<br/>
97   `./configure CFLAGS="-g -O2 -fshort-wchar" CPPFLAGS=-DXML_UNICODE_WCHAR_T
98       --without-xmlwf`
99   <br/>Note: The latter requires libc compiled with `-fshort-wchar`, as well.
100
1011. Run `make` (which excludes xmlwf).
102
1031. Run `make install` (again, excludes xmlwf).
104
105Using `DESTDIR` is supported.  It works as follows:
106
107```console
108make install DESTDIR=/path/to/image
109```
110
111overrides the in-makefile set `DESTDIR`, because variable-setting priority is
112
1131. commandline
1141. in-makefile
1151. environment
116
117Note: This only applies to the Expat library itself, building UTF-16 versions
118of xmlwf and the tests is currently not supported.
119
120When using Expat with a project using autoconf for configuration, you
121can use the probing macro in `conftools/expat.m4` to determine how to
122include Expat.  See the comments at the top of that file for more
123information.
124
125A reference manual is available in the file `doc/reference.html` in this
126distribution.
127