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