summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-05-09 00:20:21 +0200
committerBruno Haible <bruno@clisp.org>2011-06-16 00:06:11 +0200
commit8ca509d08317df62371980106295d87d950ec989 (patch)
tree82a9d1a9d49aaa7b68ca96b7c5cf9fe2ab60e4a1
parentfdc623a74665b333f5f376ff3d63d39c7375a306 (diff)
downloadgnulib-8ca509d08317df62371980106295d87d950ec989.tar.gz
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.
-rw-r--r--ChangeLog8
-rw-r--r--m4/getaddrinfo.m410
-rw-r--r--modules/getaddrinfo26
3 files changed, 28 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index ca65ee4230..efeb4c4934 100644
--- 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
diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4
index f29e903987..20a6226118 100644
--- a/m4/getaddrinfo.m4
+++ b/m4/getaddrinfo.m4
@@ -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
diff --git a/modules/getaddrinfo b/modules/getaddrinfo
index 1aa7208039..8de29558c6 100644
--- a/modules/getaddrinfo
+++ b/modules/getaddrinfo
@@ -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: