Use pkg-config to detect libxml2

This commit is contained in:
Tatsuhiro Tsujikawa 2016-12-18 00:20:30 +09:00
parent 0c76cebbfc
commit cab0a76795
2 changed files with 9 additions and 12 deletions

View File

@ -396,15 +396,12 @@ else
fi fi
# libxml2 (for src/nghttp) # libxml2 (for src/nghttp)
have_libxml2=no PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.7.7],
if test "x${request_libxml2}" != "xno"; then [have_libxml2=yes], [have_libxml2=no])
m4_ifdef([AM_PATH_XML2],
[AM_PATH_XML2(2.7.7, [have_libxml2=yes], [have_libxml2=no])],
[AC_MSG_WARN([configure was created without libxml2 detection macro; libxml2 detection is disabled])])
if test "x${have_libxml2}" = "xyes"; then if test "x${have_libxml2}" = "xyes"; then
AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have `libxml2` library.]) AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have `libxml2` library.])
fi else
AC_MSG_NOTICE($LIBXML2_PKG_ERRORS)
fi fi
if test "x${request_libxml2}" = "xyes" && if test "x${request_libxml2}" = "xyes" &&
@ -909,7 +906,7 @@ AC_MSG_NOTICE([summary of build options:
Failmalloc: ${enable_failmalloc} Failmalloc: ${enable_failmalloc}
Libs: Libs:
OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}') OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}')
Libxml2: ${have_libxml2} (CFLAGS='${XML_CPPFLAGS}' LIBS='${XML_LIBS}') Libxml2: ${have_libxml2} (CFLAGS='${LIBXML2_CPPFLAGS}' LIBS='${LIBXML2_LIBS}')
Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}') Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}')
Libc-ares ${have_libcares} (CFLAGS='${LIBCARES_CFLAGS}' LIBS='${LIBCARES_LIBS}') Libc-ares ${have_libcares} (CFLAGS='${LIBCARES_CFLAGS}' LIBS='${LIBCARES_LIBS}')
Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}') Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}')

View File

@ -41,7 +41,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/includes \ -I$(top_srcdir)/src/includes \
-I$(top_srcdir)/third-party \ -I$(top_srcdir)/third-party \
@LIBSPDYLAY_CFLAGS@ \ @LIBSPDYLAY_CFLAGS@ \
@XML_CPPFLAGS@ \ @LIBXML2_CFLAGS@ \
@LIBEV_CFLAGS@ \ @LIBEV_CFLAGS@ \
@OPENSSL_CFLAGS@ \ @OPENSSL_CFLAGS@ \
@LIBCARES_CFLAGS@ \ @LIBCARES_CFLAGS@ \
@ -53,7 +53,7 @@ LDADD = $(top_builddir)/lib/libnghttp2.la \
$(top_builddir)/third-party/libhttp-parser.la \ $(top_builddir)/third-party/libhttp-parser.la \
@JEMALLOC_LIBS@ \ @JEMALLOC_LIBS@ \
@LIBSPDYLAY_LIBS@ \ @LIBSPDYLAY_LIBS@ \
@XML_LIBS@ \ @LIBXML2_LIBS@ \
@LIBEV_LIBS@ \ @LIBEV_LIBS@ \
@OPENSSL_LIBS@ \ @OPENSSL_LIBS@ \
@LIBCARES_LIBS@ \ @LIBCARES_LIBS@ \