summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-10-30 15:29:21 +0100
committerSimon Josefsson <simon@josefsson.org>2008-10-30 15:29:21 +0100
commitc26849cfd1875820ae39b73b6a806840bf86fb65 (patch)
treeb854584633a078ddab6c14eec42fd4cf96f1021b
parent94206092ba19455c1c0bab71e14af47228e83271 (diff)
downloadgnutls-c26849cfd1875820ae39b73b6a806840bf86fb65.tar.gz
Update gnulib files.
-rwxr-xr-xbuild-aux/config.rpath34
-rw-r--r--lib/gl/Makefile.am15
-rw-r--r--lib/gl/m4/gnulib-cache.m410
-rw-r--r--lib/gl/m4/gnulib-comp.m413
-rw-r--r--lib/gl/m4/stdlib_h.m444
-rw-r--r--lib/gl/m4/sys_ioctl_h.m460
-rw-r--r--lib/gl/m4/sys_socket_h.m47
-rw-r--r--lib/gl/stdlib.in.h54
-rw-r--r--lib/gl/sys_socket.in.h10
-rw-r--r--lib/gl/sys_stat.in.h19
-rw-r--r--lib/gl/tests/Makefile.am4
-rw-r--r--lib/gl/unistd.in.h54
12 files changed, 195 insertions, 129 deletions
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
index c547c68825..85c2f209be 100755
--- a/build-aux/config.rpath
+++ b/build-aux/config.rpath
@@ -2,7 +2,7 @@
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
-# Copyright 1996-2007 Free Software Foundation, Inc.
+# Copyright 1996-2008 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
@@ -47,7 +47,7 @@ for cc_temp in $CC""; do
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
-# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
@@ -64,7 +64,7 @@ else
;;
esac
;;
- mingw* | cygwin* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
@@ -76,7 +76,13 @@ else
;;
linux* | k*bsd*-gnu)
case $cc_basename in
- icc* | ecc*)
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
wl='-Wl,'
;;
pgcc | pgf77 | pgf90)
@@ -124,7 +130,7 @@ else
esac
fi
-# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
@@ -132,7 +138,7 @@ hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -158,7 +164,7 @@ if test "$with_gnu_ld" = yes; then
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
@@ -182,7 +188,7 @@ if test "$with_gnu_ld" = yes; then
ld_shlibs=no
fi
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
@@ -254,7 +260,7 @@ else
hardcode_direct=unsupported
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -264,7 +270,7 @@ else
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -326,7 +332,7 @@ else
;;
bsdi[45]*)
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -494,7 +500,7 @@ else
fi
# Check dynamic linker characteristics
-# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
@@ -505,7 +511,7 @@ case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
- aix4* | aix5*)
+ aix[4-9]*)
library_names_spec='$libname$shrext'
;;
amigaos*)
@@ -517,7 +523,7 @@ case "$host_os" in
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index 00e8eb9db9..22779cd5da 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=lgl/override --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --tests-base=lgl/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files byteswap c-ctype fseeko func gettext memmem-simple memmove minmax netdb read-file snprintf socklen stdint strcase strverscmp sys_socket sys_stat time_r unistd vasprintf
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=liblgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=../build-aux --with-tests --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files byteswap c-ctype fseeko func gettext memmem-simple memmove minmax netdb read-file snprintf socklen stdint strcase strverscmp sys_socket sys_stat time_r unistd vasprintf
AUTOMAKE_OPTIONS = 1.5 gnits
@@ -147,7 +147,7 @@ EXTRA_liblgnu_la_SOURCES += fseeko.c
# "gettextize --intl".
AM_CPPFLAGS += -I$(top_builddir)/intl
-EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
+EXTRA_DIST += $(top_srcdir)/../build-aux/config.rpath
## end gnulib module gettext
@@ -160,15 +160,15 @@ liblgnu_la_SOURCES += gettext.h
## begin gnulib module havelib
-EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
+EXTRA_DIST += $(top_srcdir)/../build-aux/config.rpath
## end gnulib module havelib
## begin gnulib module link-warning
-LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
+LINK_WARNING_H=$(top_srcdir)/../build-aux/link-warning.h
-EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h
+EXTRA_DIST += $(top_srcdir)/../build-aux/link-warning.h
## end gnulib module link-warning
@@ -443,6 +443,7 @@ stdlib.h: stdlib.in.h
-e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
-e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
-e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
+ -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
-e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
-e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
-e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
@@ -455,11 +456,13 @@ stdlib.h: stdlib.in.h
-e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
-e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
+ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
-e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
-e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
+ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
@@ -620,7 +623,7 @@ sys/socket.h: sys_socket.in.h
-e 's|@''GNULIB_GETSOCKOPT''@|$(GNULIB_GETSOCKOPT)|g' \
-e 's|@''GNULIB_LISTEN''@|$(GNULIB_LISTEN)|g' \
-e 's|@''GNULIB_RECV''@|$(GNULIB_RECV)|g' \
- -e 's|@''GNULIB_SEND''@|$()GNULIB_SEND|g' \
+ -e 's|@''GNULIB_SEND''@|$(GNULIB_SEND)|g' \
-e 's|@''GNULIB_RECVFROM''@|$(GNULIB_RECVFROM)|g' \
-e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
-e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
diff --git a/lib/gl/m4/gnulib-cache.m4 b/lib/gl/m4/gnulib-cache.m4
index 53904df27b..201d75a39c 100644
--- a/lib/gl/m4/gnulib-cache.m4
+++ b/lib/gl/m4/gnulib-cache.m4
@@ -15,10 +15,10 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=lgl/override --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --tests-base=lgl/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files byteswap c-ctype fseeko func gettext memmem-simple memmove minmax netdb read-file snprintf socklen stdint strcase strverscmp sys_socket sys_stat time_r unistd vasprintf
+# gnulib-tool --import --dir=. --local-dir=gl/override --lib=liblgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=../build-aux --with-tests --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files byteswap c-ctype fseeko func gettext memmem-simple memmove minmax netdb read-file snprintf socklen stdint strcase strverscmp sys_socket sys_stat time_r unistd vasprintf
# Specification in the form of a few gnulib-tool.m4 macro invocations:
-gl_LOCAL_DIR([lgl/override])
+gl_LOCAL_DIR([gl/override])
gl_MODULES([
byteswap
c-ctype
@@ -42,11 +42,11 @@ gl_MODULES([
vasprintf
])
gl_AVOID([])
-gl_SOURCE_BASE([lgl])
-gl_M4_BASE([lgl/m4])
+gl_SOURCE_BASE([gl])
+gl_M4_BASE([gl/m4])
gl_PO_BASE([])
gl_DOC_BASE([doc])
-gl_TESTS_BASE([lgl/tests])
+gl_TESTS_BASE([gl/tests])
gl_WITH_TESTS
gl_LIB([liblgnu])
gl_LGPL([2])
diff --git a/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index 664019419c..37bff464a8 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/gl/m4/gnulib-comp.m4
@@ -15,7 +15,7 @@
# In projects using CVS, this file can be treated like other built files.
-# This macro should be invoked from ./configure.in, in the section
+# This macro should be invoked from ./configure.ac, in the section
# "Checks for programs", right after AC_PROG_CC, and certainly before
# any checks for libraries, header files, types and library functions.
AC_DEFUN([lgl_EARLY],
@@ -30,7 +30,7 @@ AC_DEFUN([lgl_EARLY],
AC_REQUIRE([AC_FUNC_FSEEKO])
])
-# This macro should be invoked from ./configure.in, in the section
+# This macro should be invoked from ./configure.ac, in the section
# "Check for header files, types and library functions".
AC_DEFUN([lgl_INIT],
[
@@ -42,7 +42,7 @@ AC_DEFUN([lgl_INIT],
m4_pushdef([lgl_LIBSOURCES_LIST], [])
m4_pushdef([lgl_LIBSOURCES_DIR], [])
gl_COMMON
- gl_source_base='lgl'
+ gl_source_base='gl'
gl_FUNC_ALLOCA
gl_BYTESWAP
gl_HEADER_ERRNO_H
@@ -133,7 +133,7 @@ AC_DEFUN([lgl_INIT],
m4_pushdef([lgltests_LIBSOURCES_LIST], [])
m4_pushdef([lgltests_LIBSOURCES_DIR], [])
gl_COMMON
- gl_source_base='lgl/tests'
+ gl_source_base='gl/tests'
gt_TYPE_WCHAR_T
gt_TYPE_WINT_T
AC_CHECK_FUNCS([shutdown])
@@ -192,7 +192,7 @@ AC_DEFUN([lgl_REPLACE_FUNCS], [
AC_DEFUN([lgl_LIBSOURCES], [
m4_foreach([_gl_NAME], [$1], [
m4_if(_gl_NAME, [alloca.c], [], [
- m4_define([lgl_LIBSOURCES_DIR], [lgl])
+ m4_define([lgl_LIBSOURCES_DIR], [gl])
m4_append([lgl_LIBSOURCES_LIST], _gl_NAME, [ ])
])
])
@@ -219,7 +219,7 @@ AC_DEFUN([lgltests_REPLACE_FUNCS], [
AC_DEFUN([lgltests_LIBSOURCES], [
m4_foreach([_gl_NAME], [$1], [
m4_if(_gl_NAME, [alloca.c], [], [
- m4_define([lgltests_LIBSOURCES_DIR], [lgl/tests])
+ m4_define([lgltests_LIBSOURCES_DIR], [gl/tests])
m4_append([lgltests_LIBSOURCES_LIST], _gl_NAME, [ ])
])
])
@@ -335,7 +335,6 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/string_h.m4
m4/strings_h.m4
m4/strverscmp.m4
- m4/sys_ioctl_h.m4
m4/sys_socket_h.m4
m4/sys_stat_h.m4
m4/threadlib.m4
diff --git a/lib/gl/m4/stdlib_h.m4 b/lib/gl/m4/stdlib_h.m4
index 838c5b6683..582db13dff 100644
--- a/lib/gl/m4/stdlib_h.m4
+++ b/lib/gl/m4/stdlib_h.m4
@@ -1,4 +1,4 @@
-# stdlib_h.m4 serial 10
+# stdlib_h.m4 serial 13
dnl Copyright (C) 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,
@@ -8,6 +8,9 @@ AC_DEFUN([gl_STDLIB_H],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
gl_CHECK_NEXT_HEADERS([stdlib.h])
+ AC_CHECK_TYPES([struct random_data],
+ [], [HAVE_STRUCT_RANDOM_DATA=0],
+ [[#include <stdlib.h>]])
])
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
@@ -28,6 +31,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP])
GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP])
GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV])
+ GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R])
GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH])
GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD])
@@ -35,22 +39,24 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL])
GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
- HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX])
- HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
- HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX])
- HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
- HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX])
- HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
- HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
- HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
- HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
- HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
- HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
- HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV])
- HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
- REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
- REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
- REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
- VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV])
+ HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
+ HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX])
+ HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
+ HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX])
+ HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
+ HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX])
+ HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
+ HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
+ HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
+ HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
+ HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
+ HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL])
+ HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
+ HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
+ HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV])
+ HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
+ REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
+ REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
+ REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
+ VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV])
])
diff --git a/lib/gl/m4/sys_ioctl_h.m4 b/lib/gl/m4/sys_ioctl_h.m4
deleted file mode 100644
index 5488039b6c..0000000000
--- a/lib/gl/m4/sys_ioctl_h.m4
+++ /dev/null
@@ -1,60 +0,0 @@
-# sys_ioctl_h.m4 serial 1
-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,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Written by Bruno Haible.
-
-AC_DEFUN([gl_SYS_IOCTL_H],
-[
- dnl Use AC_REQUIRE here, so that the default behavior below is expanded
- dnl once only, before all statements that occur in other macros.
- AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
-
- AC_CHECK_HEADERS_ONCE([sys/ioctl.h])
- if test $ac_cv_header_sys_ioctl_h = yes; then
- HAVE_SYS_IOCTL_H=1
- dnl Test whether <sys/ioctl.h> declares ioctl(), or whether some other
- dnl header file, such as <unistd.h> or <stropts.h>, is needed for that.
- AC_CACHE_CHECK([whether <sys/ioctl.h> declares ioctl],
- [gl_cv_decl_ioctl_in_sys_ioctl_h],
- [AC_CHECK_DECL([ioctl],
- [gl_cv_decl_ioctl_in_sys_ioctl_h=yes],
- [gl_cv_decl_ioctl_in_sys_ioctl_h=no],
- [#include <sys/ioctl.h>])
- ])
- if test $gl_cv_decl_ioctl_in_sys_ioctl_h != yes; then
- SYS_IOCTL_H='sys/ioctl.h'
- fi
- else
- HAVE_SYS_IOCTL_H=0
- SYS_IOCTL_H='sys/ioctl.h'
- fi
- AC_SUBST([HAVE_SYS_IOCTL_H])
- dnl Execute this unconditionally, because SYS_IOCTL_H may be set by other
- dnl modules, after this code is executed.
- gl_CHECK_NEXT_HEADERS([sys/ioctl.h])
-])
-
-dnl Unconditionally enables the replacement of <sys/ioctl.h>.
-AC_DEFUN([gl_REPLACE_SYS_IOCTL_H],
-[
- AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
- SYS_IOCTL_H='sys/ioctl.h'
-])
-
-AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR],
-[
- dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
- AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
- GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
-])
-
-AC_DEFUN([gl_SYS_IOCTL_H_DEFAULTS],
-[
- GNULIB_IOCTL=0; AC_SUBST([GNULIB_IOCTL])
- dnl Assume proper GNU behavior unless another module says otherwise.
- SYS_IOCTL_H_HAVE_WINSOCK2_H=0; AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H])
- SYS_IOCTL_H=''; AC_SUBST([SYS_IOCTL_H])
-])
diff --git a/lib/gl/m4/sys_socket_h.m4 b/lib/gl/m4/sys_socket_h.m4
index b7b18e5300..85a0ace8ad 100644
--- a/lib/gl/m4/sys_socket_h.m4
+++ b/lib/gl/m4/sys_socket_h.m4
@@ -1,4 +1,4 @@
-# sys_socket_h.m4 serial 11
+# sys_socket_h.m4 serial 12
dnl Copyright (C) 2005-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,
@@ -71,8 +71,8 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
# Sets and substitutes HAVE_WINSOCK2_H.
AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
+ m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+ m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
AC_CHECK_HEADERS_ONCE([sys/socket.h])
if test $ac_cv_header_sys_socket_h != yes; then
dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
@@ -100,7 +100,6 @@ AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for GNULIB_CLOSE
GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET])
GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT])
GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT])
diff --git a/lib/gl/stdlib.in.h b/lib/gl/stdlib.in.h
index c5ef32a0b0..e28c151d22 100644
--- a/lib/gl/stdlib.in.h
+++ b/lib/gl/stdlib.in.h
@@ -41,6 +41,23 @@
# include <sys/loadavg.h>
#endif
+#if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@
+# include <stdint.h>
+#endif
+
+#if !@HAVE_STRUCT_RANDOM_DATA@
+struct random_data
+{
+ int32_t *fptr; /* Front pointer. */
+ int32_t *rptr; /* Rear pointer. */
+ int32_t *state; /* Array of state values. */
+ int rand_type; /* Type of random number generator. */
+ int rand_deg; /* Degree of random number generator. */
+ int rand_sep; /* Distance between front and rear. */
+ int32_t *end_ptr; /* Pointer behind state table. */
+};
+#endif
+
/* The definition of GL_LINK_WARNING is copied here. */
@@ -217,6 +234,43 @@ extern int putenv (char *string);
#endif
+#if @GNULIB_RANDOM_R@
+# if !@HAVE_RANDOM_R@
+
+# ifndef RAND_MAX
+# define RAND_MAX 2147483647
+# endif
+
+int srandom_r (unsigned int seed, struct random_data *rand_state);
+int initstate_r (unsigned int seed, char *buf, size_t buf_size,
+ struct random_data *rand_state);
+int setstate_r (char *arg_state, struct random_data *rand_state);
+int random_r (struct random_data *buf, int32_t *result);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef random_r
+# define random_r(b,r) \
+ (GL_LINK_WARNING ("random_r is unportable - " \
+ "use gnulib module random_r for portability"), \
+ random_r (b,r))
+# undef initstate_r
+# define initstate_r(s,b,sz,r) \
+ (GL_LINK_WARNING ("initstate_r is unportable - " \
+ "use gnulib module random_r for portability"), \
+ initstate_r (s,b,sz,r))
+# undef srandom_r
+# define srandom_r(s,r) \
+ (GL_LINK_WARNING ("srandom_r is unportable - " \
+ "use gnulib module random_r for portability"), \
+ srandom_r (s,r))
+# undef setstate_r
+# define setstate_r(a,r) \
+ (GL_LINK_WARNING ("setstate_r is unportable - " \
+ "use gnulib module random_r for portability"), \
+ setstate_r (a,r))
+#endif
+
+
#if @GNULIB_RPMATCH@
# if !@HAVE_RPMATCH@
/* Test a user response to a question.
diff --git a/lib/gl/sys_socket.in.h b/lib/gl/sys_socket.in.h
index 17022bee5d..c8247e9ab3 100644
--- a/lib/gl/sys_socket.in.h
+++ b/lib/gl/sys_socket.in.h
@@ -145,6 +145,11 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
# define close close_used_without_including_unistd_h
# endif
+# if @HAVE_WINSOCK2_H@ && !defined _GL_UNISTD_H
+# undef gethostname
+# define gethostname gethostname_used_without_including_unistd_h
+# endif
+
# if @GNULIB_SOCKET@
# if @HAVE_WINSOCK2_H@
# undef socket
@@ -388,11 +393,6 @@ extern int rpl_shutdown (int, int);
# define select select_used_without_including_sys_select_h
# endif
-# if @GNULIB_CLOSE@ && @HAVE_WINSOCK2_H@
-/* Need a gnulib internal function. */
-# define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1
-# endif
-
# ifdef __cplusplus
}
# endif
diff --git a/lib/gl/sys_stat.in.h b/lib/gl/sys_stat.in.h
index 33e85db8c1..9eac5f4d33 100644
--- a/lib/gl/sys_stat.in.h
+++ b/lib/gl/sys_stat.in.h
@@ -275,15 +275,22 @@
# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
#endif
+#if @GNULIB_LSTAT@
+# if ! @HAVE_LSTAT@
/* mingw does not support symlinks, therefore it does not have lstat. But
without links, stat does just fine. */
-#if ! @HAVE_LSTAT@
-# define lstat stat
-#endif
-#if @GNULIB_LSTAT@ && @REPLACE_LSTAT@
-# undef lstat
-# define lstat rpl_lstat
+# define lstat stat
+# elif @REPLACE_LSTAT@
+# undef lstat
+# define lstat rpl_lstat
extern int rpl_lstat (const char *name, struct stat *buf);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef lstat
+# define lstat(p,b) \
+ (GL_LINK_WARNING ("lstat is unportable - " \
+ "use gnulib module lstat for portability"), \
+ lstat (p, b))
#endif
diff --git a/lib/gl/tests/Makefile.am b/lib/gl/tests/Makefile.am
index 4746df57fc..c5d9c184b2 100644
--- a/lib/gl/tests/Makefile.am
+++ b/lib/gl/tests/Makefile.am
@@ -32,9 +32,9 @@ MAINTAINERCLEANFILES =
AM_CPPFLAGS = \
-I. -I$(srcdir) \
-I../.. -I$(srcdir)/../.. \
- -I../../lgl -I$(srcdir)/../../lgl
+ -I../../gl -I$(srcdir)/../../gl
-LDADD = libtests.a ../../lgl/liblgnu.la libtests.a $(LIBTESTS_LIBDEPS)
+LDADD = libtests.a ../../gl/liblgnu.la libtests.a $(LIBTESTS_LIBDEPS)
libtests_a_SOURCES =
libtests_a_LIBADD = $(lgltests_LIBOBJS)
diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h
index fa9e2c4346..8bc3abfbc9 100644
--- a/lib/gl/unistd.in.h
+++ b/lib/gl/unistd.in.h
@@ -42,6 +42,47 @@
# include <sys/types.h>
#endif
+#if @GNULIB_GETHOSTNAME@
+/* Get all possible declarations of gethostname(). */
+# if @UNISTD_H_HAVE_WINSOCK2_H@
+# include <winsock2.h>
+# if !defined _GL_SYS_SOCKET_H
+# undef socket
+# define socket socket_used_without_including_sys_socket_h
+# undef connect
+# define connect connect_used_without_including_sys_socket_h
+# undef accept
+# define accept accept_used_without_including_sys_socket_h
+# undef bind
+# define bind bind_used_without_including_sys_socket_h
+# undef getpeername
+# define getpeername getpeername_used_without_including_sys_socket_h
+# undef getsockname
+# define getsockname getsockname_used_without_including_sys_socket_h
+# undef getsockopt
+# define getsockopt getsockopt_used_without_including_sys_socket_h
+# undef listen
+# define listen listen_used_without_including_sys_socket_h
+# undef recv
+# define recv recv_used_without_including_sys_socket_h
+# undef send
+# define send send_used_without_including_sys_socket_h
+# undef recvfrom
+# define recvfrom recvfrom_used_without_including_sys_socket_h
+# undef sendto
+# define sendto sendto_used_without_including_sys_socket_h
+# undef setsockopt
+# define setsockopt setsockopt_used_without_including_sys_socket_h
+# undef shutdown
+# define shutdown shutdown_used_without_including_sys_socket_h
+# endif
+# if !defined _GL_SYS_SELECT_H
+# undef select
+# define select select_used_without_including_sys_select_h
+# endif
+# endif
+#endif
+
/* The definition of GL_LINK_WARNING is copied here. */
@@ -78,6 +119,10 @@ extern int chown (const char *file, uid_t uid, gid_t gid);
#if @GNULIB_CLOSE@
+# if @UNISTD_H_HAVE_WINSOCK2_H@
+/* Need a gnulib internal function. */
+# define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1
+# endif
# if @REPLACE_CLOSE@
/* Automatically included by modules that need a replacement for close. */
# undef close
@@ -280,9 +325,16 @@ extern int getdtablesize (void);
Null terminate it if the name is shorter than LEN.
If the host name is longer than LEN, set errno = EINVAL and return -1.
Return 0 if successful, otherwise set errno and return -1. */
-# if !@HAVE_GETHOSTNAME@
+# if @UNISTD_H_HAVE_WINSOCK2_H@
+# undef gethostname
+# define gethostname rpl_gethostname
+# endif
+# if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@
extern int gethostname(char *name, size_t len);
# endif
+#elif @UNISTD_H_HAVE_WINSOCK2_H@
+# undef gethostname
+# define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
#elif defined GNULIB_POSIXCHECK
# undef gethostname
# define gethostname(n,l) \