1 | # libxml2
|
---|
2 |
|
---|
3 | libxml2 is an XML toolkit implemented in C, originally developed for
|
---|
4 | the GNOME Project.
|
---|
5 |
|
---|
6 | Full documentation is available at
|
---|
7 | <https://gitlab.gnome.org/GNOME/libxml2/-/wikis>.
|
---|
8 |
|
---|
9 | Bugs should be reported at
|
---|
10 | <https://gitlab.gnome.org/GNOME/libxml2/-/issues>.
|
---|
11 |
|
---|
12 | A mailing list xml@gnome.org is available. You can subscribe at
|
---|
13 | <https://mail.gnome.org/mailman/listinfo/xml>. The list archive is at
|
---|
14 | <https://mail.gnome.org/archives/xml/>.
|
---|
15 |
|
---|
16 | ## License
|
---|
17 |
|
---|
18 | This code is released under the MIT License, see the Copyright file.
|
---|
19 |
|
---|
20 | ## Build instructions
|
---|
21 |
|
---|
22 | libxml2 can be built with GNU Autotools, CMake, or several other build
|
---|
23 | systems in platform-specific subdirectories.
|
---|
24 |
|
---|
25 | ### Autotools (for POSIX systems like Linux, BSD, macOS)
|
---|
26 |
|
---|
27 | If you build from a Git tree, you have to install Autotools and start
|
---|
28 | by generating the configuration files with:
|
---|
29 |
|
---|
30 | ./autogen.sh
|
---|
31 |
|
---|
32 | If you build from a source tarball, extract the archive with:
|
---|
33 |
|
---|
34 | tar xf libxml2-xxx.tar.gz
|
---|
35 | cd libxml2-xxx
|
---|
36 |
|
---|
37 | To see a list of build options:
|
---|
38 |
|
---|
39 | ./configure --help
|
---|
40 |
|
---|
41 | Also see the INSTALL file for additional instructions. Then you can
|
---|
42 | configure and build the library:
|
---|
43 |
|
---|
44 | ./configure [possible options]
|
---|
45 | make
|
---|
46 |
|
---|
47 | Now you can run the test suite with:
|
---|
48 |
|
---|
49 | make check
|
---|
50 |
|
---|
51 | Please report test failures to the mailing list or bug tracker.
|
---|
52 |
|
---|
53 | Then you can install the library:
|
---|
54 |
|
---|
55 | make install
|
---|
56 |
|
---|
57 | At that point you may have to rerun ldconfig or a similar utility to
|
---|
58 | update your list of installed shared libs.
|
---|
59 |
|
---|
60 | ### CMake (mainly for Windows)
|
---|
61 |
|
---|
62 | Another option for compiling libxml is using CMake:
|
---|
63 |
|
---|
64 | cmake -E tar xf libxml2-xxx.tar.gz
|
---|
65 | cmake -S libxml2-xxx -B libxml2-xxx-build [possible options]
|
---|
66 | cmake --build libxml2-xxx-build
|
---|
67 | cmake --install libxml2-xxx-build
|
---|
68 |
|
---|
69 | Common CMake options include:
|
---|
70 |
|
---|
71 | -D BUILD_SHARED_LIBS=OFF # build static libraries
|
---|
72 | -D CMAKE_BUILD_TYPE=Release # specify build type
|
---|
73 | -D CMAKE_INSTALL_PREFIX=/usr/local # specify the install path
|
---|
74 | -D LIBXML2_WITH_ICONV=OFF # disable iconv
|
---|
75 | -D LIBXML2_WITH_LZMA=OFF # disable liblzma
|
---|
76 | -D LIBXML2_WITH_PYTHON=OFF # disable Python
|
---|
77 | -D LIBXML2_WITH_ZLIB=OFF # disable libz
|
---|
78 |
|
---|
79 | You can also open the libxml source directory with its CMakeLists.txt
|
---|
80 | directly in various IDEs such as CLion, QtCreator, or Visual Studio.
|
---|
81 |
|
---|
82 | ## Dependencies
|
---|
83 |
|
---|
84 | Libxml does not require any other libraries. A platform with somewhat
|
---|
85 | recent POSIX support should be sufficient (please report any violation
|
---|
86 | to this rule you may find).
|
---|
87 |
|
---|
88 | However, if found at configuration time, libxml will detect and use
|
---|
89 | the following libraries:
|
---|
90 |
|
---|
91 | - [libz](https://zlib.net/), a highly portable and widely available
|
---|
92 | compression library.
|
---|
93 | - [liblzma](https://tukaani.org/xz/), another compression library.
|
---|
94 | - [libiconv](https://www.gnu.org/software/libiconv/), a character encoding
|
---|
95 | conversion library. The iconv function is part of POSIX.1-2001, so
|
---|
96 | libiconv isn't required on modern UNIX-like systems like Linux, BSD or
|
---|
97 | macOS.
|
---|
98 | - [ICU](https://icu.unicode.org/), a Unicode library. Mainly useful as an
|
---|
99 | alternative to iconv on Windows. Unnecessary on most other systems.
|
---|
100 |
|
---|
101 | ## Contributing
|
---|
102 |
|
---|
103 | The current version of the code can be found in GNOME's GitLab at
|
---|
104 | at <https://gitlab.gnome.org/GNOME/libxml2>. The best way to get involved
|
---|
105 | is by creating issues and merge requests on GitLab. Alternatively, you can
|
---|
106 | start discussions and send patches to the mailing list. If you want to
|
---|
107 | work with patches, please format them with git-format-patch and use plain
|
---|
108 | text attachments.
|
---|
109 |
|
---|
110 | All code must conform to C89 and pass the GitLab CI tests. Add regression
|
---|
111 | tests if possible.
|
---|
112 |
|
---|
113 | ## Authors
|
---|
114 |
|
---|
115 | - Daniel Veillard
|
---|
116 | - Bjorn Reese
|
---|
117 | - William Brack
|
---|
118 | - Igor Zlatkovic for the Windows port
|
---|
119 | - Aleksey Sanin
|
---|
120 | - Nick Wellnhofer
|
---|
121 |
|
---|