Commit 8ca509d0 authored by Bruno Haible's avatar Bruno Haible

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.
parent fdc623a7
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,
......@@ -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
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment