changeset 32290:33d9f6230dff

Simplify inet_pton/inet_aton checks with function_check().
author diego
date Sun, 26 Sep 2010 21:51:39 +0000
parents f590821ec633
children 7a7456aea7d8
files configure
diffstat 1 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sun Sep 26 21:48:28 2010 +0000
+++ b/configure	Sun Sep 26 21:51:39 2010 +0000
@@ -3254,14 +3254,8 @@
 echocheck "inet_pton()"
 def_inet_pton='#define HAVE_INET_PTON 0'
 inet_pton=no
-cat > $TMPC << EOF
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-int main(void) { inet_pton(0, 0, 0); return 0; }
-EOF
 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
-  cc_check $_ld_tmp && inet_pton=yes && break
+  function_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
 done
 if test $inet_pton = yes ; then
   test "$_ld_tmp" && res_comment="using $_ld_tmp"
@@ -3273,14 +3267,8 @@
 echocheck "inet_aton()"
 def_inet_aton='#define HAVE_INET_ATON 0'
 inet_aton=no
-cat > $TMPC << EOF
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-int main(void) { inet_aton(0, 0); return 0; }
-EOF
 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
-  cc_check $_ld_tmp && inet_aton=yes && break
+  function_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
 done
 if test $inet_aton = yes ; then
   test "$_ld_tmp" && res_comment="using $_ld_tmp"