From c87e7888977fd5c4a6282bf77a2ca410b8adb19e Mon Sep 17 00:00:00 2001 From: Martin Husemann Date: Sat, 16 Nov 2013 09:13:23 +0100 Subject: [PATCH] Bug 810716: Avoid AC_TRY_LINK on systems where we do not want res_ninit r=ted --- configure.in | 23 ++++++++++++++--------- js/src/configure.in | 23 ++++++++++++++--------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/configure.in b/configure.in index 670db0deb49d..debc62b61173 100644 --- a/configure.in +++ b/configure.in @@ -3096,15 +3096,20 @@ fi AC_CACHE_CHECK( [for res_ninit()], ac_cv_func_res_ninit, - [AC_TRY_LINK([ - #ifdef linux - #define _BSD_SOURCE 1 - #endif - #include - ], - [int foo = res_ninit(&_res);], - [ac_cv_func_res_ninit=yes], - [ac_cv_func_res_ninit=no]) + [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 + #define _BSD_SOURCE 1 + #endif + #include + ], + [int foo = res_ninit(&_res);], + [ac_cv_func_res_ninit=yes], + [ac_cv_func_res_ninit=no]) + fi ]) if test "$ac_cv_func_res_ninit" = "yes"; then diff --git a/js/src/configure.in b/js/src/configure.in index bb900b5b8c3b..1dc32a83399d 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -2546,15 +2546,20 @@ fi AC_CACHE_CHECK( [for res_ninit()], ac_cv_func_res_ninit, - [AC_TRY_LINK([ - #ifdef linux - #define _BSD_SOURCE 1 - #endif - #include - ], - [int foo = res_ninit(&_res);], - [ac_cv_func_res_ninit=yes], - [ac_cv_func_res_ninit=no]) + [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 + #define _BSD_SOURCE 1 + #endif + #include + ], + [int foo = res_ninit(&_res);], + [ac_cv_func_res_ninit=yes], + [ac_cv_func_res_ninit=no]) + fi ]) if test "$ac_cv_func_res_ninit" = "yes"; then