+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.
-# 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,
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>
GETADDRINFO_LIB="-lws2_32"
LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
else
- AC_LIBOBJ([getaddrinfo])
+ HAVE_GETADDRINFO=0
fi
fi
#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], [
[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
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: