getaddrinfo: Move AC_LIBOBJ invocations to module description.
authorBruno Haible <bruno@clisp.org>
Sun, 8 May 2011 22:20:21 +0000 (00:20 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Jun 2011 22:06:11 +0000 (00:06 +0200)
* m4/getaddrinfo.m4 (gl_GETADDRINFO): Set HAVE_GETADDRINFO, Move
AC_LIBOBJ invocations from here...
* modules/getaddrinfo (configure.ac): ... to here.
(Depends-on): Add conditions.

ChangeLog
m4/getaddrinfo.m4
modules/getaddrinfo

index ca65ee4..efeb4c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-05-08  Bruno Haible  <bruno@clisp.org>
 
+       getaddrinfo: Move AC_LIBOBJ invocations to module description.
+       * m4/getaddrinfo.m4 (gl_GETADDRINFO): Set HAVE_GETADDRINFO, Move
+       AC_LIBOBJ invocations from here...
+       * modules/getaddrinfo (configure.ac): ... to here.
+       (Depends-on): Add conditions.
+
+2011-05-08  Bruno Haible  <bruno@clisp.org>
+
        inet_pton. getaddrinfo: Respect rules for use of AC_LIBOBJ.
        * m4/inet_pton.m4 (gl_FUNC_INET_PTON): Set HAVE_INET_PTON. Call
        AC_CHECK_FUNCS instead of AC_REPLACE_FUNCS. Don't invoke
index f29e903..20a6226 100644 (file)
@@ -1,4 +1,4 @@
-# getaddrinfo.m4 serial 25
+# getaddrinfo.m4 serial 26
 dnl Copyright (C) 2004-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -24,6 +24,7 @@ AC_DEFUN([gl_GETADDRINFO],
      fi])
   LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
 
+  HAVE_GETADDRINFO=1
   AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
@@ -55,7 +56,7 @@ AC_DEFUN([gl_GETADDRINFO],
       GETADDRINFO_LIB="-lws2_32"
       LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
     else
-      AC_LIBOBJ([getaddrinfo])
+      HAVE_GETADDRINFO=0
     fi
   fi
 
@@ -75,9 +76,7 @@ AC_DEFUN([gl_GETADDRINFO],
 #endif
 #include <stddef.h>
 ]])
-  if test $ac_cv_have_decl_gai_strerror = no; then
-    AC_LIBOBJ([gai_strerror])
-  else
+  if test $ac_cv_have_decl_gai_strerror = yes; then
     dnl check for correct signature
     AC_CACHE_CHECK([for gai_strerror with POSIX signature],
      [gl_cv_func_gai_strerror_posix_signature], [
@@ -98,7 +97,6 @@ extern const char *gai_strerror(int);]])],
         [gl_cv_func_gai_strerror_posix_signature=no])])
     if test $gl_cv_func_gai_strerror_posix_signature = no; then
       REPLACE_GAI_STRERROR=1
-      AC_LIBOBJ([gai_strerror])
     fi
   fi
 
index 1aa7208..8de2955 100644 (file)
@@ -7,20 +7,26 @@ lib/gai_strerror.c
 m4/getaddrinfo.m4
 
 Depends-on:
-extensions
-gettext-h
-inet_ntop
-snprintf
-stdbool
-sys_socket
 netdb
-strdup
-servent
-hostent
-sockets
+sys_socket
+extensions
+gettext-h       [test $HAVE_GETADDRINFO = 0 || test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1]
+inet_ntop       [test $HAVE_GETADDRINFO = 0]
+snprintf        [test $HAVE_GETADDRINFO = 0]
+stdbool         [test $HAVE_GETADDRINFO = 0]
+strdup          [test $HAVE_GETADDRINFO = 0]
+servent         [test $HAVE_GETADDRINFO = 0]
+hostent         [test $HAVE_GETADDRINFO = 0]
+sockets         [test $HAVE_GETADDRINFO = 0]
 
 configure.ac:
 gl_GETADDRINFO
+if test $HAVE_GETADDRINFO = 0; then
+  AC_LIBOBJ([getaddrinfo])
+fi
+if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then
+  AC_LIBOBJ([gai_strerror])
+fi
 gl_NETDB_MODULE_INDICATOR([getaddrinfo])
 
 Makefile.am: