Bug 810716: Avoid AC_TRY_LINK on systems where we do not want res_ninit r=ted

This commit is contained in:
Martin Husemann 2013-11-16 09:13:23 +01:00
parent 49e1b5f8f1
commit c87e788897
2 changed files with 28 additions and 18 deletions

View File

@ -3096,7 +3096,11 @@ fi
AC_CACHE_CHECK( AC_CACHE_CHECK(
[for res_ninit()], [for res_ninit()],
ac_cv_func_res_ninit, ac_cv_func_res_ninit,
[AC_TRY_LINK([ [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
dnl no need for res_ninit() on NetBSD and OpenBSD
ac_cv_func_res_ninit=no
else
AC_TRY_LINK([
#ifdef linux #ifdef linux
#define _BSD_SOURCE 1 #define _BSD_SOURCE 1
#endif #endif
@ -3105,6 +3109,7 @@ AC_CACHE_CHECK(
[int foo = res_ninit(&_res);], [int foo = res_ninit(&_res);],
[ac_cv_func_res_ninit=yes], [ac_cv_func_res_ninit=yes],
[ac_cv_func_res_ninit=no]) [ac_cv_func_res_ninit=no])
fi
]) ])
if test "$ac_cv_func_res_ninit" = "yes"; then if test "$ac_cv_func_res_ninit" = "yes"; then

View File

@ -2546,7 +2546,11 @@ fi
AC_CACHE_CHECK( AC_CACHE_CHECK(
[for res_ninit()], [for res_ninit()],
ac_cv_func_res_ninit, ac_cv_func_res_ninit,
[AC_TRY_LINK([ [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
dnl no need for res_ninit() on NetBSD and OpenBSD
ac_cv_func_res_ninit=no
else
AC_TRY_LINK([
#ifdef linux #ifdef linux
#define _BSD_SOURCE 1 #define _BSD_SOURCE 1
#endif #endif
@ -2555,6 +2559,7 @@ AC_CACHE_CHECK(
[int foo = res_ninit(&_res);], [int foo = res_ninit(&_res);],
[ac_cv_func_res_ninit=yes], [ac_cv_func_res_ninit=yes],
[ac_cv_func_res_ninit=no]) [ac_cv_func_res_ninit=no])
fi
]) ])
if test "$ac_cv_func_res_ninit" = "yes"; then if test "$ac_cv_func_res_ninit" = "yes"; then