Rework configure code for libxml2 check

This commit is contained in:
David Raynor 2013-09-20 17:01:48 -04:00
parent e2c7428260
commit b09a05e4c3
21 changed files with 221 additions and 488 deletions

View file

@ -318,7 +318,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

189
aclocal.m4 vendored
View file

@ -20,195 +20,6 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# Configure paths for LIBXML2
# Mike Hommey 2004-06-19
# use CPPFLAGS instead of CFLAGS
# Toshio Kuratomi 2001-04-21
# Adapted from:
# Configure paths for GLIB
# Owen Taylor 97-11-3
dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
dnl
AC_DEFUN([AM_PATH_XML2],[
AC_ARG_WITH(xml-prefix,
[ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
xml_config_prefix="$withval", xml_config_prefix="")
AC_ARG_WITH(xml-exec-prefix,
[ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
AC_ARG_ENABLE(xmltest,
[ --disable-xmltest Do not try to compile and run a test LIBXML program],,
enable_xmltest=yes)
if test x$xml_config_exec_prefix != x ; then
xml_config_args="$xml_config_args"
if test x${XML2_CONFIG+set} != xset ; then
XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
fi
fi
if test x$xml_config_prefix != x ; then
xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
if test x${XML2_CONFIG+set} != xset ; then
XML2_CONFIG=$xml_config_prefix/bin/xml2-config
fi
fi
AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
min_xml_version=ifelse([$1], ,2.0.0,[$1])
AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
no_xml=""
if test "$XML2_CONFIG" = "no" ; then
no_xml=yes
else
XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_xmltest" = "xyes" ; then
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
LIBS="$XML_LIBS $LIBS"
dnl
dnl Now check if the installed libxml is sufficiently new.
dnl (Also sanity checks the results of xml2-config to some extent)
dnl
rm -f conf.xmltest
AC_TRY_RUN([
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libxml/xmlversion.h>
int
main()
{
int xml_major_version, xml_minor_version, xml_micro_version;
int major, minor, micro;
char *tmp_version;
system("touch conf.xmltest");
/* Capture xml2-config output via autoconf/configure variables */
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = (char *)strdup("$min_xml_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string from xml2-config\n", "$min_xml_version");
exit(1);
}
free(tmp_version);
/* Capture the version information from the header files */
tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
exit(1);
}
free(tmp_version);
/* Compare xml2-config output to the libxml headers */
if ((xml_major_version != $xml_config_major_version) ||
(xml_minor_version != $xml_config_minor_version) ||
(xml_micro_version != $xml_config_micro_version))
{
printf("*** libxml header files (version %d.%d.%d) do not match\n",
xml_major_version, xml_minor_version, xml_micro_version);
printf("*** xml2-config (version %d.%d.%d)\n",
$xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
return 1;
}
/* Compare the headers to the library to make sure we match */
/* Less than ideal -- doesn't provide us with return value feedback,
* only exits if there's a serious mismatch between header and library.
*/
LIBXML_TEST_VERSION;
/* Test that the library is greater than our minimum version */
if ((xml_major_version > major) ||
((xml_major_version == major) && (xml_minor_version > minor)) ||
((xml_major_version == major) && (xml_minor_version == minor) &&
(xml_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
xml_major_version, xml_minor_version, xml_micro_version);
printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
printf("*** correct copy of xml2-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
return 1;
}
],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_xml" = x ; then
AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$XML2_CONFIG" = "no" ; then
echo "*** The xml2-config script installed by LIBXML could not be found"
echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the XML2_CONFIG environment variable to the"
echo "*** full path to xml2-config."
else
if test -f conf.xmltest ; then
:
else
echo "*** Could not run libxml test program, checking why..."
CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
LIBS="$LIBS $XML_LIBS"
AC_TRY_LINK([
#include <libxml/xmlversion.h>
#include <stdio.h>
], [ LIBXML_TEST_VERSION; return 0;],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
XML_CPPFLAGS=""
XML_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(XML_CPPFLAGS)
AC_SUBST(XML_LIBS)
rm -f conf.xmltest
])
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
# Foundation, Inc.
#

View file

@ -87,6 +87,9 @@
/* "default FD_SETSIZE value" */
#undef DEFAULT_FD_SETSIZE
/* Define to 1 if xml supported features can be enabled. */
#undef ENABLE_XML
/* use fanotify */
#undef FANOTIFY

View file

@ -287,7 +287,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -223,7 +223,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -241,7 +241,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -254,7 +254,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -252,7 +252,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -258,7 +258,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -243,7 +243,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

406
configure vendored
View file

@ -668,9 +668,6 @@ CFGDIR
DBDIR
XML_LIBS
XML_CPPFLAGS
XML2_CONFIG
ENABLE_XML_FALSE
ENABLE_XML_TRUE
ENABLE_UNRAR_FALSE
ENABLE_UNRAR_TRUE
LIBBZ2_PREFIX
@ -860,9 +857,7 @@ enable_bzip2
with_libbz2_prefix
enable_unrar
enable_xml
with_xml_prefix
with_xml_exec_prefix
enable_xmltest
with_xml
enable_getaddrinfo
enable_ipv6
enable_dns
@ -1542,7 +1537,6 @@ Optional Features:
--disable-bzip2 disable bzip2 support
--disable-unrar do not build libclamunrar and libclamunrar_iface
--disable-xml disable DMG and XAR support
--disable-xmltest Do not try to compile and run a test LIBXML program
--disable-getaddrinfo disable support for getaddrinfo
--disable-ipv6 disable IPv6 support
--disable-dns disable support for database verification through
@ -1585,8 +1579,8 @@ Optional Packages:
/usr/local or /usr if not found in /usr/local)
--with-libbz2-prefix[=DIR] search for libbz2 in DIR/include and DIR/lib
--without-libbz2-prefix don't search for libbz2 in includedir and libdir
--with-xml-prefix=PFX Prefix where libxml is installed (optional)
--with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)
--with-xml=DIR path to directory containing libxml2 library (default=
/usr/local or /usr if not found in /usr/local)
--with-iconv supports iconv() (default=auto)
--with-user=uid name of the clamav user (default=clamav)
--with-group=gid name of the clamav group (default=clamav)
@ -17001,298 +16995,180 @@ else
fi
want_xml="yes"
want_xml="auto"
# Check whether --enable-xml was given.
if test "${enable_xml+set}" = set; then :
enableval=$enable_xml; want_xml=$enableval
else
want_xml="yes"
fi
if test "$want_xml" = "yes"; then
ENABLE_XML_TRUE=
ENABLE_XML_FALSE='#'
else
ENABLE_XML_TRUE='#'
ENABLE_XML_FALSE=
want_xml="auto"
fi
if test "$want_xml" = "yes"
then
working_xml="no"
if test "$want_xml" != "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml2 installation" >&5
$as_echo_n "checking for libxml2 installation... " >&6; }
# Check whether --with-xml-prefix was given.
if test "${with_xml_prefix+set}" = set; then :
withval=$with_xml_prefix; xml_config_prefix="$withval"
else
xml_config_prefix=""
fi
# Check whether --with-xml-exec-prefix was given.
if test "${with_xml_exec_prefix+set}" = set; then :
withval=$with_xml_exec_prefix; xml_config_exec_prefix="$withval"
else
xml_config_exec_prefix=""
fi
# Check whether --enable-xmltest was given.
if test "${enable_xmltest+set}" = set; then :
enableval=$enable_xmltest;
else
enable_xmltest=yes
fi
if test x$xml_config_exec_prefix != x ; then
xml_config_args="$xml_config_args"
if test x${XML2_CONFIG+set} != xset ; then
XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
fi
fi
if test x$xml_config_prefix != x ; then
xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
if test x${XML2_CONFIG+set} != xset ; then
XML2_CONFIG=$xml_config_prefix/bin/xml2-config
fi
# Check whether --with-xml was given.
if test "${with_xml+set}" = set; then :
withval=$with_xml;
if test "$withval"
then
XML_HOME="$withval"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using $XML_HOME" >&5
$as_echo "using $XML_HOME" >&6; }
fi
# Extract the first word of "xml2-config", so it can be a program name with args.
set dummy xml2-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_XML2_CONFIG+:} false; then :
else
XML_HOME=/usr/local
if test ! -f "$XML_HOME/include/libxml/xmlreader.h"
then
XML_HOME=/usr
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML_HOME" >&5
$as_echo "$XML_HOME" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** checking XML_HOME $XML_HOME ******" >&5
$as_echo "$as_me: WARNING: ****** checking XML_HOME $XML_HOME ******" >&2;}
if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** not found, cannot test ******" >&5
$as_echo "$as_me: WARNING: ****** not found, cannot test ******" >&2;}
if test "$want_xml" = "yes"; then
as_fn_error $? "Please install libxml2 packages" "$LINENO" 5
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** found, testing ******" >&5
$as_echo "$as_me: WARNING: ****** found, testing ******" >&2;}
save_LIBS="$LIBS"
if test "$XML_HOME" != "/usr"; then
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$XML_HOME/include"
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath $XML_HOME/lib"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlTextReaderRead in -lxml2" >&5
$as_echo_n "checking for xmlTextReaderRead in -lxml2... " >&6; }
if ${ac_cv_lib_xml2_xmlTextReaderRead+:} false; then :
$as_echo_n "(cached) " >&6
else
case $XML2_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_XML2_CONFIG" && ac_cv_path_XML2_CONFIG="no"
;;
esac
fi
XML2_CONFIG=$ac_cv_path_XML2_CONFIG
if test -n "$XML2_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
$as_echo "$XML2_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
min_xml_version=2.5.0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml - version >= $min_xml_version" >&5
$as_echo_n "checking for libxml - version >= $min_xml_version... " >&6; }
no_xml=""
if test "$XML2_CONFIG" = "no" ; then
no_xml=yes
else
XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
if test "x$enable_xmltest" = "xyes" ; then
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
LIBS="$XML_LIBS $LIBS"
rm -f conf.xmltest
if test "$cross_compiling" = yes; then :
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
ac_check_lib_save_LIBS=$LIBS
LIBS="-lxml2 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libxml/xmlversion.h>
int
main()
{
int xml_major_version, xml_minor_version, xml_micro_version;
int major, minor, micro;
char *tmp_version;
system("touch conf.xmltest");
/* Capture xml2-config output via autoconf/configure variables */
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = (char *)strdup("$min_xml_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string from xml2-config\n", "$min_xml_version");
exit(1);
}
free(tmp_version);
/* Capture the version information from the header files */
tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
exit(1);
}
free(tmp_version);
/* Compare xml2-config output to the libxml headers */
if ((xml_major_version != $xml_config_major_version) ||
(xml_minor_version != $xml_config_minor_version) ||
(xml_micro_version != $xml_config_micro_version))
{
printf("*** libxml header files (version %d.%d.%d) do not match\n",
xml_major_version, xml_minor_version, xml_micro_version);
printf("*** xml2-config (version %d.%d.%d)\n",
$xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
return 1;
}
/* Compare the headers to the library to make sure we match */
/* Less than ideal -- doesn't provide us with return value feedback,
* only exits if there's a serious mismatch between header and library.
*/
LIBXML_TEST_VERSION;
/* Test that the library is greater than our minimum version */
if ((xml_major_version > major) ||
((xml_major_version == major) && (xml_minor_version > minor)) ||
((xml_major_version == major) && (xml_minor_version == minor) &&
(xml_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
xml_major_version, xml_minor_version, xml_micro_version);
printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
printf("*** correct copy of xml2-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
return 1;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
else
no_xml=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_xml" = x ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&5
$as_echo "yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)" >&6; }
:
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if test "$XML2_CONFIG" = "no" ; then
echo "*** The xml2-config script installed by LIBXML could not be found"
echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the XML2_CONFIG environment variable to the"
echo "*** full path to xml2-config."
else
if test -f conf.xmltest ; then
:
else
echo "*** Could not run libxml test program, checking why..."
CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
LIBS="$LIBS $XML_LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <libxml/xmlversion.h>
#include <stdio.h>
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char xmlTextReaderRead ();
int
main ()
{
LIBXML_TEST_VERSION; return 0;
return xmlTextReaderRead ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
ac_cv_lib_xml2_xmlTextReaderRead=yes
else
echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
echo "*** may want to edit the xml2-config script: $XML2_CONFIG"
ac_cv_lib_xml2_xmlTextReaderRead=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlTextReaderRead" >&5
$as_echo "$ac_cv_lib_xml2_xmlTextReaderRead" >&6; }
if test "x$ac_cv_lib_xml2_xmlTextReaderRead" = xyes; then :
working_xml="yes";XML_CPPFLAGS="-I/usr/include/libxml2";XML_LIBS="-Wl,-rpath $XML_HOME/lib -lxml2"
else
working_xml="no"
fi
XML_CPPFLAGS=""
XML_LIBS=""
:
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlTextReaderRead in -lxml2" >&5
$as_echo_n "checking for xmlTextReaderRead in -lxml2... " >&6; }
if ${ac_cv_lib_xml2_xmlTextReaderRead+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lxml2 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char xmlTextReaderRead ();
int
main ()
{
return xmlTextReaderRead ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_xml2_xmlTextReaderRead=yes
else
ac_cv_lib_xml2_xmlTextReaderRead=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlTextReaderRead" >&5
$as_echo "$ac_cv_lib_xml2_xmlTextReaderRead" >&6; }
if test "x$ac_cv_lib_xml2_xmlTextReaderRead" = xyes; then :
working_xml="yes";XML_CPPFLAGS="-I/usr/include/libxml2";XML_LIBS="-lxml2"
else
working_xml="no"
fi
fi
LIBS="$save_LIBS"
fi
fi
rm -f conf.xmltest
if test "$working_xml" = "yes"; then
$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h
$as_echo "#define ENABLE_XML 1" >>confdefs.h
else
XML_CPPFLAGS=""
XML_LIBS=""
if test "$want_xml" = "yes"; then
as_fn_error $? "Please install libxml2 packages" "$LINENO" 5
fi
XML_CPPFLAGS=""
XML_LIBS=""
$as_echo "#define HAVE_LIBXML2 0" >>confdefs.h
$as_echo "#define ENABLE_XML 0" >>confdefs.h
fi
# Check whether --enable-getaddrinfo was given.
if test "${enable_getaddrinfo+set}" = set; then :
enableval=$enable_getaddrinfo; want_getaddrinfo=$enableval
@ -21417,10 +21293,6 @@ if test -z "${ENABLE_UNRAR_TRUE}" && test -z "${ENABLE_UNRAR_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_UNRAR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_XML_TRUE}" && test -z "${ENABLE_XML_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_XML\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${BUILD_CLAMD_TRUE}" && test -z "${BUILD_CLAMD_FALSE}"; then
as_fn_error $? "conditional \"BUILD_CLAMD\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -24029,10 +23901,6 @@ if test -z "${ENABLE_UNRAR_TRUE}" && test -z "${ENABLE_UNRAR_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_UNRAR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_XML_TRUE}" && test -z "${ENABLE_XML_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_XML\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${BUILD_CLAMD_TRUE}" && test -z "${BUILD_CLAMD_FALSE}"; then
as_fn_error $? "conditional \"BUILD_CLAMD\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View file

@ -653,24 +653,92 @@ AC_ARG_ENABLE([unrar],
want_unrar=$enableval, want_unrar="yes")
AM_CONDITIONAL([ENABLE_UNRAR],[test "$want_unrar" = "yes"])
want_xml="yes"
want_xml="auto"
AC_ARG_ENABLE([xml],
[ --disable-xml disable DMG and XAR support],
want_xml=$enableval, want_xml="yes")
AM_CONDITIONAL([ENABLE_XML],[test "$want_xml" = "yes"])
want_xml=$enableval, want_xml="auto")
if test "$want_xml" = "yes"
then
AM_PATH_XML2(2.5.0)
AC_DEFINE([HAVE_LIBXML2],1,[Define to 1 if you have the 'libxml2' library (-lxml2).])
else
XML_CPPFLAGS=""
XML_LIBS=""
AC_SUBST(XML_CPPFLAGS)
AC_SUBST(XML_LIBS)
AC_DEFINE([HAVE_LIBXML2],0,[Define to 1 if you have the 'libxml2' library (-lxml2).])
working_xml="no"
if test "$want_xml" != "no"; then
AC_MSG_CHECKING([for libxml2 installation])
AC_ARG_WITH([xml],
[ --with-xml=DIR path to directory containing libxml2 library (default=
/usr/local or /usr if not found in /usr/local)],
[
if test "$withval"
then
XML_HOME="$withval"
AC_MSG_RESULT([using $XML_HOME])
fi
], [
XML_HOME=/usr/local
if test ! -f "$XML_HOME/include/libxml/xmlreader.h"
then
XML_HOME=/usr
fi
AC_MSG_RESULT([$XML_HOME])
])
AC_MSG_WARN([****** checking XML_HOME $XML_HOME ******])
if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then
AC_MSG_WARN([****** not found, cannot test ******])
if test "$want_xml" = "yes"; then
AC_MSG_ERROR([Please install libxml2 packages])
fi
else
AC_MSG_WARN([****** found, testing ******])
save_LIBS="$LIBS"
if test "$XML_HOME" != "/usr"; then
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$XML_HOME/include"
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-rpath $XML_HOME/lib"
AC_CHECK_LIB([xml2], [xmlTextReaderRead], [working_xml="yes";XML_CPPFLAGS="-I/usr/include/libxml2";XML_LIBS="-Wl,-rpath $XML_HOME/lib -lxml2"], working_xml="no")
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
else
AC_CHECK_LIB([xml2], [xmlTextReaderRead], [working_xml="yes";XML_CPPFLAGS="-I/usr/include/libxml2";XML_LIBS="-lxml2"], working_xml="no")
fi
LIBS="$save_LIBS"
fi
fi
if test "$working_xml" = "yes"; then
AC_DEFINE([HAVE_LIBXML2],1,[Define to 1 if you have the 'libxml2' library (-lxml2).])
AC_DEFINE([ENABLE_XML],1,[Define to 1 if xml supported features can be enabled.])
AC_SUBST(XML_CPPFLAGS)
AC_SUBST(XML_LIBS)
else
if test "$want_xml" = "yes"; then
AC_MSG_ERROR([Please install libxml2 packages])
fi
XML_CPPFLAGS=""
XML_LIBS=""
AC_SUBST(XML_CPPFLAGS)
AC_SUBST(XML_LIBS)
AC_DEFINE([HAVE_LIBXML2],0,[Define to 1 if you have the 'libxml2' library (-lxml2).])
AC_DEFINE([ENABLE_XML],0,[Define to 1 if xml supported features can be enabled.])
fi
dnl want_xml="yes"
dnl AC_ARG_ENABLE([xml],
dnl [ --disable-xml disable DMG and XAR support],
dnl want_xml=$enableval, want_xml="yes")
dnl AM_CONDITIONAL([ENABLE_XML],[test "$want_xml" = "yes"])
dnl if test "$want_xml" = "yes"
dnl then
dnl AM_PATH_XML2(2.5.0)
dnl AC_DEFINE([HAVE_LIBXML2],1,[Define to 1 if you have the 'libxml2' library (-lxml2).])
dnl else
dnl XML_CPPFLAGS=""
dnl XML_LIBS=""
dnl AC_SUBST(XML_CPPFLAGS)
dnl AC_SUBST(XML_LIBS)
dnl AC_DEFINE([HAVE_LIBXML2],0,[Define to 1 if you have the 'libxml2' library (-lxml2).])
dnl fi
AC_ARG_ENABLE([getaddrinfo],
[ --disable-getaddrinfo disable support for getaddrinfo],
want_getaddrinfo=$enableval, want_getaddrinfo="yes")

View file

@ -209,7 +209,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -242,7 +242,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -239,7 +239,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -245,7 +245,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -508,7 +508,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -321,7 +321,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -242,7 +242,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -190,7 +190,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@

View file

@ -375,7 +375,6 @@ VERSION = @VERSION@
VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@
WERR_CFLAGS = @WERR_CFLAGS@
WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@
XML2_CONFIG = @XML2_CONFIG@
XML_CPPFLAGS = @XML_CPPFLAGS@
XML_LIBS = @XML_LIBS@
abs_builddir = @abs_builddir@