2010-03-10 10:35:56 +01:00
See also the generic INSTALL file for configure options
Compilation
2021-04-25 21:19:59 +02:00
1. What is the process to compile libxml?
2010-03-10 10:35:56 +01:00
As most UNIX libraries libxml follows the "standard":
2021-04-25 21:19:59 +02:00
gunzip -c xxx.tar.gz | tar xvf -
cd libxml-xxxx
2010-03-10 10:35:56 +01:00
2021-04-25 21:19:59 +02:00
./configure --help
2010-03-10 10:35:56 +01:00
to see the options, then the compilation/installation proper
2021-04-25 21:19:59 +02:00
./configure [possible options]
make
make install
2010-03-10 10:35:56 +01:00
At that point you may have to rerun ldconfig or similar utility to
update your list of installed shared libs.
2020-03-08 17:19:42 +01:00
At this point you can check that the library is properly functioning
2010-03-10 10:35:56 +01:00
by running
2021-04-25 21:19:59 +02:00
make check
Please report test failures to the mailing list or bug tracker.
2010-03-10 10:35:56 +01:00
2021-05-16 17:48:07 +02:00
Another option for compiling libxml is using CMake:
cmake -E tar xf libxml2-xxx.tar.gz
cmake -S libxml2-xxx -B libxml2-xxx-build [possible options]
cmake --build libxml2-xxx-build
cmake --install libxml2-xxx-build
Common CMake options include:
-D BUILD_SHARED_LIBS=OFF # build static libraries
-D CMAKE_BUILD_TYPE=Release # specify build type
-D CMAKE_INSTALL_PREFIX=/usr/local # specify the install path
-D LIBXML2_WITH_ICONV=OFF # disable iconv
-D LIBXML2_WITH_LZMA=OFF # disable liblzma
-D LIBXML2_WITH_PYTHON=OFF # disable Python
-D LIBXML2_WITH_ZLIB=OFF # disable libz
You can also open the libxml source directory with its CMakeLists.txt
directly in various IDEs such as CLion, QtCreator, or Visual Studio.
2021-04-25 21:19:59 +02:00
2. What other libraries are needed to compile/install libxml?
2010-03-10 10:35:56 +01:00
2021-04-25 21:19:59 +02:00
Libxml does not require any other libraries. A platform with somewhat
recent POSIX support should be sufficient (please report any violation
to this rule you may find).
2010-03-10 10:35:56 +01:00
2021-04-25 21:19:59 +02:00
However if found at configuration time, libxml will detect and use
2010-03-10 10:35:56 +01:00
the following libs:
2021-04-25 21:19:59 +02:00
libz: a highly portable and widely available compression library
https://zlib.net/
liblzma: another compression library
https://tukaani.org/xz/
2010-03-10 10:35:56 +01:00
iconv: a powerful character encoding conversion library. It's
2021-04-25 21:19:59 +02:00
part of POSIX.1-2001, so it doesn't need to be installed
on modern UNIX-like systems, specifically on Linux.
https://www.gnu.org/software/libiconv/
ICU: Mainly used by Chromium on Windows. Unnecessary on most
systems.
2010-03-10 10:35:56 +01:00
Daniel
veillard@redhat.com