I am trying to fix an error in libxml2. I can not compile it using --with-icuwhen using --prefix=/Server/software. I sent an error report here, but I need to collect it to resolve the conflict when compiling PHP with intl support. I suspect this is a problem with the Makefile. My experience with Makefile is limited. The desired result is a correction that can be sent to the related error report.
The flag --with-icuinvokes the definition LIBXML_ICU_ENABLED. The included code should resolve the conflict when including headers from both icu and libxml2 (in particular, both use UChar). The PHP activated plug-in module activated with --enable-intlicu is required. libxml2 is required by PHP for DOM / XML functions.
There are two problems.
First this config:
./configure --prefix=/Server/software --enable-shared --enable-static --with-icu
Results in:
configure: error: libicu config program icu-config not found
This is due to this code in the configure.in file:
WITH_ICU=0
if test "$with_icu" != "yes" ; then
echo Disabling ICU support
else
ICU_CONFIG=icu-config
if ${ICU_CONFIG} --cflags >/dev/null 2>&1
then
ICU_LIBS=`icu-config --ldflags`
LDFLAGS="$LDFLAGS $ICU_LIBS"
WITH_ICU=1
echo Enabling ICU support
else
AC_MSG_ERROR([libicu config program icu-config not found])
fi
fi
In particular, ICUCONFIG=icu-configdoes not comply --prefix=/Server/software. I can get around this by doing export PATH=/Server/software/bin:$PATH.
This "fixes" the problem. / configure.
Secondly, when I run make, I get errors, the most suitable of which:
./include/libxml/encoding.h:31:26: error: unicode/ucnv.h: No such file or
directory
The file unicode/uncv.his located at /Server/software/include/unicode/uncv.h. I suspect that the compiler is looking for this file in the local directory and in the / usr directory.
This is what the error refers to:
#ifdef LIBXML_ICU_ENABLED
#include <unicode/ucnv.h>
#endif
, --with-icu --prefix=/Server/software. --with-icu , UChar PHP icu libxml2.
icu-config --cflags :
-O2 -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long
/dev/null.
icu-config --ldflags :
-lpthread -lm -L/Server/software/lib -licui18n -licuuc -licudata -lpthread -lm
?