-# getaddrinfo.m4 serial 17
+# getaddrinfo.m4 serial 18
dnl Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_PREREQ_GETADDRINFO], [
AC_REQUIRE([gl_NETDB_H_DEFAULTS])
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
- AC_SEARCH_LIBS(gethostbyname, [inet nsl])
- AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet])
- AC_CHECK_FUNCS(gethostbyname,, [
- AC_CACHE_CHECK(for gethostbyname in winsock2.h and -lws2_32,
- gl_cv_w32_gethostbyname, [
- gl_cv_w32_gethostbyname=no
- am_save_LIBS="$LIBS"
- LIBS="$LIBS -lws2_32"
- AC_TRY_LINK([
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#include <stddef.h>
-], [gethostbyname(NULL);], gl_cv_w32_gethostbyname=yes)
- LIBS="$am_save_LIBS"])
- if test "$gl_cv_w32_gethostbyname" = "yes"; then
- LIBS="$LIBS -lws2_32"
- fi
- ])
+ AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB
+ AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB
+ LIBS="$LIBS $HOSTENT_LIB $SERVENT_LIB"
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_SOCKET_FAMILIES])
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
m4_defn([m4_PACKAGE_VERSION])), [1], [],
[AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
[GNUmakefile=$GNUmakefile])])
+ gl_HOSTENT
gl_INET_NTOP
gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
gl_INET_PTON
AC_LIBOBJ([send])
fi
gl_SYS_SOCKET_MODULE_INDICATOR([send])
+ gl_SERVENT
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
if test "$ac_cv_header_winsock2_h" = yes; then
AC_LIBOBJ([setsockopt])
m4/getpass.m4
m4/gettimeofday.m4
m4/gnulib-common.m4
+ m4/hostent.m4
m4/include_next.m4
m4/inet_ntop.m4
m4/inet_pton.m4
m4/read-file.m4
m4/readline.m4
m4/realloc.m4
+ m4/servent.m4
m4/size_max.m4
m4/snprintf.m4
m4/sockets.m4
-# sockets.m4 serial 2
+# sockets.m4 serial 3
dnl Copyright (C) 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
else
dnl Unix API.
dnl Solaris has most socket functions in libsocket.
- AC_CACHE_CHECK([whether setsockopt requires -lsocket], [gl_cv_lib_socket], [
- gl_cv_lib_socket=no
+ dnl Haiku has most socket functions in libnetwork.
+ dnl BeOS has most socket functions in libnet.
+ AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [
+ gl_cv_lib_socket=
AC_TRY_LINK([extern
#ifdef __cplusplus
"C"
char setsockopt();], [setsockopt();],
[],
[gl_save_LIBS="$LIBS"
- LIBS="$LIBS -lsocket"
+ LIBS="$gl_save_LIBS -lsocket"
AC_TRY_LINK([extern
#ifdef __cplusplus
"C"
#endif
char setsockopt();], [setsockopt();],
- [gl_cv_lib_socket=yes])
+ [gl_cv_lib_socket="-lsocket"])
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnetwork"
+ AC_TRY_LINK([extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();], [setsockopt();],
+ [gl_cv_lib_socket="-lnetwork"])
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnet"
+ AC_TRY_LINK([extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();], [setsockopt();],
+ [gl_cv_lib_socket="-lnet"])
+ fi
+ fi
LIBS="$gl_save_LIBS"
])
+ if test -z "$gl_cv_lib_socket"; then
+ gl_cv_lib_socket="none needed"
+ fi
])
- if test $gl_cv_lib_socket = yes; then
- LIBSOCKET='-lsocket'
+ if test "$gl_cv_lib_socket" != "none needed"; then
+ LIBSOCKET="$gl_cv_lib_socket"
fi
fi
AC_SUBST([LIBSOCKET])
# Pipes.
-#rm -f t-select-out.tmp
-#( { echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null
-#test `cat t-select-out.tmp` = "0" || exit 1
+rm -f t-select-out.tmp
+( { echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null
+test `cat t-select-out.tmp` = "0" || exit 1
rm -f t-select-out.tmp
( { sleep 1; echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | cat) > /dev/null
-# sockets.m4 serial 2
+# sockets.m4 serial 3
dnl Copyright (C) 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
else
dnl Unix API.
dnl Solaris has most socket functions in libsocket.
- AC_CACHE_CHECK([whether setsockopt requires -lsocket], [gl_cv_lib_socket], [
- gl_cv_lib_socket=no
+ dnl Haiku has most socket functions in libnetwork.
+ dnl BeOS has most socket functions in libnet.
+ AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [
+ gl_cv_lib_socket=
AC_TRY_LINK([extern
#ifdef __cplusplus
"C"
char setsockopt();], [setsockopt();],
[],
[gl_save_LIBS="$LIBS"
- LIBS="$LIBS -lsocket"
+ LIBS="$gl_save_LIBS -lsocket"
AC_TRY_LINK([extern
#ifdef __cplusplus
"C"
#endif
char setsockopt();], [setsockopt();],
- [gl_cv_lib_socket=yes])
+ [gl_cv_lib_socket="-lsocket"])
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnetwork"
+ AC_TRY_LINK([extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();], [setsockopt();],
+ [gl_cv_lib_socket="-lnetwork"])
+ if test -z "$gl_cv_lib_socket"; then
+ LIBS="$gl_save_LIBS -lnet"
+ AC_TRY_LINK([extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();], [setsockopt();],
+ [gl_cv_lib_socket="-lnet"])
+ fi
+ fi
LIBS="$gl_save_LIBS"
])
+ if test -z "$gl_cv_lib_socket"; then
+ gl_cv_lib_socket="none needed"
+ fi
])
- if test $gl_cv_lib_socket = yes; then
- LIBSOCKET='-lsocket'
+ if test "$gl_cv_lib_socket" != "none needed"; then
+ LIBSOCKET="$gl_cv_lib_socket"
fi
fi
AC_SUBST([LIBSOCKET])