diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-10-27 09:22:50 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-10-27 09:22:50 +0200 |
commit | d86ab06220f5148db3a664d5659b4ec3f35d1079 (patch) | |
tree | c3cb111c1c77b773ecf13a49fb521b6a5269bdab /gl/m4 | |
parent | 482635401b91171259c9a027d0bc2faefb7e8c68 (diff) | |
download | gnutls-d86ab06220f5148db3a664d5659b4ec3f35d1079.tar.gz |
Added recv(), send(), connect() and inet_ntop() gnulib modules.
Diffstat (limited to 'gl/m4')
-rw-r--r-- | gl/m4/gnulib-cache.m4 | 6 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 42 | ||||
-rw-r--r-- | gl/m4/inet_ntop.m4 | 68 |
3 files changed, 109 insertions, 7 deletions
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index 33907399f9..4777c60465 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp bind byteswap c-ctype close crypto/hmac-md5 crypto/md5 error extensions func getpass getsubopt gettext gettime havelib inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in progname read-file recvfrom scandir select sendto setsockopt shutdown snprintf socket sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings +# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp bind byteswap c-ctype close connect crypto/hmac-md5 crypto/md5 error extensions func getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in progname read-file recv recvfrom scandir select send sendto setsockopt shutdown snprintf socket sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gl/override]) @@ -40,6 +40,7 @@ gl_MODULES([ byteswap c-ctype close + connect crypto/hmac-md5 crypto/md5 error @@ -50,6 +51,7 @@ gl_MODULES([ gettext gettime havelib + inet_ntop inet_pton lib-msvc-compat lib-symbol-versions @@ -62,9 +64,11 @@ gl_MODULES([ netinet_in progname read-file + recv recvfrom scandir select + send sendto setsockopt shutdown diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index 461cac0d12..1461989c89 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -142,6 +142,8 @@ AC_DEFUN([gl_EARLY], # Code from module ignore-value: # Code from module ignore-value-tests: # Code from module include_next: + # Code from module inet_ntop: + # Code from module inet_ntop-tests: # Code from module inet_pton: # Code from module inet_pton-tests: # Code from module intprops: @@ -213,12 +215,16 @@ AC_DEFUN([gl_EARLY], # Code from module read-file-tests: # Code from module readdir: # Code from module realloc-posix: + # Code from module recv: + # Code from module recv-tests: # Code from module recvfrom: # Code from module recvfrom-tests: # Code from module same-inode: # Code from module scandir: # Code from module select: # Code from module select-tests: + # Code from module send: + # Code from module send-tests: # Code from module sendto: # Code from module sendto-tests: # Code from module setenv: @@ -393,6 +399,11 @@ if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then AC_LIBOBJ([closedir]) fi gl_DIRENT_MODULE_INDICATOR([closedir]) +AC_REQUIRE([gl_HEADER_SYS_SOCKET]) +if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([connect]) +fi +gl_SYS_SOCKET_MODULE_INDICATOR([connect]) gl_MD5 gl_DIRENT_H gl_DIRNAME_LGPL @@ -512,6 +523,12 @@ m4_if(m4_version_compare([2.61a.100], m4_defn([m4_PACKAGE_VERSION])), [1], [], [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], [GNUmakefile=$GNUmakefile])]) +gl_FUNC_INET_NTOP +if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then + AC_LIBOBJ([inet_ntop]) + gl_PREREQ_INET_NTOP +fi +gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) gl_FUNC_INET_PTON if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then AC_LIBOBJ([inet_pton]) @@ -618,6 +635,11 @@ fi gl_STDLIB_MODULE_INDICATOR([realloc-posix]) AC_REQUIRE([gl_HEADER_SYS_SOCKET]) if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([recv]) +fi +gl_SYS_SOCKET_MODULE_INDICATOR([recv]) +AC_REQUIRE([gl_HEADER_SYS_SOCKET]) +if test "$ac_cv_header_winsock2_h" = yes; then AC_LIBOBJ([recvfrom]) fi gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom]) @@ -634,6 +656,11 @@ fi gl_SYS_SELECT_MODULE_INDICATOR([select]) AC_REQUIRE([gl_HEADER_SYS_SOCKET]) if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([send]) +fi +gl_SYS_SOCKET_MODULE_INDICATOR([send]) +AC_REQUIRE([gl_HEADER_SYS_SOCKET]) +if test "$ac_cv_header_winsock2_h" = yes; then AC_LIBOBJ([sendto]) fi gl_SYS_SOCKET_MODULE_INDICATOR([sendto]) @@ -826,11 +853,6 @@ changequote([, ])dnl AC_SUBST([gltests_WITNESS]) gl_module_indicator_condition=$gltests_WITNESS m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([connect]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([connect]) gl_FUNC_DUP2 if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then AC_LIBOBJ([dup2]) @@ -868,6 +890,7 @@ fi gl_UNISTD_MODULE_INDICATOR([getpagesize]) AC_REQUIRE([AC_C_INLINE]) AC_C_BIGENDIAN +AC_C_BIGENDIAN gl_INTTYPES_H gl_INTTYPES_INCOMPLETE gl_FUNC_IOCTL @@ -1092,6 +1115,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/c-ctype.h lib/close.c lib/closedir.c + lib/connect.c lib/dirent-private.h lib/dirent.in.h lib/dirname-lgpl.c @@ -1131,6 +1155,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/gettimeofday.c lib/hmac-md5.c lib/hmac.h + lib/inet_ntop.c lib/inet_pton.c lib/intprops.h lib/isnan.c @@ -1177,9 +1202,11 @@ AC_DEFUN([gl_FILE_LIST], [ lib/read-file.h lib/readdir.c lib/realloc.c + lib/recv.c lib/recvfrom.c lib/scandir.c lib/select.c + lib/send.c lib/sendto.c lib/setsockopt.c lib/shutdown.c @@ -1291,6 +1318,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/gnulib-common.m4 m4/iconv.m4 m4/include_next.m4 + m4/inet_ntop.m4 m4/inet_pton.m4 m4/intdiv0.m4 m4/intl.m4 @@ -1482,6 +1510,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-gettimeofday.c tests/test-hmac-md5.c tests/test-ignore-value.c + tests/test-inet_ntop.c tests/test-inet_pton.c tests/test-intprops.c tests/test-inttypes.c @@ -1516,6 +1545,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-printf-posix.output tests/test-rawmemchr.c tests/test-read-file.c + tests/test-recv.c tests/test-recvfrom.c tests/test-select-fd.c tests/test-select-in.sh @@ -1523,6 +1553,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-select-stdin.c tests/test-select.c tests/test-select.h + tests/test-send.c tests/test-sendto.c tests/test-setenv.c tests/test-setsockopt.c @@ -1579,7 +1610,6 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-wchar.c tests/zerosize-ptr.h tests=lib/binary-io.h - tests=lib/connect.c tests=lib/dup2.c tests=lib/fcntl.in.h tests=lib/fdopen.c diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4 new file mode 100644 index 0000000000..4936fa382f --- /dev/null +++ b/gl/m4/inet_ntop.m4 @@ -0,0 +1,68 @@ +# inet_ntop.m4 serial 19 +dnl Copyright (C) 2005-2006, 2008-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, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_INET_NTOP], +[ + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + + dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_C_RESTRICT]) + + dnl Most platforms that provide inet_ntop define it in libc. + dnl Solaris 8..10 provide inet_ntop in libnsl instead. + dnl Solaris 2.6..7 provide inet_ntop in libresolv instead. + dnl Native Windows provides it in -lws2_32 instead, with a declaration in + dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl + dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it). + HAVE_INET_NTOP=1 + INET_NTOP_LIB= + gl_PREREQ_SYS_H_WINSOCK2 + if test $HAVE_WINSOCK2_H = 1; then + AC_CHECK_DECLS([inet_ntop],,, [[#include <ws2tcpip.h>]]) + if test $ac_cv_have_decl_inet_ntop = yes; then + dnl It needs to be overridden, because the stdcall calling convention + dnl is not compliant with POSIX. + REPLACE_INET_NTOP=1 + INET_NTOP_LIB="-lws2_32" + else + HAVE_DECL_INET_NTOP=0 + HAVE_INET_NTOP=0 + fi + else + gl_save_LIBS=$LIBS + AC_SEARCH_LIBS([inet_ntop], [nsl resolv], [], + [AC_CHECK_FUNCS([inet_ntop]) + if test $ac_cv_func_inet_ntop = no; then + HAVE_INET_NTOP=0 + fi + ]) + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_ntop" != "no" \ + && test "$ac_cv_search_inet_ntop" != "none required"; then + INET_NTOP_LIB="$ac_cv_search_inet_ntop" + fi + + AC_CHECK_HEADERS_ONCE([netdb.h]) + AC_CHECK_DECLS([inet_ntop],,, + [[#include <arpa/inet.h> + #if HAVE_NETDB_H + # include <netdb.h> + #endif + ]]) + if test $ac_cv_have_decl_inet_ntop = no; then + HAVE_DECL_INET_NTOP=0 + fi + fi + AC_SUBST([INET_NTOP_LIB]) +]) + +# Prerequisites of lib/inet_ntop.c. +AC_DEFUN([gl_PREREQ_INET_NTOP], [ + AC_REQUIRE([gl_SOCKET_FAMILIES]) +]) |