diff options
Diffstat (limited to 'ares/configure.ac')
-rw-r--r-- | ares/configure.ac | 81 |
1 files changed, 54 insertions, 27 deletions
diff --git a/ares/configure.ac b/ares/configure.ac index 9653a2a7e..d3304ae01 100644 --- a/ares/configure.ac +++ b/ares/configure.ac @@ -212,16 +212,18 @@ then AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs]) my_ac_save_LIBS=$LIBS LIBS="-lnsl -lsocket $LIBS" - AC_TRY_LINK( , - [gethostbyname();], - [ dnl found it! - HAVE_GETHOSTBYNAME="1" - AC_MSG_RESULT([yes])], - [ dnl failed! - AC_MSG_RESULT([no]) - dnl restore LIBS - LIBS=$my_ac_save_LIBS] - ) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + gethostbyname(); + ]]) + ],[ + AC_MSG_RESULT([yes]) + HAVE_GETHOSTBYNAME="1" + ],[ + AC_MSG_RESULT([no]) + LIBS=$my_ac_save_LIBS + ]) fi if test "$HAVE_GETHOSTBYNAME" != "1" @@ -245,7 +247,8 @@ then my_ac_save_LIBS=$LIBS LIBS="$winsock_LIB $LIBS" AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) - AC_TRY_LINK([ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ #ifdef HAVE_WINDOWS_H #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN @@ -259,15 +262,16 @@ then #endif #endif #endif - ],[ + ]],[[ gethostbyname("www.dummysite.com"); - ],[ - AC_MSG_RESULT([yes]) - HAVE_GETHOSTBYNAME="1" - ],[ - AC_MSG_RESULT([no]) - winsock_LIB="" - LIBS=$my_ac_save_LIBS + ]]) + ],[ + AC_MSG_RESULT([yes]) + HAVE_GETHOSTBYNAME="1" + ],[ + AC_MSG_RESULT([no]) + winsock_LIB="" + LIBS=$my_ac_save_LIBS ]) fi fi @@ -275,17 +279,40 @@ fi if test "$HAVE_GETHOSTBYNAME" != "1" then + dnl This is for Minix 3.1 + AC_MSG_CHECKING([for gethostbyname for Minix 3]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ +/* Older Minix versions may need <net/gen/netdb.h> here instead */ +#include <netdb.h> + ]],[[ + gethostbyname("www.dummysite.com"); + ]]) + ],[ + AC_MSG_RESULT([yes]) + HAVE_GETHOSTBYNAME="1" + ],[ + AC_MSG_RESULT([no]) + ]) +fi + +if test "$HAVE_GETHOSTBYNAME" != "1" +then dnl This is for eCos with a stubbed DNS implementation AC_MSG_CHECKING([for gethostbyname for eCos]) - AC_TRY_LINK([ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ #include <stdio.h> -#include <netdb.h>], - [gethostbyname("www.dummysite.com");], - [ dnl worked! - AC_MSG_RESULT([yes]) - HAVE_GETHOSTBYNAME="1"], - AC_MSG_RESULT(no) - ) +#include <netdb.h> + ]],[[ + gethostbyname("www.dummysite.com"); + ]]) + ],[ + AC_MSG_RESULT([yes]) + HAVE_GETHOSTBYNAME="1" + ],[ + AC_MSG_RESULT([no]) + ]) fi if test "$HAVE_GETHOSTBYNAME" != "1" |