mirror of https://github.com/aria2/aria2
Check with pkg-config only: c-ares, openssl, sqlite3 and zlib.
Removed --with-*-prefix configure option for c-ares, openssl, sqlite3, zlib and expat. Use CPPFLAGS and/or PKG_CONFIG_PATH instead.pull/16/merge
parent
fcb102b650
commit
7e5814f0f9
30
configure.ac
30
configure.ac
|
@ -85,18 +85,20 @@ fi
|
||||||
if test "x$with_libexpat" = "xyes" && test "x$have_libxml2" != "xyes"; then
|
if test "x$with_libexpat" = "xyes" && test "x$have_libxml2" != "xyes"; then
|
||||||
AM_PATH_LIBEXPAT
|
AM_PATH_LIBEXPAT
|
||||||
if test "x$have_libexpat" = "xyes"; then
|
if test "x$have_libexpat" = "xyes"; then
|
||||||
LIBS="$LIBEXPAT_LIBS $LIBS"
|
LIBS="$EXPAT_LIBS $LIBS"
|
||||||
CPPFLAGS="$LIBEXPAT_CPPFLAGS $CPPFLAGS"
|
CPPFLAGS="$EXPAT_CFLAGS $CPPFLAGS"
|
||||||
elif test "x$with_libexpat_requested" = "xyes"; then
|
elif test "x$with_libexpat_requested" = "xyes"; then
|
||||||
ARIA2_DEP_NOT_MET([libexpat])
|
ARIA2_DEP_NOT_MET([libexpat])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$with_sqlite3" = "xyes"; then
|
if test "x$with_sqlite3" = "xyes"; then
|
||||||
AM_PATH_SQLITE3
|
PKG_CHECK_MODULES([SQLITE3],[sqlite3],[have_sqlite3=yes],[have_sqlite3=no])
|
||||||
if test "x$have_sqlite3" = "xyes"; then
|
if test "x$have_sqlite3" = "xyes"; then
|
||||||
|
AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if you have sqlite3.])
|
||||||
LIBS="$SQLITE3_LIBS $LIBS"
|
LIBS="$SQLITE3_LIBS $LIBS"
|
||||||
CPPFLAGS="$SQLITE3_CFLAGS $CPPFLAGS"
|
CPPFLAGS="$SQLITE3_CFLAGS $CPPFLAGS"
|
||||||
|
AC_CHECK_FUNCS([sqlite3_open_v2])
|
||||||
elif test "x$with_sqlite3_requested" = "xyes"; then
|
elif test "x$with_sqlite3_requested" = "xyes"; then
|
||||||
ARIA2_DEP_NOT_MET([sqlite3])
|
ARIA2_DEP_NOT_MET([sqlite3])
|
||||||
fi
|
fi
|
||||||
|
@ -117,10 +119,21 @@ if test "x$with_gnutls" = "xyes"; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
|
if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
|
||||||
AM_PATH_OPENSSL
|
PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8],
|
||||||
|
[have_openssl=yes], [have_openssl=no])
|
||||||
if test "x$have_openssl" = "xyes"; then
|
if test "x$have_openssl" = "xyes"; then
|
||||||
|
AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have openssl.])
|
||||||
LIBS="$OPENSSL_LIBS $LIBS"
|
LIBS="$OPENSSL_LIBS $LIBS"
|
||||||
CPPFLAGS="$OPENSSL_CFLAGS $CPPFLAGS"
|
CPPFLAGS="$OPENSSL_CFLAGS $CPPFLAGS"
|
||||||
|
|
||||||
|
AC_CHECK_FUNCS([EVP_DigestInit_ex], [have_digestinit_ex=yes])
|
||||||
|
if test "x$have_digestinit_ex" = "x"; then
|
||||||
|
AC_DEFINE([HAVE_OLD_OPENSSL], [1], [Define to 1 if you have old openssl.])
|
||||||
|
fi
|
||||||
|
AC_CHECK_FUNCS([EVP_sha224])
|
||||||
|
AC_CHECK_FUNCS([EVP_sha256])
|
||||||
|
AC_CHECK_FUNCS([EVP_sha384])
|
||||||
|
AC_CHECK_FUNCS([EVP_sha512])
|
||||||
elif test "x$with_openssl_requested" = "xyes"; then
|
elif test "x$with_openssl_requested" = "xyes"; then
|
||||||
ARIA2_DEP_NOT_MET([openssl])
|
ARIA2_DEP_NOT_MET([openssl])
|
||||||
fi
|
fi
|
||||||
|
@ -154,10 +167,14 @@ if test "x$have_openssl" != "xyes"; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$with_libcares" = "xyes"; then
|
if test "x$with_libcares" = "xyes"; then
|
||||||
AM_PATH_LIBCARES
|
PKG_CHECK_MODULES([LIBCARES], [libcares >= 1.7.0], [have_libcares=yes],
|
||||||
|
[have_libcares=no])
|
||||||
if test "x$have_libcares" = "xyes"; then
|
if test "x$have_libcares" = "xyes"; then
|
||||||
|
AC_DEFINE([HAVE_LIBCARES], [1], [Define to 1 if you have libcares.])
|
||||||
LIBS="$LIBCARES_LIBS $LIBS"
|
LIBS="$LIBCARES_LIBS $LIBS"
|
||||||
CPPFLAGS="$LIBCARES_CFLAGS $CPPFLAGS"
|
CPPFLAGS="$LIBCARES_CFLAGS $CPPFLAGS"
|
||||||
|
AC_CHECK_TYPES([ares_addr_node], [], [], [[#include <ares.h>]])
|
||||||
|
AC_CHECK_FUNCS([ares_set_servers])
|
||||||
elif test "x$with_libcares_requested" = "xyes"; then
|
elif test "x$with_libcares_requested" = "xyes"; then
|
||||||
ARIA2_DEP_NOT_MET([libcares])
|
ARIA2_DEP_NOT_MET([libcares])
|
||||||
fi
|
fi
|
||||||
|
@ -165,8 +182,9 @@ fi
|
||||||
|
|
||||||
# Check availability of libz
|
# Check availability of libz
|
||||||
if test "x$with_libz" = "xyes"; then
|
if test "x$with_libz" = "xyes"; then
|
||||||
AM_PATH_LIBZ
|
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no])
|
||||||
if test "x$have_zlib" = "xyes"; then
|
if test "x$have_zlib" = "xyes"; then
|
||||||
|
AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have zlib.])
|
||||||
LIBS="$ZLIB_LIBS $LIBS"
|
LIBS="$ZLIB_LIBS $LIBS"
|
||||||
CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
|
CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
|
||||||
elif test "x$with_libz_requested" = "xyes"; then
|
elif test "x$with_libz_requested" = "xyes"; then
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
AC_DEFUN([AM_PATH_LIBCARES],
|
|
||||||
[
|
|
||||||
AC_ARG_WITH([libcares-prefix],
|
|
||||||
[ --with-libcares-prefix=PREFIX Prefix where libcares installed (optional)],
|
|
||||||
[libcares_prefix=$withval],
|
|
||||||
[libcares_prefix=""])
|
|
||||||
|
|
||||||
if test "x$libcares_prefix" = "x"; then
|
|
||||||
libcares_prefix="/usr"
|
|
||||||
fi
|
|
||||||
|
|
||||||
libcares_prefix_lib=$libcares_prefix/lib
|
|
||||||
libcares_prefix_include=$libcares_prefix/include
|
|
||||||
|
|
||||||
LIBS_save=$LIBS
|
|
||||||
CPPFLAGS_save=$CPPFLAGS
|
|
||||||
PKG_CONFIG_PATH_save=$PKG_CONFIG_PATH
|
|
||||||
|
|
||||||
PKG_CONFIG_PATH="$libcares_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
||||||
PKG_CHECK_MODULES([LIBCARES], [libcares >= 1.7.0], [have_libcares=yes],
|
|
||||||
[have_libcares=no])
|
|
||||||
|
|
||||||
if test "x$have_libcares" = "xyes"; then
|
|
||||||
LIBS="$LIBCARES_LIBS $LIBS"
|
|
||||||
CPPFLAGS="$LIBCARES_CFLAGS $CPPFLAGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x$have_libcares" != "xyes"; then
|
|
||||||
LIBS="-L$libcares_prefix_lib $LIBS"
|
|
||||||
CPPFLAGS="-I$libcares_prefix_include -Wall $CPPFLAGS"
|
|
||||||
|
|
||||||
AC_CHECK_LIB([cares], [ares_init], [have_libcares=yes])
|
|
||||||
|
|
||||||
if test "x$have_libcares" != "xyes"; then
|
|
||||||
AC_CHECK_LIB([cares], [ares_init], [have_libcares=yes need_librt=yes], [],
|
|
||||||
[-lrt])
|
|
||||||
fi
|
|
||||||
if test "x$have_libcares" = "xyes"; then
|
|
||||||
LIBCARES_LIBS="-L$libcares_prefix_lib -lcares"
|
|
||||||
if test "x$need_librt" = "xyes"; then
|
|
||||||
LIBCARES_LIBS="$LIBCARES_LIBS -lrt"
|
|
||||||
fi
|
|
||||||
LIBCARES_CFLAGS="-I$libcares_prefix_include"
|
|
||||||
|
|
||||||
LIBS="$LIBCARES_LIBS $LIBS_save"
|
|
||||||
CPPFLAGS="$LIBCARES_CFLAGS $CPPFLAGS_save"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x$have_libcares" = "xyes"; then
|
|
||||||
AC_DEFINE([HAVE_LIBCARES], [1], [Define to 1 if you have libcares.])
|
|
||||||
AC_CHECK_TYPES([ares_addr_node], [], [], [[#include <ares.h>]])
|
|
||||||
AC_CHECK_FUNCS([ares_set_servers])
|
|
||||||
fi
|
|
||||||
|
|
||||||
LIBS=$LIBS_save
|
|
||||||
CPPFLAGS=$CPPFLAGS_save
|
|
||||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH_save
|
|
||||||
])
|
|
|
@ -1,30 +1,14 @@
|
||||||
AC_DEFUN([AM_PATH_LIBEXPAT],
|
AC_DEFUN([AM_PATH_LIBEXPAT],
|
||||||
[
|
[
|
||||||
AC_ARG_WITH([libexpat-prefix],
|
|
||||||
[ --with-libexpat-prefix=PREFIX Prefix where libexpat installed (optional)],
|
|
||||||
[libexpat_prefix=$withval],
|
|
||||||
[libexpat_prefix=""])
|
|
||||||
|
|
||||||
if test "x$libexpat_prefix" = "x"; then
|
|
||||||
libexpat_prefix="/usr"
|
|
||||||
fi
|
|
||||||
|
|
||||||
libexpat_prefix_lib=$libexpat_prefix/lib
|
|
||||||
libexpat_prefix_include=$libexpat_prefix/include
|
|
||||||
|
|
||||||
LIBS_save=$LIBS
|
LIBS_save=$LIBS
|
||||||
CPPFLAGS_save=$CPPFLAGS
|
CPPFLAGS_save=$CPPFLAGS
|
||||||
|
|
||||||
LIBS="-L$libexpat_prefix_lib $LIBS"
|
LIBS="-lexpat $LIBS"
|
||||||
CPPFLAGS="-I$libexpat_prefix_include $CPPFLAGS"
|
|
||||||
|
|
||||||
AC_CHECK_LIB([expat], [XML_ParserCreate], [have_libexpat=yes])
|
AC_CHECK_LIB([expat], [XML_ParserCreate], [have_libexpat=yes])
|
||||||
if test "x$have_libexpat" = "xyes"; then
|
if test "x$have_libexpat" = "xyes"; then
|
||||||
AC_DEFINE([HAVE_LIBEXPAT], [1], [Define to 1 if you have libexpat.])
|
AC_DEFINE([HAVE_LIBEXPAT], [1], [Define to 1 if you have libexpat.])
|
||||||
LIBEXPAT_LIBS="-L$libexpat_prefix_lib -lexpat"
|
EXPAT_LIBS=-lexpat
|
||||||
LIBEXPAT_CPPFLAGS="-I$libexpat_prefix_include"
|
EXPAT_CFLAGS=
|
||||||
AC_SUBST(LIBEXPAT_LIBS)
|
|
||||||
AC_SUBST(LIBEXPAT_CPPFLAGS)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBS=$LIBS_save
|
LIBS=$LIBS_save
|
||||||
|
|
|
@ -1,62 +0,0 @@
|
||||||
AC_DEFUN([AM_PATH_OPENSSL],
|
|
||||||
[
|
|
||||||
AC_ARG_WITH([openssl-prefix],
|
|
||||||
[ --with-openssl-prefix=PREFIX Prefix where OpenSSL installed (optional)],
|
|
||||||
[openssl_prefix=$withval],
|
|
||||||
[openssl_prefix=""])
|
|
||||||
|
|
||||||
if test "x$openssl_prefix" = "x"; then
|
|
||||||
openssl_prefix="/usr"
|
|
||||||
fi
|
|
||||||
|
|
||||||
LIBS_save=$LIBS
|
|
||||||
CPPFLAGS_save=$CPPFLAGS
|
|
||||||
PKG_CONFIG_PATH_save=$PKG_CONFIG_PATH
|
|
||||||
|
|
||||||
PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
||||||
PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8],
|
|
||||||
[have_openssl=yes], [have_openssl=no])
|
|
||||||
|
|
||||||
if test "x$have_openssl" != "xyes"; then
|
|
||||||
openssl_prefix_lib=$openssl_prefix/lib
|
|
||||||
openssl_prefix_include=$openssl_prefix/include
|
|
||||||
|
|
||||||
LIBS="-L$openssl_prefix_lib $LIBS"
|
|
||||||
CPPFLAGS="-I$openssl_prefix_include $CPPFLAGS"
|
|
||||||
|
|
||||||
# First check libcrypto, because libssl may depend on it
|
|
||||||
AC_CHECK_LIB([crypto], [main], [have_openssl=yes; LIBS="-lcrypto $LIBS"])
|
|
||||||
if test "x$have_openssl" = "xyes"; then
|
|
||||||
have_openssl=no
|
|
||||||
AC_CHECK_LIB([ssl], [SSL_library_init],
|
|
||||||
[have_openssl=yes LIBS="-lssl $LIBS"])
|
|
||||||
if test "x$have_openssl" = "xyes"; then
|
|
||||||
OPENSSL_LIBS="-L$openssl_prefix_lib -lssl -lcrypto"
|
|
||||||
OPENSSL_CFLAGS="-I$openssl_prefix_include"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x$have_openssl" = "xyes"; then
|
|
||||||
AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have openssl.])
|
|
||||||
LIBS="$OPENSSL_LIBS $LIBS"
|
|
||||||
CPPFLAGS="$OPENSSL_CFLAGS $CPPFLAGS"
|
|
||||||
# check whether EVP_DigestInit_ex exists. Old openssl doesn't have it.
|
|
||||||
AC_CHECK_FUNCS([EVP_DigestInit_ex], [have_digestinit_ex=yes])
|
|
||||||
if test "x$have_digestinit_ex" = "x"; then
|
|
||||||
AC_DEFINE([HAVE_OLD_OPENSSL], [1], [Define to 1 if you have old openssl.])
|
|
||||||
fi
|
|
||||||
# search for sha224 support
|
|
||||||
AC_CHECK_FUNCS([EVP_sha224])
|
|
||||||
# search for sha256 support
|
|
||||||
AC_CHECK_FUNCS([EVP_sha256])
|
|
||||||
# search for sha384 support
|
|
||||||
AC_CHECK_FUNCS([EVP_sha384])
|
|
||||||
# search for sha512 support
|
|
||||||
AC_CHECK_FUNCS([EVP_sha512])
|
|
||||||
fi
|
|
||||||
|
|
||||||
LIBS=$LIBS_save
|
|
||||||
CPPFLAGS=$CPPFLAGS_save
|
|
||||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH_save
|
|
||||||
])
|
|
|
@ -1,43 +0,0 @@
|
||||||
AC_DEFUN([AM_PATH_SQLITE3],
|
|
||||||
[
|
|
||||||
AC_ARG_WITH([sqlite3-prefix],
|
|
||||||
[ --with-sqlite3-prefix=PREFIX Prefix where SQLite3 installed (optional)],
|
|
||||||
[sqlite3_prefix=$withval],
|
|
||||||
[sqlite3_prefix=""])
|
|
||||||
if test "x$sqlite3_prefix" = "x"; then
|
|
||||||
sqlite3_prefix="/usr"
|
|
||||||
fi
|
|
||||||
|
|
||||||
LIBS_save=$LIBS
|
|
||||||
CPPFLAGS_save=$CPPFLAGS
|
|
||||||
|
|
||||||
PKG_CHECK_MODULES([SQLITE3],[sqlite3],[have_sqlite3=yes],[have_sqlite3=no])
|
|
||||||
|
|
||||||
if test "x$have_sqlite3" != "xyes"; then
|
|
||||||
AC_MSG_WARN([$SQLITE3_PKG_ERRORS])
|
|
||||||
|
|
||||||
sqlite3_prefix_lib=$sqlite3_prefix/lib
|
|
||||||
sqlite3_prefix_include=$sqlite3_prefix/include
|
|
||||||
|
|
||||||
LIBS="-L$sqlite3_prefix_lib $LIBS"
|
|
||||||
CPPFLAGS="-I$sqlite3_prefix_include $CPPFLAGS"
|
|
||||||
|
|
||||||
AC_CHECK_LIB([sqlite3], [sqlite3_open], [have_sqlite3=yes])
|
|
||||||
if test "x$have_sqlite3" = "xyes"; then
|
|
||||||
SQLITE3_LIBS="-L$sqlite3_prefix_lib -lsqlite3"
|
|
||||||
SQLITE3_CFLAGS="-I$sqlite3_prefix_include"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if test "x$have_sqlite3" = "xyes"; then
|
|
||||||
LIBS="$SQLITE3_LIBS $LIBS"
|
|
||||||
CPPFLAGS="$SQLITE3_CFLAGS $CPPFLAGS"
|
|
||||||
AC_CHECK_FUNCS([sqlite3_open_v2])
|
|
||||||
AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if you have sqlite3.])
|
|
||||||
AC_SUBST(SQLITE3_LIBS)
|
|
||||||
AC_SUBST(SQLITE3_CFLAGS)
|
|
||||||
fi
|
|
||||||
|
|
||||||
LIBS=$LIBS_save
|
|
||||||
CPPFLAGS=$CPPFLAGS_save
|
|
||||||
|
|
||||||
])
|
|
40
m4/zlib.m4
40
m4/zlib.m4
|
@ -1,40 +0,0 @@
|
||||||
AC_DEFUN([AM_PATH_LIBZ],
|
|
||||||
[
|
|
||||||
AC_ARG_WITH([libz-prefix],
|
|
||||||
[ --with-libz-prefix=PREFIX Prefix where zlib installed (optional)],
|
|
||||||
[libz_prefix=$withval],
|
|
||||||
[libz_prefix=""])
|
|
||||||
|
|
||||||
if test "x$libz_prefix" = "x"; then
|
|
||||||
libz_prefix="/usr"
|
|
||||||
fi
|
|
||||||
|
|
||||||
LIBS_save=$LIBS
|
|
||||||
CPPFLAGS_save=$CPPFLAGS
|
|
||||||
PKG_CONFIG_PATH_save=$PKG_CONFIG_PATH
|
|
||||||
|
|
||||||
PKG_CONFIG_PATH="$libz_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
||||||
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no])
|
|
||||||
|
|
||||||
if test "x$have_zlib" != "xyes"; then
|
|
||||||
libz_prefix_lib=$libz_prefix/lib
|
|
||||||
libz_prefix_include=$libz_prefix/include
|
|
||||||
|
|
||||||
LIBS="-L$libz_prefix_lib $LIBS"
|
|
||||||
CPPFLAGS="-I$libz_prefix_include $CPPFLAGS"
|
|
||||||
|
|
||||||
AC_CHECK_LIB([z], [zlibVersion], [have_zlib=yes])
|
|
||||||
if test "x$have_zlib" = "xyes"; then
|
|
||||||
ZLIB_LIBS="-L$libz_prefix_lib -lz"
|
|
||||||
ZLIB_CFLAGS="-I$libz_prefix_include"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x$have_zlib" = "xyes"; then
|
|
||||||
AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have zlib.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
LIBS=$LIBS_save
|
|
||||||
CPPFLAGS=$CPPFLAGS_save
|
|
||||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH_save
|
|
||||||
])
|
|
Loading…
Reference in New Issue