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