Introduction to libxml2
The libxml2 package contains
libraries and utilities used for parsing XML files.
This package is known to build and work properly using an LFS-7.7
platform.
Package Information
Additional Downloads
libxml2 Dependencies
Recommended
Python-2.7.9 or Python-3.4.2 (to build and
install a Python library module,
additionally it is required to run the full suite of tests)
Note
Some packages which utilize libxml2 (such as GNOME Doc Utils) need the Python module installed to function properly
and some packages will not build properly if the Python module is not available.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/libxml2
Installation of libxml2
Apply two upstream fixes, which correct bugs in xmlcatalog and in the entity
substitution mechanism:
sed \
-e /xmlInitializeCatalog/d \
-e 's/((ent->checked =.*&&/(((ent->checked == 0) ||\
((ent->children == NULL) \&\& (ctxt->options \& XML_PARSE_NOENT))) \&\&/' \
-i parser.c
Install libxml2 by running the
following commands:
./configure --prefix=/usr --disable-static --with-history &&
make
If you downloaded the testsuite, issue the following command:
tar xf ../xmlts20130923.tar.gz
To test the results, issue: make
check > ../check.log. A summary of the results
can be obtained with grep -E
'^Total|expected' ../check.log.
Now, as the root
user:
make install
Command Explanations
--disable-static
: This
switch prevents installation of static versions of the libraries.
--with-history
: This switch
enables Readline support when
running xmlcatalog or
xmllint in shell
mode.
--with-python=/usr/bin/python3
: Add
this switch if you want libxml2 to use Python3 instead of Python2.