• Home
Name Date Size #Lines LOC

..--

cmake/03-May-2024-11398

conftools/03-May-2024-17,39913,107

doc/03-May-2024-3,8663,368

examples/03-May-2024-914663

lib/03-May-2024-15,59212,311

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

patches/03-May-2024-4234

tests/03-May-2024-15,02012,068

win32/03-May-2024-241193

xmlwf/03-May-2024-3,4342,564

.gitignoreD03-May-2024360 3837

AUTHORSD03-May-2024142 119

Android.bpD03-May-20241.1 KiB5245

CMake.READMED03-May-20241.7 KiB4336

CMakeLists.txtD03-May-202420 KiB591529

COPYINGD03-May-20241.1 KiB2218

ChangesD03-May-202437.7 KiB757705

ConfigureChecks.cmakeD03-May-20242.1 KiB6758

LICENSED03-May-20241.1 KiB2218

METADATAD03-May-2024380 1918

MODULE_LICENSE_MITD03-May-20240

Makefile.amD03-May-20244.7 KiB155107

Makefile.inD03-May-202433.2 KiB1,035898

NOTICED03-May-20241.1 KiB2218

OWNERSD03-May-202446 21

README.mdD03-May-20246.6 KiB189140

acinclude.m4D03-May-2024371 1310

aclocal.m4D03-May-202443 KiB1,2021,093

configureD03-May-2024632.7 KiB21,16717,864

configure.acD03-May-202411.3 KiB320277

expat.pc.inD03-May-2024231 1210

expat_config.hD03-May-20244 KiB14451

expat_config.h.cmakeD03-May-20243.3 KiB11679

expat_config.h.inD03-May-20243.4 KiB13392

