Bug 810716: Avoid AC_TRY_LINK on systems where we do not want res_ninit r=ted
authorMartin Husemann <martin@netbsd.org>
Sat, 16 Nov 2013 09:13:23 +0100
changeset 154951 362b06bd93633cb80cf0fec568285840238f58a2
parent 154950 a434e4fc3482b4841b48c566b4047be2c3f9c02b
child 154952 cde2604ee22bc22358e338efee9a5cdcac060395
push id36180
push userlandry@openbsd.org
push dateSat, 16 Nov 2013 08:13:57 +0000
treeherdermozilla-inbound@362b06bd9363 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs810716
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 810716: Avoid AC_TRY_LINK on systems where we do not want res_ninit r=ted
configure.in
js/src/configure.in
--- a/configure.in
+++ b/configure.in
@@ -3091,25 +3091,30 @@ if test "$ac_cv_have_mbrtowc" = "yes"; t
     AC_DEFINE(HAVE_MBRTOWC)
 fi
 AC_LANG_RESTORE
 fi
 
 AC_CACHE_CHECK(
     [for res_ninit()],
     ac_cv_func_res_ninit,
-    [AC_TRY_LINK([
-        #ifdef linux
-        #define _BSD_SOURCE 1
-        #endif
-        #include <resolv.h>
-        ],
-        [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 <resolv.h>
+            ],
+            [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
     AC_DEFINE(HAVE_RES_NINIT)
 dnl must add the link line we do something as foolish as this... dougt
 dnl else
 dnl    AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
 dnl        AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -2541,25 +2541,30 @@ if test "$ac_cv_have_mbrtowc" = "yes"; t
     AC_DEFINE(HAVE_MBRTOWC)
 fi
 AC_LANG_RESTORE
 fi
 
 AC_CACHE_CHECK(
     [for res_ninit()],
     ac_cv_func_res_ninit,
-    [AC_TRY_LINK([
-        #ifdef linux
-        #define _BSD_SOURCE 1
-        #endif
-        #include <resolv.h>
-        ],
-        [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 <resolv.h>
+            ],
+            [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
     AC_DEFINE(HAVE_RES_NINIT)
 dnl must add the link line we do something as foolish as this... dougt
 dnl else
 dnl    AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
 dnl        AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))