diff options
author | Simon Josefsson <simon@josefsson.org> | 2008-11-17 12:20:11 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2008-11-17 12:20:11 +0100 |
commit | d297478c2603e8ca9dd75daaa50da6ba0b1ee8cf (patch) | |
tree | cb678a95aab18b5a84898842e1ad3a49d7961e97 | |
parent | 7063caea892602fcfe080b5ff43b7c45697891fc (diff) | |
download | gnutls-d297478c2603e8ca9dd75daaa50da6ba0b1ee8cf.tar.gz |
Update gnulib files.
-rw-r--r-- | gl/m4/getaddrinfo.m4 | 24 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 4 | ||||
-rw-r--r-- | gl/m4/sockets.m4 | 37 | ||||
-rwxr-xr-x | gl/tests/test-select-out.sh | 6 | ||||
-rw-r--r-- | lib/gl/m4/sockets.m4 | 37 |
5 files changed, 71 insertions, 37 deletions
diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4 index 1c7b5c33bc..f1cc01da12 100644 --- a/gl/m4/getaddrinfo.m4 +++ b/gl/m4/getaddrinfo.m4 @@ -1,4 +1,4 @@ -# 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, @@ -76,25 +76,9 @@ AC_DEFUN([gl_GETADDRINFO], 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]) diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index 4dc6125c14..12870c683b 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -102,6 +102,7 @@ AC_SUBST([LTALLOCA]) 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 @@ -139,6 +140,7 @@ AC_SUBST([LTALLOCA]) 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]) @@ -425,6 +427,7 @@ AC_DEFUN([gl_FILE_LIST], [ 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 @@ -445,6 +448,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/read-file.m4 m4/readline.m4 m4/realloc.m4 + m4/servent.m4 m4/size_max.m4 m4/snprintf.m4 m4/sockets.m4 diff --git a/gl/m4/sockets.m4 b/gl/m4/sockets.m4 index c7bd6646a6..124e777a5e 100644 --- a/gl/m4/sockets.m4 +++ b/gl/m4/sockets.m4 @@ -1,4 +1,4 @@ -# 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, @@ -32,8 +32,10 @@ AC_DEFUN([gl_SOCKETS], 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" @@ -41,18 +43,39 @@ AC_DEFUN([gl_SOCKETS], 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]) diff --git a/gl/tests/test-select-out.sh b/gl/tests/test-select-out.sh index 488dccd0c8..556aae7b45 100755 --- a/gl/tests/test-select-out.sh +++ b/gl/tests/test-select-out.sh @@ -14,9 +14,9 @@ test `cat t-select-out.tmp` = "1" || exit 1 # 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 diff --git a/lib/gl/m4/sockets.m4 b/lib/gl/m4/sockets.m4 index c7bd6646a6..124e777a5e 100644 --- a/lib/gl/m4/sockets.m4 +++ b/lib/gl/m4/sockets.m4 @@ -1,4 +1,4 @@ -# 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, @@ -32,8 +32,10 @@ AC_DEFUN([gl_SOCKETS], 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" @@ -41,18 +43,39 @@ AC_DEFUN([gl_SOCKETS], 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]) |