fix-xmltest-log.shD03-May-20242.1 KiB4915

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.9 is the source directory of expat, add a subdirectory
7build and change into that directory:
8~/expat-2.2.9$ mkdir build && cd build
9~/expat-2.2.9/build$
10
11From that directory, call cmake first, then call make, make test and
12make install in the usual way:
13~/expat-2.2.9/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.9/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.9/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 15 2017" && msbuild /m 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[![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions)
4
5
6# Expat, Release 2.2.9
7
8This is Expat, a C library for parsing XML, started by
9[James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997.
10Expat is a stream-oriented XML parser.  This means that you register
11handlers with the parser before starting the parse.  These handlers
12are called when the parser discovers the associated structures in the
13document being parsed.  A start tag is an example of the kind of
14structures for which you may register handlers.
15
16Expat supports the following compilers:
17- GNU GCC >=4.5
18- LLVM Clang >=3.5
19- Microsoft Visual Studio >=8.0/2005
20
21Windows users should use the
22[`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/),
23which includes both precompiled libraries and executables, and source code for
24developers.
25
26Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html).
27You may copy, distribute, and modify it under the terms of the License
28contained in the file
29[`COPYING`](https://github.com/libexpat/libexpat/blob/master/expat/COPYING)
30distributed with this package.
31This license is the same as the MIT/X Consortium license.
32
33If you are building Expat from a check-out from the
34[Git repository](https://github.com/libexpat/libexpat/),
35you need to run a script that generates the configure script using the
36GNU autoconf and libtool tools.  To do this, you need to have
37autoconf 2.58 or newer. Run the script like this:
38
39```console
40./buildconf.sh
41```
42
43Once this has been done, follow the same instructions as for building
44from a source distribution.
45
46To build Expat from a source distribution, you first run the
47configuration shell script in the top level distribution directory:
48
49```console
50./configure
51```
52
53There are many options which you may provide to configure (which you
54can discover by running configure with the `--help` option).  But the
55one of most interest is the one that sets the installation directory.
56By default, the configure script will set things up to install
57libexpat into `/usr/local/lib`, `expat.h` into `/usr/local/include`, and
58`xmlwf` into `/usr/local/bin`.  If, for example, you'd prefer to install
59into `/home/me/mystuff/lib`, `/home/me/mystuff/include`, and
60`/home/me/mystuff/bin`, you can tell `configure` about that with:
61
62```console
63./configure --prefix=/home/me/mystuff
64```
65
66Another interesting option is to enable 64-bit integer support for
67line and column numbers and the over-all byte index:
68
69```console
70./configure CPPFLAGS=-DXML_LARGE_SIZE
71```
72
73However, such a modification would be a breaking change to the ABI
74and is therefore not recommended for general use — e.g. as part of
75a Linux distribution — but rather for builds with special requirements.
76
77After running the configure script, the `make` command will build
78things and `make install` will install things into their proper
79location.  Have a look at the `Makefile` to learn about additional
80`make` options.  Note that you need to have write permission into
81the directories into which things will be installed.
82
83If you are interested in building Expat to provide document
84information in UTF-16 encoding rather than the default UTF-8, follow
85these instructions (after having run `make distclean`).
86Please note that we configure with `--without-xmlwf` as xmlwf does not
87support this mode of compilation (yet):
88
891. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
90   <br/>
91   `find -name Makefile.am -exec sed
92       -e 's,libexpat\.la,libexpatw.la,'
93       -e 's,libexpat_la,libexpatw_la,'
94       -i {} +`
95
961. Run `automake` to re-write `Makefile.in` files:<br/>
97   `automake`
98
991. For UTF-16 output as unsigned short (and version/error strings as char),
100   run:<br/>
101   `./configure CPPFLAGS=-DXML_UNICODE --without-xmlwf`<br/>
102   For UTF-16 output as `wchar_t` (incl. version/error strings), run:<br/>
103   `./configure CFLAGS="-g -O2 -fshort-wchar" CPPFLAGS=-DXML_UNICODE_WCHAR_T
104       --without-xmlwf`
105   <br/>Note: The latter requires libc compiled with `-fshort-wchar`, as well.
106
1071. Run `make` (which excludes xmlwf).
108
1091. Run `make install` (again, excludes xmlwf).
110
111Using `DESTDIR` is supported.  It works as follows:
112
113```console
114make install DESTDIR=/path/to/image
115```
116
117overrides the in-makefile set `DESTDIR`, because variable-setting priority is
118
1191. commandline
1201. in-makefile
1211. environment
122
123Note: This only applies to the Expat library itself, building UTF-16 versions
124of xmlwf and the tests is currently not supported.
125
126When using Expat with a project using autoconf for configuration, you
127can use the probing macro in `conftools/expat.m4` to determine how to
128include Expat.  See the comments at the top of that file for more
129information.
130
131A reference manual is available in the file `doc/reference.html` in this
132distribution.
133
134
135The CMake build system is still *experimental* and will replace the primary
136build system based on GNU Autotools at some point when it is ready.
137For an idea of the available (non-advanced) options for building with CMake:
138
139```console
140# rm -f CMakeCache.txt ; cmake -D_EXPAT_HELP=ON -LH . | grep -B1 ':.*=' | sed 's,^--$,,'
141// Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...
142CMAKE_BUILD_TYPE:STRING=
143
144// Install path prefix, prepended onto install directories.
145CMAKE_INSTALL_PREFIX:PATH=/usr/local
146
147// Path to a program.
148DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man
149
150// build man page for xmlwf
151EXPAT_BUILD_DOCS:BOOL=ON
152
153// build the examples for expat library
154EXPAT_BUILD_EXAMPLES:BOOL=ON
155
156// build fuzzers for the expat library
157EXPAT_BUILD_FUZZERS:BOOL=OFF
158
159// build the tests for expat library
160EXPAT_BUILD_TESTS:BOOL=ON
161
162// build the xmlwf tool for expat library
163EXPAT_BUILD_TOOLS:BOOL=ON
164
165// Character type to use (char|ushort|wchar_t) [default=char]
166EXPAT_CHAR_TYPE:STRING=char
167
168// install expat files in cmake install target
169EXPAT_ENABLE_INSTALL:BOOL=ON
170
171// Use /MT flag (static CRT) when compiling in MSVC
172EXPAT_MSVC_STATIC_CRT:BOOL=OFF
173
174// build a shared expat library
175EXPAT_SHARED_LIBS:BOOL=ON
176
177// Treat all compiler warnings as errors
178EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF
179
180// Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]
181EXPAT_WITH_GETRANDOM:STRING=AUTO
182
183// utilize libbsd (for arc4random_buf)
184EXPAT_WITH_LIBBSD:BOOL=OFF
185
186// Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]
187EXPAT_WITH_SYS_GETRANDOM:STRING=AUTO
188```
189