Use ac_save_* instead of old_*

pull/558/head
Tatsuhiro Tsujikawa 2016-01-30 18:55:51 +09:00
parent cf2fa33fe0
commit 83aae472fa
1 changed files with 36 additions and 36 deletions

View File

@ -203,8 +203,8 @@ if test "x$with_libz" = "xyes"; then
AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have zlib.]) AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have zlib.])
# Android NDK arch-mips contains gzbuffer symbol but it is missing # Android NDK arch-mips contains gzbuffer symbol but it is missing
# in zlib.h # in zlib.h
old_CFLAGS=$CFLAGS ac_save_CFLAGS=$CFLAGS
old_LIBS=$LIBS ac_save_LIBS=$LIBS
CFLAGS="$CFLAGS $ZLIB_CFLAGS" CFLAGS="$CFLAGS $ZLIB_CFLAGS"
LIBS="$ZLIB_LIBS $LIBS" LIBS="$ZLIB_LIBS $LIBS"
AC_CHECK_DECL([gzbuffer], [have_decl_gzbuffer=yes], [], AC_CHECK_DECL([gzbuffer], [have_decl_gzbuffer=yes], [],
@ -213,8 +213,8 @@ if test "x$with_libz" = "xyes"; then
AC_CHECK_FUNC([gzbuffer]) AC_CHECK_FUNC([gzbuffer])
fi fi
AC_CHECK_FUNCS([gzsetparams]) AC_CHECK_FUNCS([gzsetparams])
CFLAGS=$old_CFLAGS CFLAGS=$ac_save_CFLAGS
LIBS=$old_LIBS LIBS=$ac_save_LIBS
fi fi
fi fi
@ -223,8 +223,8 @@ if test "x$with_libuv" = "xyes"; then
case "$host" in case "$host" in
*mingw*|*msvc*) *mingw*|*msvc*)
libuv_cflags="-D_WIN32_WINNT=0x0600" libuv_cflags="-D_WIN32_WINNT=0x0600"
old_CPPFLAGS=$CPPFLAGS ac_save_CPPFLAGS=$CPPFLAGS
old_LIBS=$LIBS ac_save_LIBS=$LIBS
CPPFLAGS="$CPPFLAGS $libuv_cflags" CPPFLAGS="$CPPFLAGS $libuv_cflags"
AC_SEARCH_LIBS([uv_poll_init_socket], [uv], [ AC_SEARCH_LIBS([uv_poll_init_socket], [uv], [
AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no]) AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no])
@ -235,14 +235,14 @@ if test "x$with_libuv" = "xyes"; then
AC_SUBST([LIBUV_CFLAGS]) AC_SUBST([LIBUV_CFLAGS])
AC_SUBST([LIBUV_LIBS]) AC_SUBST([LIBUV_LIBS])
fi fi
CPPFLAGS=$old_CPPFLAGS CPPFLAGS=$ac_save_CPPFLAGS
CPPLIBS=$old_LIBS CPPLIBS=$ac_save_LIBS
;; ;;
*darwin*) *darwin*)
libuv_ldflags="-framework Foundation -framework CoreServices -framework ApplicationServices" libuv_ldflags="-framework Foundation -framework CoreServices -framework ApplicationServices"
old_LDFLAGS=$LDFLAGS ac_save_LDFLAGS=$LDFLAGS
old_LIBS=$LIBS ac_save_LIBS=$LIBS
LDFLAGS="$LDFLAGS $libuv_ldflags" LDFLAGS="$LDFLAGS $libuv_ldflags"
AC_SEARCH_LIBS([uv_poll_init_socket], [uv], [ AC_SEARCH_LIBS([uv_poll_init_socket], [uv], [
AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no]) AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no])
@ -253,16 +253,16 @@ if test "x$with_libuv" = "xyes"; then
AC_SUBST([LIBUV_CFLAGS]) AC_SUBST([LIBUV_CFLAGS])
AC_SUBST([LIBUV_LIBS]) AC_SUBST([LIBUV_LIBS])
fi fi
LDFLAGS=$old_LDFLAGS LDFLAGS=$ac_save_LDFLAGS
LIBS=$old_LIBS LIBS=$ac_save_LIBS
;; ;;
*) *)
dnl Yeah, sucks that luv does not bring a pkg-config or config-tool dnl Yeah, sucks that luv does not bring a pkg-config or config-tool
AC_MSG_CHECKING([for libuv]) AC_MSG_CHECKING([for libuv])
old_LIBS=$LIBS ac_save_LIBS=$LIBS
for combo in "" "-lrt" "-ldl -lrt" "-ldl -lrt -lpthread" "-lkvm"; do for combo in "" "-lrt" "-ldl -lrt" "-ldl -lrt -lpthread" "-lkvm"; do
LIBS="-luv $combo $old_LIBS -lm" LIBS="-luv $combo $ac_save_LIBS -lm"
AC_LINK_IFELSE([AC_LANG_SOURCE([ AC_LINK_IFELSE([AC_LANG_SOURCE([
extern "C" int uv_poll_init_socket(void); extern "C" int uv_poll_init_socket(void);
int main() { return uv_poll_init_socket(); } int main() { return uv_poll_init_socket(); }
@ -278,7 +278,7 @@ int main() { return uv_poll_init_socket(); }
break; break;
fi fi
done done
LIBS=$old_LIBS LIBS=$ac_save_LIBS
if test "x$have_libuv" != "xyes"; then if test "x$have_libuv" != "xyes"; then
AC_MSG_RESULT("no") AC_MSG_RESULT("no")
fi fi
@ -287,10 +287,10 @@ int main() { return uv_poll_init_socket(); }
if test "x$have_libuv" = "xyes"; then if test "x$have_libuv" = "xyes"; then
AC_DEFINE([HAVE_LIBUV], [1], [Define to 1 if you have libuv.]) AC_DEFINE([HAVE_LIBUV], [1], [Define to 1 if you have libuv.])
old_LIBS=$LIBS ac_save_LIBS=$LIBS
LIBS="$LIBUV_LIBS $LIBS" LIBS="$LIBUV_LIBS $LIBS"
AC_CHECK_FUNCS([uv_last_error]) AC_CHECK_FUNCS([uv_last_error])
LIBS=$old_LIBS LIBS=$ac_save_LIBS
elif test "x$with_libuv_requested" = "xyes"; then elif test "x$with_libuv_requested" = "xyes"; then
ARIA2_DEP_NOT_MET([libuv]) ARIA2_DEP_NOT_MET([libuv])
fi fi
@ -321,10 +321,10 @@ if test "x$with_sqlite3" = "xyes"; then
PKG_CHECK_MODULES([SQLITE3],[sqlite3],[have_sqlite3=yes],[have_sqlite3=no]) 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.]) AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if you have sqlite3.])
old_LIBS=$LIBS ac_save_LIBS=$LIBS
LIBS="$SQLITE3_LIBS $LIBS" LIBS="$SQLITE3_LIBS $LIBS"
AC_CHECK_FUNCS([sqlite3_open_v2]) AC_CHECK_FUNCS([sqlite3_open_v2])
LIBS=$old_LIBS LIBS=$ac_save_LIBS
else else
AC_MSG_WARN([$SQLITE3_PKG_ERRORS]) AC_MSG_WARN([$SQLITE3_PKG_ERRORS])
if test "x$with_sqlite3_requested" = "xyes"; then if test "x$with_sqlite3_requested" = "xyes"; then
@ -435,10 +435,10 @@ if test "x$with_gnutls" = "xyes" && test "x$have_ssl" != "xyes"; then
if test "x$have_libgnutls" = "xyes"; then if test "x$have_libgnutls" = "xyes"; then
have_ssl=yes have_ssl=yes
AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if you have libgnutls.]) AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if you have libgnutls.])
old_LIBS=$LIBS ac_save_LIBS=$LIBS
LIBS="$LIBGNUTLS_LIBS $LIBS" LIBS="$LIBGNUTLS_LIBS $LIBS"
AC_CHECK_FUNCS([gnutls_certificate_set_x509_system_trust]) AC_CHECK_FUNCS([gnutls_certificate_set_x509_system_trust])
LIBS=$old_LIBS LIBS=$ac_save_LIBS
else else
AC_MSG_WARN([$LIBGNUTLS_PKG_ERRORS]) AC_MSG_WARN([$LIBGNUTLS_PKG_ERRORS])
if test "x$with_gnutls_requested" = "xyes"; then if test "x$with_gnutls_requested" = "xyes"; then
@ -455,7 +455,7 @@ if test "x$with_openssl" = "xyes" && test "x$have_ssl" != "xyes"; then
have_ssl=yes have_ssl=yes
AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have openssl.]) AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have openssl.])
old_LIBS=$LIBS ac_save_LIBS=$LIBS
LIBS="$OPENSSL_LIBS $LIBS" LIBS="$OPENSSL_LIBS $LIBS"
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
@ -465,7 +465,7 @@ if test "x$with_openssl" = "xyes" && test "x$have_ssl" != "xyes"; then
AC_CHECK_FUNCS([EVP_sha256]) AC_CHECK_FUNCS([EVP_sha256])
AC_CHECK_FUNCS([EVP_sha384]) AC_CHECK_FUNCS([EVP_sha384])
AC_CHECK_FUNCS([EVP_sha512]) AC_CHECK_FUNCS([EVP_sha512])
LIBS=$old_LIBS LIBS=$ac_save_LIBS
else else
AC_MSG_WARN([$OPENSSL_PKG_ERRORS]) AC_MSG_WARN([$OPENSSL_PKG_ERRORS])
if test "x$with_openssl_requested" = "xyes"; then if test "x$with_openssl_requested" = "xyes"; then
@ -501,10 +501,10 @@ if test "x$have_openssl" != "xyes"; then
AC_SUBST([LIBGMP_CFLAGS]) AC_SUBST([LIBGMP_CFLAGS])
AC_SUBST([LIBGMP_LIBS]) AC_SUBST([LIBGMP_LIBS])
AC_DEFINE([HAVE_LIBGMP], [1], [Define to 1 if you have libgmp.]) AC_DEFINE([HAVE_LIBGMP], [1], [Define to 1 if you have libgmp.])
old_LIBS=$LIBS ac_save_LIBS=$LIBS
LIBS="$LIBGMP_LIBS $LIBS" LIBS="$LIBGMP_LIBS $LIBS"
AC_CHECK_FUNCS([__gmpz_powm_sec], [have_mpz_powm_sec=yes]) AC_CHECK_FUNCS([__gmpz_powm_sec], [have_mpz_powm_sec=yes])
LIBS=$old_LIBS LIBS=$ac_save_LIBS
if test "x$have_mpz_powm_sec" = "xyes"; then if test "x$have_mpz_powm_sec" = "xyes"; then
AC_DEFINE([HAVE_GMP_SEC], [1], [Define to 1 if you have a GMP with sec functions.]) AC_DEFINE([HAVE_GMP_SEC], [1], [Define to 1 if you have a GMP with sec functions.])
fi fi
@ -544,14 +544,14 @@ if test "x$with_libcares" = "xyes"; then
[have_libcares=no]) [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.]) AC_DEFINE([HAVE_LIBCARES], [1], [Define to 1 if you have libcares.])
old_LIBS=$LIBS ac_save_LIBS=$LIBS
old_CPPFLAGS=$CPPFLAGS ac_save_CPPFLAGS=$CPPFLAGS
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_TYPES([ares_addr_node], [], [], [[#include <ares.h>]])
AC_CHECK_FUNCS([ares_set_servers]) AC_CHECK_FUNCS([ares_set_servers])
LIBS=$old_LIBS LIBS=$ac_save_LIBS
CPPFLAGS=$old_CPPFLAGS CPPFLAGS=$ac_save_CPPFLAGS
# -DCARES_STATICLIB is appended by pkg-config file libcares.pc # -DCARES_STATICLIB is appended by pkg-config file libcares.pc
else else
@ -691,11 +691,11 @@ AM_CONDITIONAL([HAVE_LIBSSH2], [test "x$have_libssh2" = "xyes"])
case "$host" in case "$host" in
*solaris*) *solaris*)
old_LIBS=$LIBS ac_save_LIBS=$LIBS
LIBS= LIBS=
AC_SEARCH_LIBS([getaddrinfo], [nsl socket], [], [$old_LIBS]) AC_SEARCH_LIBS([getaddrinfo], [nsl socket], [], [$ac_save_LIBS])
EXTRALIBS="$LIBS $EXTRALIBS" EXTRALIBS="$LIBS $EXTRALIBS"
LIBS=$old_LIBS LIBS=$ac_save_LIBS
;; ;;
esac esac
@ -922,7 +922,7 @@ AM_CONDITIONAL([HAVE_SOME_FALLOCATE],
|| test "x$have_osx" = "xyes" || test "x$win_build" = "xyes"]) || test "x$have_osx" = "xyes" || test "x$win_build" = "xyes"])
# mingw needs this # mingw needs this
old_CPPFLAGS=$CPPFLAGS ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $EXTRACPPFLAGS" CPPFLAGS="$CPPFLAGS $EXTRACPPFLAGS"
AC_MSG_CHECKING([for asctime_r]) AC_MSG_CHECKING([for asctime_r])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
@ -949,7 +949,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
AC_DEFINE([HAVE_LOCALTIME_R], [1], [Define to 1 if you have the `localtime_r' function or macro.])], AC_DEFINE([HAVE_LOCALTIME_R], [1], [Define to 1 if you have the `localtime_r' function or macro.])],
[AC_MSG_RESULT([no]) [AC_MSG_RESULT([no])
AM_CONDITIONAL([HAVE_LOCALTIME_R], false)]) AM_CONDITIONAL([HAVE_LOCALTIME_R], false)])
CPPFLAGS=$old_CPPFLAGS CPPFLAGS=$ac_save_CPPFLAGS
AC_CHECK_FUNCS([basename], AC_CHECK_FUNCS([basename],
[AM_CONDITIONAL([HAVE_BASENAME], true)], [AM_CONDITIONAL([HAVE_BASENAME], true)],
@ -1118,7 +1118,7 @@ AC_SUBST([EXTRACPPFLAGS])
AC_SUBST([EXTRALDFLAGS]) AC_SUBST([EXTRALDFLAGS])
AC_SUBST([EXTRALIBS]) AC_SUBST([EXTRALIBS])
old_CXXFLAGS=$CXXFLAGS ac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS= CXXFLAGS=
if test "x$enable_werror" = "xyes"; then if test "x$enable_werror" = "xyes"; then
@ -1128,7 +1128,7 @@ if test "x$enable_werror" = "xyes"; then
fi fi
WARNCXXFLAGS=$CXXFLAGS WARNCXXFLAGS=$CXXFLAGS
CXXFLAGS=$old_CXXFLAGS CXXFLAGS=$ac_save_CXXFLAGS
AC_SUBST([WARNCXXFLAGS]) AC_SUBST([WARNCXXFLAGS])