mirror of https://github.com/aria2/aria2
Use PKG_CONFIG_PATH along with PKG_CHECK_MODULES in openssl.m4 and libz.m4.
Replaced LIBZ_LIB and LIBZ_CPPFLAGS with ZLIB_LIB and ZLIB_CFLAGS respectively.pull/1/head
parent
3f125dce21
commit
5b62fa9ab1
|
@ -144,8 +144,8 @@ fi
|
||||||
if test "x$with_libz" = "xyes"; then
|
if test "x$with_libz" = "xyes"; then
|
||||||
AM_PATH_LIBZ
|
AM_PATH_LIBZ
|
||||||
if test "x$have_libz" = "xyes"; then
|
if test "x$have_libz" = "xyes"; then
|
||||||
LIBS="$LIBZ_LIBS $LIBS"
|
LIBS="$ZLIB_LIBS $LIBS"
|
||||||
CPPFLAGS="$LIBZ_CPPFLAGS $CPPFLAGS"
|
CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
|
||||||
elif test "x$with_libz_requested" = "xyes"; then
|
elif test "x$with_libz_requested" = "xyes"; then
|
||||||
ARIA2_DEP_NOT_MET([libz])
|
ARIA2_DEP_NOT_MET([libz])
|
||||||
fi
|
fi
|
||||||
|
|
29
m4/libz.m4
29
m4/libz.m4
|
@ -9,25 +9,32 @@ if test "x$libz_prefix" = "x"; then
|
||||||
libz_prefix="/usr"
|
libz_prefix="/usr"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
libz_prefix_lib=$libz_prefix/lib
|
|
||||||
libz_prefix_include=$libz_prefix/include
|
|
||||||
|
|
||||||
LIBS_save=$LIBS
|
LIBS_save=$LIBS
|
||||||
CPPFLAGS_save=$CPPFLAGS
|
CPPFLAGS_save=$CPPFLAGS
|
||||||
|
PKG_CONFIG_PATH_save=$PKG_CONFIG_PATH
|
||||||
|
|
||||||
LIBS="-L$libz_prefix_lib $LIBS"
|
PKG_CONFIG_PATH="$libz_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
CPPFLAGS="-I$libz_prefix_include $CPPFLAGS"
|
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_libz=yes], [have_libz=no])
|
||||||
|
|
||||||
|
if test "x$have_libz" != "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_libz=yes])
|
||||||
|
if test "x$have_libz" = "xyes"; then
|
||||||
|
ZLIB_LIBS="-L$libz_prefix_lib -lz"
|
||||||
|
ZLIB_CFLAGS="-I$libz_prefix_include"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CHECK_LIB([z], [zlibVersion], [have_libz=yes])
|
|
||||||
if test "x$have_libz" = "xyes"; then
|
if test "x$have_libz" = "xyes"; then
|
||||||
AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have libz.])
|
AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have libz.])
|
||||||
LIBZ_LIBS="-L$libz_prefix_lib -lz"
|
|
||||||
LIBZ_CPPFLAGS="-I$libz_prefix_include"
|
|
||||||
AC_SUBST(LIBZ_LIBS)
|
|
||||||
AC_SUBST(LIBZ_CPPFLAGS)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBS=$LIBS_save
|
LIBS=$LIBS_save
|
||||||
CPPFLAGS=$CPPFLAGS_save
|
CPPFLAGS=$CPPFLAGS_save
|
||||||
|
PKG_CONFIG_PATH=$PKG_CONFIG_PATH_save
|
||||||
])
|
])
|
||||||
|
|
|
@ -11,24 +11,12 @@ fi
|
||||||
|
|
||||||
LIBS_save=$LIBS
|
LIBS_save=$LIBS
|
||||||
CPPFLAGS_save=$CPPFLAGS
|
CPPFLAGS_save=$CPPFLAGS
|
||||||
|
PKG_CONFIG_PATH_save=$PKG_CONFIG_PATH
|
||||||
|
|
||||||
PKG_CONFIG="$openssl_prefix/bin/pkg-config"
|
PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||||
if test -x $PKG_CONFIG; then
|
PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8],
|
||||||
AC_MSG_CHECKING([checking availability of openssl using pkg-config])
|
[have_openssl=yes], [have_openssl=no])
|
||||||
$PKG_CONFIG --exists openssl
|
|
||||||
if test "$?" = "0"; then
|
|
||||||
# Use pkg-config to detect LIBS and CFLAGS
|
|
||||||
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
|
|
||||||
OPENSSL_CFLAGS=`$PKG_CONFIG --cflags openssl`
|
|
||||||
|
|
||||||
LIBS="$OPENSSL_LIBS $LIBS"
|
|
||||||
CPPFLAGS="$OPENSSL_CFLAGS $CPPFLAGS"
|
|
||||||
have_openssl=yes
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
if test "x$have_openssl" != "xyes"; then
|
if test "x$have_openssl" != "xyes"; then
|
||||||
openssl_prefix_lib=$openssl_prefix/lib
|
openssl_prefix_lib=$openssl_prefix/lib
|
||||||
openssl_prefix_include=$openssl_prefix/include
|
openssl_prefix_include=$openssl_prefix/include
|
||||||
|
@ -40,7 +28,8 @@ if test "x$have_openssl" != "xyes"; then
|
||||||
AC_CHECK_LIB([crypto], [main], [have_openssl=yes; LIBS="-lcrypto $LIBS"])
|
AC_CHECK_LIB([crypto], [main], [have_openssl=yes; LIBS="-lcrypto $LIBS"])
|
||||||
if test "x$have_openssl" = "xyes"; then
|
if test "x$have_openssl" = "xyes"; then
|
||||||
have_openssl=no
|
have_openssl=no
|
||||||
AC_CHECK_LIB([ssl], [SSL_library_init], [have_openssl=yes LIBS="-lssl $LIBS"])
|
AC_CHECK_LIB([ssl], [SSL_library_init],
|
||||||
|
[have_openssl=yes LIBS="-lssl $LIBS"])
|
||||||
if test "x$have_openssl" = "xyes"; then
|
if test "x$have_openssl" = "xyes"; then
|
||||||
OPENSSL_LIBS="-L$openssl_prefix_lib -lssl -lcrypto"
|
OPENSSL_LIBS="-L$openssl_prefix_lib -lssl -lcrypto"
|
||||||
OPENSSL_CFLAGS="-I$openssl_prefix_include"
|
OPENSSL_CFLAGS="-I$openssl_prefix_include"
|
||||||
|
@ -50,13 +39,13 @@ fi
|
||||||
|
|
||||||
if test "x$have_openssl" = "xyes"; then
|
if test "x$have_openssl" = "xyes"; then
|
||||||
AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have openssl.])
|
AC_DEFINE([HAVE_LIBSSL], [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.
|
# check whether EVP_DigestInit_ex exists. Old openssl doesn't have it.
|
||||||
AC_CHECK_FUNCS([EVP_DigestInit_ex], [have_digestinit_ex=yes])
|
AC_CHECK_FUNCS([EVP_DigestInit_ex], [have_digestinit_ex=yes])
|
||||||
if test "x$have_digestinit_ex" = "x"; then
|
if test "x$have_digestinit_ex" = "x"; then
|
||||||
AC_DEFINE([HAVE_OLD_LIBSSL], [1], [Define to 1 if you have old openssl.])
|
AC_DEFINE([HAVE_OLD_LIBSSL], [1], [Define to 1 if you have old openssl.])
|
||||||
fi
|
fi
|
||||||
AC_SUBST(OPENSSL_LIBS)
|
|
||||||
AC_SUBST(OPENSSL_CFLAGS)
|
|
||||||
# search for sha224 support
|
# search for sha224 support
|
||||||
AC_CHECK_FUNCS([EVP_sha224])
|
AC_CHECK_FUNCS([EVP_sha224])
|
||||||
# search for sha256 support
|
# search for sha256 support
|
||||||
|
@ -69,4 +58,5 @@ fi
|
||||||
|
|
||||||
LIBS=$LIBS_save
|
LIBS=$LIBS_save
|
||||||
CPPFLAGS=$CPPFLAGS_save
|
CPPFLAGS=$CPPFLAGS_save
|
||||||
|
PKG_CONFIG_PATH=$PKG_CONFIG_PATH_save
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in New Issue