linuxcompilationlibxml2

How to compile libxml2 without two level folder libxml2/libxml in include


I am compiling libxml2 with the next setup:

function libxml() {
    wget -O - https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.5.tar.xz | tar --strip-components 1 -xJ
    ./configure CPPFLAGS="-I$LIB_INCLUDE" LDFLAGS="-L$LIB_LIBRARY" --prefix=$PHPEXT_DIR_PACKAGES --with-reader --with-regexps --with-schemas --with-threads --with-tree --with-writer --with-output --with-iconv --with-zlib --with-html --with-http --with-lzma --without-python --with-minimum
    make && make install
}

but when i look the folder include, appear the next tree include/libxml2/libxml, this will create an issue for example compiling php-xml (Writer,Reader) fail with libxml/parses.h, not matter if I add LIBXML_CFLAGS="$LIB_INCLUDE/libxml2/libxml", directly saying where to look for the file.

What can I do?

Thank you beforehand.


Solution

  • Looks like libxml2 since 2.12 change the hier of the directory so php source when compiling can't find it, so in php 8.2.14 it will be fix this issue, meanwhile use a lower version of libxml2 < 2.12.