mirror of https://github.com/aria2/aria2
Merge pull request #773 from mgorny/pkgconfig
configure: Use pkg-config to find libs whenever possiblepull/786/head
commit
c087ab1ba1
30
configure.ac
30
configure.ac
|
@ -21,7 +21,6 @@ AC_SUBST(LT_REVISION, 0)
|
||||||
AC_SUBST(LT_AGE, 0)
|
AC_SUBST(LT_AGE, 0)
|
||||||
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
m4_ifdef([AM_PATH_CPPUNIT], [AM_PATH_CPPUNIT(1.10.2)])
|
|
||||||
AC_CONFIG_SRCDIR([src/a2io.h])
|
AC_CONFIG_SRCDIR([src/a2io.h])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
||||||
|
@ -202,6 +201,9 @@ fi
|
||||||
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
|
|
||||||
|
# Check availability of cppunit
|
||||||
|
PKG_CHECK_MODULES([CPPUNIT], [cppunit >= 1.10.2], [], [])
|
||||||
|
|
||||||
# Check availability of libz
|
# Check availability of libz
|
||||||
if test "x$with_libz" = "xyes"; then
|
if test "x$with_libz" = "xyes"; then
|
||||||
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no])
|
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no])
|
||||||
|
@ -318,13 +320,7 @@ AM_CONDITIONAL([HAVE_LIBUV], [test "x$have_libuv" = "xyes"])
|
||||||
|
|
||||||
have_libxml2=no
|
have_libxml2=no
|
||||||
if test "x$with_libxml2" = "xyes"; then
|
if test "x$with_libxml2" = "xyes"; then
|
||||||
m4_ifdef([AM_PATH_XML2], [AM_PATH_XML2([2.6.24], [have_libxml2=yes])], [
|
PKG_CHECK_MODULES([LIBXML2],[libxml-2.0 >= 2.6.24],[have_libxml2=yes],[have_libxml2=no])
|
||||||
AC_MSG_WARN([configure was generated without libxml2 detection. libxml2 detection is disabled])
|
|
||||||
XML_CPPFLAGS=
|
|
||||||
XML_LIBS=
|
|
||||||
AC_SUBST([XML_CPPFLAGS])
|
|
||||||
AC_SUBST([XML_LIBS])
|
|
||||||
])
|
|
||||||
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.])
|
AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have libxml2.])
|
||||||
elif test "x$with_libxml2_requested" = "xyes"; then
|
elif test "x$with_libxml2_requested" = "xyes"; then
|
||||||
|
@ -334,13 +330,7 @@ fi
|
||||||
|
|
||||||
have_libexpat=no
|
have_libexpat=no
|
||||||
if test "x$with_libexpat" = "xyes" && test "x$have_libxml2" != "xyes"; then
|
if test "x$with_libexpat" = "xyes" && test "x$have_libxml2" != "xyes"; then
|
||||||
m4_ifdef([AM_PATH_LIBEXPAT], [AM_PATH_LIBEXPAT], [
|
PKG_CHECK_MODULES([EXPAT],[expat],[have_libexpat=yes],[have_libexpat=no])
|
||||||
AC_MSG_WARN([configure was generated without libexpat detection. libexpat detection is disabled])
|
|
||||||
EXPAT_CFLAGS=
|
|
||||||
EXPAT_LIBS=
|
|
||||||
AC_SUBST([EXPAT_CFLAGS])
|
|
||||||
AC_SUBST([EXPAT_LIBS])
|
|
||||||
])
|
|
||||||
if test "x$have_libexpat" != "xyes" &&
|
if test "x$have_libexpat" != "xyes" &&
|
||||||
test "x$with_libexpat_requested" = "xyes"; then
|
test "x$with_libexpat_requested" = "xyes"; then
|
||||||
ARIA2_DEP_NOT_MET([libexpat])
|
ARIA2_DEP_NOT_MET([libexpat])
|
||||||
|
@ -511,14 +501,12 @@ have_libgcrypt=no
|
||||||
if test "x$have_openssl" != "xyes"; then
|
if test "x$have_openssl" != "xyes"; then
|
||||||
if test "x$with_libnettle" = "xyes" &&
|
if test "x$with_libnettle" = "xyes" &&
|
||||||
test "x$have_nativetls" != "xyes"; then
|
test "x$have_nativetls" != "xyes"; then
|
||||||
AC_CHECK_LIB([nettle], [nettle_sha1_init],
|
PKG_CHECK_MODULES([LIBNETTLE], [nettle],
|
||||||
[have_libnettle=yes], [have_libnettle=no])
|
[have_libnettle=yes], [have_libnettle=no])
|
||||||
if test "x$have_libnettle" = "xyes"; then
|
if test "x$have_libnettle" = "xyes"; then
|
||||||
LIBNETTLE_CFLAGS=
|
|
||||||
LIBNETTLE_LIBS="-lnettle"
|
|
||||||
AC_SUBST([LIBNETTLE_CFLAGS])
|
|
||||||
AC_SUBST([LIBNETTLE_LIBS])
|
|
||||||
AC_DEFINE([HAVE_LIBNETTLE], [1], [Define to 1 if you have libnettle.])
|
AC_DEFINE([HAVE_LIBNETTLE], [1], [Define to 1 if you have libnettle.])
|
||||||
|
elif test "x$with_libnettle_requested" = "xyes"; then
|
||||||
|
ARIA2_DEP_NOT_MET([nettle])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if test "x$with_libgmp" = "xyes" &&
|
if test "x$with_libgmp" = "xyes" &&
|
||||||
|
@ -1229,7 +1217,7 @@ CA Bundle: $ca_bundle
|
||||||
LibNettle: $have_libnettle (CFLAGS='$LIBNETTLE_CFLAGS' LIBS='$LIBNETTLE_LIBS')
|
LibNettle: $have_libnettle (CFLAGS='$LIBNETTLE_CFLAGS' LIBS='$LIBNETTLE_LIBS')
|
||||||
LibGmp: $have_libgmp (CFLAGS='$LIBGMP_CFLAGS' LIBS='$LIBGMP_LIBS')
|
LibGmp: $have_libgmp (CFLAGS='$LIBGMP_CFLAGS' LIBS='$LIBGMP_LIBS')
|
||||||
LibGcrypt: $have_libgcrypt (CFLAGS='$LIBGCRYPT_CFLAGS' LIBS='$LIBGCRYPT_LIBS')
|
LibGcrypt: $have_libgcrypt (CFLAGS='$LIBGCRYPT_CFLAGS' LIBS='$LIBGCRYPT_LIBS')
|
||||||
LibXML2: $have_libxml2 (CFLAGS='$XML_CPPFLAGS' LIBS='$XML_LIBS')
|
LibXML2: $have_libxml2 (CFLAGS='$LIBXML2_CFLAGS' LIBS='$LIBXML2_LIBS')
|
||||||
LibExpat: $have_libexpat (CFLAGS='$EXPAT_CFLAGS' LIBS='$EXPAT_LIBS')
|
LibExpat: $have_libexpat (CFLAGS='$EXPAT_CFLAGS' LIBS='$EXPAT_LIBS')
|
||||||
LibCares: $have_libcares (CFLAGS='$LIBCARES_CFLAGS' LIBS='$LIBCARES_LIBS')
|
LibCares: $have_libcares (CFLAGS='$LIBCARES_CFLAGS' LIBS='$LIBCARES_LIBS')
|
||||||
Zlib: $have_zlib (CFLAGS='$ZLIB_CFLAGS' LIBS='$ZLIB_LIBS')
|
Zlib: $have_zlib (CFLAGS='$ZLIB_CFLAGS' LIBS='$ZLIB_LIBS')
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
AC_DEFUN([AM_PATH_LIBEXPAT],
|
|
||||||
[
|
|
||||||
LIBS_save=$LIBS
|
|
||||||
CPPFLAGS_save=$CPPFLAGS
|
|
||||||
|
|
||||||
LIBS="-lexpat $LIBS"
|
|
||||||
AC_CHECK_LIB([expat], [XML_ParserCreate], [have_libexpat=yes])
|
|
||||||
if test "x$have_libexpat" = "xyes"; then
|
|
||||||
AC_DEFINE([HAVE_LIBEXPAT], [1], [Define to 1 if you have libexpat.])
|
|
||||||
EXPAT_LIBS=-lexpat
|
|
||||||
EXPAT_CFLAGS=
|
|
||||||
AC_SUBST([EXPAT_LIBS])
|
|
||||||
AC_SUBST([EXPAT_CFLAGS])
|
|
||||||
fi
|
|
||||||
|
|
||||||
LIBS=$LIBS_save
|
|
||||||
CPPFLAGS=$CPPFLAGS_save
|
|
||||||
|
|
||||||
])
|
|
|
@ -711,7 +711,7 @@ AM_CPPFLAGS = \
|
||||||
@EXTRACPPFLAGS@ \
|
@EXTRACPPFLAGS@ \
|
||||||
@ZLIB_CFLAGS@ \
|
@ZLIB_CFLAGS@ \
|
||||||
@LIBUV_CFLAGS@ \
|
@LIBUV_CFLAGS@ \
|
||||||
@XML_CPPFLAGS@ \
|
@LIBXML2_CFLAGS@ \
|
||||||
@EXPAT_CFLAGS@ \
|
@EXPAT_CFLAGS@ \
|
||||||
@SQLITE3_CFLAGS@ \
|
@SQLITE3_CFLAGS@ \
|
||||||
@LIBGNUTLS_CFLAGS@ \
|
@LIBGNUTLS_CFLAGS@ \
|
||||||
|
@ -733,7 +733,7 @@ EXTLDADD = @ALLOCA@ \
|
||||||
@EXTRALIBS@ \
|
@EXTRALIBS@ \
|
||||||
@ZLIB_LIBS@ \
|
@ZLIB_LIBS@ \
|
||||||
@LIBUV_LIBS@ \
|
@LIBUV_LIBS@ \
|
||||||
@XML_LIBS@ \
|
@LIBXML2_LIBS@ \
|
||||||
@EXPAT_LIBS@ \
|
@EXPAT_LIBS@ \
|
||||||
@SQLITE3_LIBS@ \
|
@SQLITE3_LIBS@ \
|
||||||
@WINTLS_LIBS@ \
|
@WINTLS_LIBS@ \
|
||||||
|
|
|
@ -246,7 +246,7 @@ aria2c_LDADD = \
|
||||||
@EXTRALIBS@ \
|
@EXTRALIBS@ \
|
||||||
@ZLIB_LIBS@ \
|
@ZLIB_LIBS@ \
|
||||||
@LIBUV_LIBS@ \
|
@LIBUV_LIBS@ \
|
||||||
@XML_LIBS@ \
|
@LIBXML2_LIBS@ \
|
||||||
@EXPAT_LIBS@ \
|
@EXPAT_LIBS@ \
|
||||||
@SQLITE3_LIBS@ \
|
@SQLITE3_LIBS@ \
|
||||||
@WINTLS_LIBS@ \
|
@WINTLS_LIBS@ \
|
||||||
|
@ -274,7 +274,7 @@ AM_CPPFLAGS = \
|
||||||
@EXTRACPPFLAGS@ \
|
@EXTRACPPFLAGS@ \
|
||||||
@ZLIB_CFLAGS@ \
|
@ZLIB_CFLAGS@ \
|
||||||
@LIBUV_CFLAGS@ \
|
@LIBUV_CFLAGS@ \
|
||||||
@XML_CPPFLAGS@ \
|
@LIBXML2_CFLAGS@ \
|
||||||
@EXPAT_CFLAGS@ \
|
@EXPAT_CFLAGS@ \
|
||||||
@SQLITE3_CFLAGS@ \
|
@SQLITE3_CFLAGS@ \
|
||||||
@LIBGNUTLS_CFLAGS@ \
|
@LIBGNUTLS_CFLAGS@ \
|
||||||
|
|
Loading…
Reference in New Issue