# Copyright (C) 2001-2025 Zabbix SIA
# This program is free software: you can redistribute it and/or modify it under the terms of
# the GNU Affero General Public License as published by the Free Software Foundation, version 3.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
AC_DEFUN([LIBXML2_CHECK_CONFIG],
If you want to use XML library:
AS_HELP_STRING([--with-libxml2@<:@=ARG@:>@],
[use libxml2 client library @<:@default=no@:>@, see PKG_CONFIG_PATH environment variable to specify .pc file location]
if test "$withval" = "no"; then
elif test "$withval" = "yes"; then
dnl Check libxml2 libraries
if test "$want_libxml2" = "yes"; then
if test "$_libxml2_with" != "yes"; then
XML2_INCDIR=$_libxml2_with/include/libxml2
XML2_LIBDIR=$_libxml2_with/lib
LIBXML2_CFLAGS="-I$XML2_INCDIR"
LIBXML2_LDFLAGS="-L$XML2_LIBDIR"
_full_libxml2_libs=$LIBXML2_LDFLAGS
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG()], [:])
if test -x "$PKG_CONFIG"; then
LIBXML2_CFLAGS="`$PKG_CONFIG --cflags libxml-2.0`"