diff options
-rwxr-xr-x | build-aux/gnupload | 2 | ||||
-rw-r--r-- | gl/Makefile.am | 1 | ||||
-rw-r--r-- | gl/m4/sys_socket_h.m4 | 7 | ||||
-rw-r--r-- | gl/sys_socket.in.h | 4 | ||||
-rw-r--r-- | gl/tests/test-sys_socket.c | 2 | ||||
-rw-r--r-- | lib/gl/Makefile.am | 1 | ||||
-rw-r--r-- | lib/gl/m4/sys_socket_h.m4 | 7 | ||||
-rw-r--r-- | lib/gl/sys_socket.in.h | 4 | ||||
-rw-r--r-- | lib/gl/tests/test-sys_socket.c | 2 | ||||
-rw-r--r-- | maint.mk | 2 |
10 files changed, 28 insertions, 4 deletions
diff --git a/build-aux/gnupload b/build-aux/gnupload index 002cee39a7..8320b58cf5 100755 --- a/build-aux/gnupload +++ b/build-aux/gnupload @@ -7,7 +7,7 @@ scriptversion=2009-04-28.21; # UTC # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) +# the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, diff --git a/gl/Makefile.am b/gl/Makefile.am index 60870dae3e..e04d7f4540 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -918,6 +918,7 @@ sys/socket.h: sys_socket.in.h -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \ + -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/sys_socket.in.h; \ } > $@-t diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4 index d1cb9c20a0..74e8110c05 100644 --- a/gl/m4/sys_socket_h.m4 +++ b/gl/m4/sys_socket_h.m4 @@ -42,7 +42,7 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET], fi # We need to check for ws2tcpip.h now. gl_PREREQ_SYS_H_SOCKET - AC_CHECK_TYPES([struct sockaddr_storage],,,[ + AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -58,6 +58,10 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET], HAVE_STRUCT_SOCKADDR_STORAGE=0 SYS_SOCKET_H='sys/socket.h' fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + SYS_SOCKET_H='sys/socket.h' + fi if test -n "$SYS_SOCKET_H"; then gl_PREREQ_SYS_H_WINSOCK2 fi @@ -137,4 +141,5 @@ AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) + HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T]) ]) diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h index dadd56ac58..26577dfaa0 100644 --- a/gl/sys_socket.in.h +++ b/gl/sys_socket.in.h @@ -43,6 +43,10 @@ #ifndef _GL_SYS_SOCKET_H #define _GL_SYS_SOCKET_H +#if !@HAVE_SA_FAMILY_T@ +typedef unsigned short sa_family_t; +#endif + #if !@HAVE_STRUCT_SOCKADDR_STORAGE@ # include <alignof.h> /* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on diff --git a/gl/tests/test-sys_socket.c b/gl/tests/test-sys_socket.c index fe7688e5c6..3d946a83bf 100644 --- a/gl/tests/test-sys_socket.c +++ b/gl/tests/test-sys_socket.c @@ -31,6 +31,7 @@ int main () { struct sockaddr_storage x; + sa_family_t i; /* Check some errno values. */ switch (0) @@ -46,6 +47,7 @@ main () } x.ss_family = 42; + i = 4711; return 0; } diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am index b512e46474..4cc2ae556c 100644 --- a/lib/gl/Makefile.am +++ b/lib/gl/Makefile.am @@ -650,6 +650,7 @@ sys/socket.h: sys_socket.in.h -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \ + -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ < $(srcdir)/sys_socket.in.h; \ } > $@-t diff --git a/lib/gl/m4/sys_socket_h.m4 b/lib/gl/m4/sys_socket_h.m4 index d1cb9c20a0..74e8110c05 100644 --- a/lib/gl/m4/sys_socket_h.m4 +++ b/lib/gl/m4/sys_socket_h.m4 @@ -42,7 +42,7 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET], fi # We need to check for ws2tcpip.h now. gl_PREREQ_SYS_H_SOCKET - AC_CHECK_TYPES([struct sockaddr_storage],,,[ + AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ @@ -58,6 +58,10 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET], HAVE_STRUCT_SOCKADDR_STORAGE=0 SYS_SOCKET_H='sys/socket.h' fi + if test $ac_cv_type_sa_family_t = no; then + HAVE_SA_FAMILY_T=0 + SYS_SOCKET_H='sys/socket.h' + fi if test -n "$SYS_SOCKET_H"; then gl_PREREQ_SYS_H_WINSOCK2 fi @@ -137,4 +141,5 @@ AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) + HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T]) ]) diff --git a/lib/gl/sys_socket.in.h b/lib/gl/sys_socket.in.h index efe5fff361..b598037928 100644 --- a/lib/gl/sys_socket.in.h +++ b/lib/gl/sys_socket.in.h @@ -43,6 +43,10 @@ #ifndef _GL_SYS_SOCKET_H #define _GL_SYS_SOCKET_H +#if !@HAVE_SA_FAMILY_T@ +typedef unsigned short sa_family_t; +#endif + #if !@HAVE_STRUCT_SOCKADDR_STORAGE@ # include <alignof.h> /* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on diff --git a/lib/gl/tests/test-sys_socket.c b/lib/gl/tests/test-sys_socket.c index fe7688e5c6..3d946a83bf 100644 --- a/lib/gl/tests/test-sys_socket.c +++ b/lib/gl/tests/test-sys_socket.c @@ -31,6 +31,7 @@ int main () { struct sockaddr_storage x; + sa_family_t i; /* Check some errno values. */ switch (0) @@ -46,6 +47,7 @@ main () } x.ss_family = 42; + i = 4711; return 0; } @@ -638,7 +638,7 @@ built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list) rel-files = $(DIST_ARCHIVES) -gnulib_dir ?= gnulib +gnulib_dir ?= $(srcdir)/gnulib gnulib-version = $$(cd $(gnulib_dir) && git describe) bootstrap-tools ?= autoconf,automake,gnulib |