Allow systems without recognisable gethostby{addr,name}_r to fail the tests
authorphampson <phampson>
Fri, 22 Aug 2003 16:42:31 +0000 (16:42 +0000)
committerphampson <phampson>
Fri, 22 Aug 2003 16:42:31 +0000 (16:42 +0000)
and select gethostby{addr,name}, rather than passing GNU-style tests with
warnings, and then failing to link.

Thanks to Oliver Graf <ograf@rz-online.net>.

configure.in

index 8067b0f..3744e73 100644 (file)
@@ -648,18 +648,18 @@ fi
 
 gethostbyaddrrstyle=""
 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
-AC_TRY_COMPILE([#include <netdb.h>], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
+AC_TRY_LINK([#include <netdb.h>], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
        AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE)
        gethostbyaddrrstyle=GNU
 ])
 if test "x$gethostbyaddrrstyle" = "x"; then
-       AC_TRY_COMPILE([#include <netdb.h>], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
+       AC_TRY_LINK([#include <netdb.h>], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
                AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE)
                gethostbyaddrrstyle=SYSV
        ])
 fi
 if test "x$gethostbyaddrrstyle" = "x"; then
-       AC_TRY_COMPILE([#include <netdb.h>], [ gethostbyaddr(NULL, 0, 0)  ], [
+       AC_TRY_LINK([#include <netdb.h>], [ gethostbyaddr(NULL, 0, 0)  ], [
                AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
                gethostbyaddrrstyle=BSD
                AC_MSG_WARN([ ****** BSD Style gethostbyaddr might NOT be thread-safe! ****** ])
@@ -674,18 +674,18 @@ fi
 
 gethostbynamerstyle=""
 AC_MSG_CHECKING([gethostbyname_r() syntax])
-AC_TRY_COMPILE([#include <netdb.h>], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
+AC_TRY_LINK([#include <netdb.h>], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
        AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE)
        gethostbynamerstyle=GNU
 ])
 if test "x$gethostbynamerstyle" = "x"; then
-       AC_TRY_COMPILE([#include <netdb.h>], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
+       AC_TRY_LINK([#include <netdb.h>], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
                AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE)
                gethostbynamerstyle=SYSV
        ])
 fi
 if test "x$gethostbynamerstyle" = "x"; then
-       AC_TRY_COMPILE([#include <netdb.h>], [ gethostbyname(NULL)  ], [
+       AC_TRY_LINK([#include <netdb.h>], [ gethostbyname(NULL)  ], [
                AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE)
                gethostbynamerstyle=BSD
                AC_MSG_WARN([ ****** BSD Style gethostbyname might NOT be thread-safe! ****** ])