summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2006-10-30 08:41:37 +0000
committerSimon Josefsson <simon@josefsson.org>2006-10-30 08:41:37 +0000
commit7df5419da539d9caf81727902fca00b73c0e2d9f (patch)
tree953f1ac1bc32081ebc1894f802efd3f67cf671d3
parentefa0d800987baa5e7a921e94e93b08bdbc268950 (diff)
downloadgnutls-7df5419da539d9caf81727902fca00b73c0e2d9f.tar.gz
Update.
-rw-r--r--gl/getaddrinfo.c7
-rw-r--r--gl/getdelim.c6
-rw-r--r--gl/getline.c6
-rw-r--r--gl/gettext.h2
-rw-r--r--gl/m4/lib-link.m42
-rw-r--r--gl/readline.c4
-rw-r--r--lgl/Makefile.am37
-rw-r--r--lgl/arcfour.c7
-rw-r--r--lgl/arctwo.c6
-rw-r--r--lgl/des.c6
-rw-r--r--lgl/gc-gnulib.c4
-rw-r--r--lgl/gc-libgcrypt.c4
-rw-r--r--lgl/gc-pbkdf2-sha1.c6
-rw-r--r--lgl/gettext.h2
-rw-r--r--lgl/hmac-md5.c6
-rw-r--r--lgl/hmac-sha1.c6
-rw-r--r--lgl/m4/codeset.m42
-rw-r--r--lgl/m4/gettext.m4345
-rw-r--r--lgl/m4/gnulib-cache.m44
-rw-r--r--lgl/m4/gnulib-comp.m44
-rw-r--r--lgl/m4/intl.m4259
-rw-r--r--lgl/m4/intldir.m419
-rw-r--r--lgl/m4/intmax.m42
-rw-r--r--lgl/m4/inttypes-h.m41
-rw-r--r--lgl/m4/inttypes-pri.m42
-rw-r--r--lgl/m4/lib-link.m42
-rw-r--r--lgl/m4/lock.m42
-rw-r--r--lgl/m4/signed.m418
-rw-r--r--lgl/m4/sys_stat_h.m424
-rw-r--r--lgl/m4/unistd_h.m418
-rw-r--r--lgl/m4/vasnprintf.m43
-rw-r--r--lgl/md2.c6
-rw-r--r--lgl/md4.c4
-rw-r--r--lgl/memxor.c6
-rw-r--r--lgl/read-file.c4
-rw-r--r--lgl/rijndael-alg-fst.c6
-rw-r--r--lgl/rijndael-api-fst.c4
-rw-r--r--lgl/stat_.h231
38 files changed, 683 insertions, 394 deletions
diff --git a/gl/getaddrinfo.c b/gl/getaddrinfo.c
index 333ad3b3d2..358214afec 100644
--- a/gl/getaddrinfo.c
+++ b/gl/getaddrinfo.c
@@ -1,5 +1,6 @@
/* Get address information (partial implementation).
- Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006 Free Software
+ Foundation, Inc.
Contributed by Simon Josefsson <simon@josefsson.org>.
This program is free software; you can redistribute it and/or modify
@@ -16,9 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "getaddrinfo.h"
diff --git a/gl/getdelim.c b/gl/getdelim.c
index a131b0c632..e0b8a708ba 100644
--- a/gl/getdelim.c
+++ b/gl/getdelim.c
@@ -1,5 +1,5 @@
/* getdelim.c --- Implementation of replacement getdelim function.
- Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005 Free
+ Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006 Free
Software Foundation, Inc.
This program is free software; you can redistribute it and/or
@@ -19,9 +19,7 @@
/* Ported from glibc by Simon Josefsson. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "getdelim.h"
diff --git a/gl/getline.c b/gl/getline.c
index ab054fba6b..c8c9244a04 100644
--- a/gl/getline.c
+++ b/gl/getline.c
@@ -1,5 +1,5 @@
/* getline.c --- Implementation of replacement getline function.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -18,9 +18,7 @@
/* Written by Simon Josefsson. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "getdelim.h"
#include "getline.h"
diff --git a/gl/gettext.h b/gl/gettext.h
index 70e2c1c267..f15eb6a25c 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -164,7 +164,7 @@ npgettext_aux (const char *domain,
#include <string.h>
#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
- (__GNUC__ >= 3 || defined __cplusplus)
+ (__GNUC__ >= 3 || __GNUG__ >= 2 /* || __STDC_VERSION__ >= 199901L */ )
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
#include <stdlib.h>
diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
index a196556c24..f95b7ba88d 100644
--- a/gl/m4/lib-link.m4
+++ b/gl/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 9 (gettext-0.15.1)
+# lib-link.m4 serial 9 (gettext-0.16)
dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/readline.c b/gl/readline.c
index 52f002ed7b..f93a115293 100644
--- a/gl/readline.c
+++ b/gl/readline.c
@@ -16,9 +16,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
/* This module is intended to be used when the application only needs
the readline interface. If you need more functions from the
diff --git a/lgl/Makefile.am b/lgl/Makefile.am
index 0395097309..1e46d8ded0 100644
--- a/lgl/Makefile.am
+++ b/lgl/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=. --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --aux-dir=. --lgpl --libtool --macro-prefix=lgl gc gc-arcfour gc-arctwo gc-des gc-hmac-md5 gc-md2 gc-md4 gc-md5 gc-pbkdf2-sha1 gc-random gc-rijndael gc-sha1 gettext memmem memmove minmax read-file snprintf socklen stdint
+# Reproduce by: gnulib-tool --import --dir=. --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --aux-dir=. --lgpl --libtool --macro-prefix=lgl gc gc-arcfour gc-arctwo gc-des gc-hmac-md5 gc-md2 gc-md4 gc-md5 gc-pbkdf2-sha1 gc-random gc-rijndael gc-sha1 gettext memmem memmove minmax read-file snprintf socklen stdint sys_socket sys_stat unistd
AUTOMAKE_OPTIONS = 1.5 gnits
@@ -255,6 +255,41 @@ EXTRA_DIST += socket_.h
## end gnulib module sys_socket
+## begin gnulib module sys_stat
+
+BUILT_SOURCES += $(SYS_STAT_H)
+
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: stat_.h
+ test -d sys || mkdir sys
+ rm -f $@-t $@
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \
+ < $(srcdir)/stat_.h; \
+ } > $@-t
+ mv $@-t $@
+MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += stat_.h
+
+## end gnulib module sys_stat
+
+## begin gnulib module unistd
+
+BUILT_SOURCES += $(UNISTD_H)
+
+# We need the following in order to create an empty placeholder for
+# <unistd.h> when the system doesn't have one.
+unistd.h:
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ echo '/* Empty placeholder for $@. */'; \
+ } > $@
+MOSTLYCLEANFILES += unistd.h
+
+## end gnulib module unistd
+
## begin gnulib module vasnprintf
diff --git a/lgl/arcfour.c b/lgl/arcfour.c
index 89387b0fc7..45187f74e3 100644
--- a/lgl/arcfour.c
+++ b/lgl/arcfour.c
@@ -1,5 +1,6 @@
/* arcfour.c --- The arcfour stream cipher
- * Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2000, 2001, 2002, 2003, 2005, 2006 Free Software
+ * Foundation, Inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -26,9 +27,7 @@
* ISBN 0-471-11709-9. Pages 397 ff.
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "arcfour.h"
diff --git a/lgl/arctwo.c b/lgl/arctwo.c
index f0051bc6ce..6f7b5aa18d 100644
--- a/lgl/arctwo.c
+++ b/lgl/arctwo.c
@@ -1,5 +1,5 @@
/* arctwo.c --- The RC2 cipher as described in RFC 2268.
- * Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -27,9 +27,7 @@
* The implementation here is based on Peter Gutmann's RRC.2 paper.
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "arctwo.h"
diff --git a/lgl/des.c b/lgl/des.c
index e9ac1c6fa8..8f36231a54 100644
--- a/lgl/des.c
+++ b/lgl/des.c
@@ -94,9 +94,7 @@
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "des.h"
@@ -420,7 +418,7 @@ des_is_weak_key (const char * key)
right = (data[4] << 24) | (data[5] << 16) | (data[6] << 8) | data[7];
#define WRITE_64BIT_DATA(data, left, right) \
- data[0] = (left >> 24) &0xff; data[1] = (left >> 16) &0xff; \
+ data[0] = (left >> 24) &0xff; data[1] = (left >> 16) &0xff; \
data[2] = (left >> 8) &0xff; data[3] = left &0xff; \
data[4] = (right >> 24) &0xff; data[5] = (right >> 16) &0xff; \
data[6] = (right >> 8) &0xff; data[7] = right &0xff;
diff --git a/lgl/gc-gnulib.c b/lgl/gc-gnulib.c
index a31d55e4ed..6ce0d5aaba 100644
--- a/lgl/gc-gnulib.c
+++ b/lgl/gc-gnulib.c
@@ -20,9 +20,7 @@
/* Note: This file is only built if GC uses internal functions. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
/* Get prototype. */
#include "gc.h"
diff --git a/lgl/gc-libgcrypt.c b/lgl/gc-libgcrypt.c
index 53753c3fe0..7aef83a54b 100644
--- a/lgl/gc-libgcrypt.c
+++ b/lgl/gc-libgcrypt.c
@@ -20,9 +20,7 @@
/* Note: This file is only built if GC uses Libgcrypt. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
/* Get prototype. */
#include "gc.h"
diff --git a/lgl/gc-pbkdf2-sha1.c b/lgl/gc-pbkdf2-sha1.c
index 89a1bfd169..364bf1d602 100644
--- a/lgl/gc-pbkdf2-sha1.c
+++ b/lgl/gc-pbkdf2-sha1.c
@@ -1,5 +1,5 @@
/* gc-pbkdf2-sha1.c --- Password-Based Key Derivation Function a'la PKCS#5
- Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -18,9 +18,7 @@
/* Written by Simon Josefsson. The comments in this file are taken
from RFC 2898. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "gc.h"
diff --git a/lgl/gettext.h b/lgl/gettext.h
index f7fd6a5e10..6eb6040698 100644
--- a/lgl/gettext.h
+++ b/lgl/gettext.h
@@ -164,7 +164,7 @@ npgettext_aux (const char *domain,
#include <string.h>
#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
- (__GNUC__ >= 3 || defined __cplusplus)
+ (__GNUC__ >= 3 || __GNUG__ >= 2 /* || __STDC_VERSION__ >= 199901L */ )
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
#include <stdlib.h>
diff --git a/lgl/hmac-md5.c b/lgl/hmac-md5.c
index 2c70a129eb..51cd9e046c 100644
--- a/lgl/hmac-md5.c
+++ b/lgl/hmac-md5.c
@@ -1,5 +1,5 @@
/* hmac-md5.c -- hashed message authentication codes
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -17,9 +17,7 @@
/* Written by Simon Josefsson. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "hmac.h"
diff --git a/lgl/hmac-sha1.c b/lgl/hmac-sha1.c
index 7a78868ef0..93d0aba907 100644
--- a/lgl/hmac-sha1.c
+++ b/lgl/hmac-sha1.c
@@ -1,5 +1,5 @@
/* hmac-sha1.c -- hashed message authentication codes
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -17,9 +17,7 @@
/* Written by Simon Josefsson. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "hmac.h"
diff --git a/lgl/m4/codeset.m4 b/lgl/m4/codeset.m4
index 55f50a13d6..223955b454 100644
--- a/lgl/m4/codeset.m4
+++ b/lgl/m4/codeset.m4
@@ -1,4 +1,4 @@
-# codeset.m4 serial 2 (gettext-0.15.1)
+# codeset.m4 serial 2 (gettext-0.16)
dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lgl/m4/gettext.m4 b/lgl/m4/gettext.m4
index 5575df45fa..b5ce322fb1 100644
--- a/lgl/m4/gettext.m4
+++ b/lgl/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 53.1
+# gettext.m4 serial 58 (gettext-0.16)
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -15,9 +15,7 @@ dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl Bruno Haible <haible@clisp.cons.org>, 2000-2005.
-
-AC_PREREQ(2.52)
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
dnl Macro to add for using GNU gettext.
@@ -65,8 +63,13 @@ AC_DEFUN([AM_GNU_GETTEXT],
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
])])])])
- define([gt_included_intl], ifelse([$1], [external], [no], [yes]))
+ define([gt_included_intl],
+ ifelse([$1], [external],
+ ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
+ [yes]))
define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+ gt_NEEDS_INIT
+ AM_GNU_GETTEXT_NEED([$2])
AC_REQUIRE([AM_PO_SUBDIRS])dnl
ifelse(gt_included_intl, yes, [
@@ -80,7 +83,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
dnl Sometimes libintl requires libiconv, so first search for libiconv.
dnl Ideally we would do this search only after the
dnl if test "$USE_NLS" = "yes"; then
- dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+ dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
dnl the configure script would need to contain the same shell code
dnl again, outside any 'if'. There are two solutions:
@@ -106,6 +109,15 @@ AC_DEFUN([AM_GNU_GETTEXT],
LTLIBINTL=
POSUB=
+ dnl Add a version number to the cache macros.
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
gt_use_preinstalled_gnugettext=no
@@ -124,26 +136,33 @@ AC_DEFUN([AM_GNU_GETTEXT],
dnl to use. If GNU gettext is available we use this. Else we have
dnl to fall back to GNU NLS library.
- dnl Add a version number to the cache macros.
- define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
- define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
- define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
-
- AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
- [AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='[[
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-]], [])[extern int _nl_msg_cat_cntr;
+]]'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+ [AC_TRY_LINK([#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;],
[bindtextdomain ("", "");
-return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
- gt_cv_func_gnugettext_libc=yes,
- gt_cv_func_gnugettext_libc=no)])
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
+ [eval "$gt_func_gnugettext_libc=yes"],
+ [eval "$gt_func_gnugettext_libc=no"])])
- if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
dnl Sometimes libintl requires libiconv, so first search for libiconv.
ifelse(gt_included_intl, yes, , [
AM_ICONV_LINK
@@ -154,48 +173,40 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)],
dnl even if libiconv doesn't exist.
AC_LIB_LINKFLAGS_BODY([intl])
AC_CACHE_CHECK([for GNU gettext in libintl],
- gt_cv_func_gnugettext_libintl,
+ [$gt_func_gnugettext_libintl],
[gt_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $INCINTL"
gt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBINTL"
dnl Now see whether libintl exists and does not depend on libiconv.
AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-]], [])[extern int _nl_msg_cat_cntr;
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
#endif
const char *_nl_expand_alias (const char *);],
[bindtextdomain ("", "");
-return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
- gt_cv_func_gnugettext_libintl=yes,
- gt_cv_func_gnugettext_libintl=no)
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+ [eval "$gt_func_gnugettext_libintl=yes"],
+ [eval "$gt_func_gnugettext_libintl=no"])
dnl Now see whether libintl exists and depends on libiconv.
- if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-]], [])[extern int _nl_msg_cat_cntr;
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
extern
#ifdef __cplusplus
"C"
#endif
const char *_nl_expand_alias (const char *);],
[bindtextdomain ("", "");
-return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
[LIBINTL="$LIBINTL $LIBICONV"
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
- gt_cv_func_gnugettext_libintl=yes
+ eval "$gt_func_gnugettext_libintl=yes"
])
fi
CPPFLAGS="$gt_save_CPPFLAGS"
@@ -206,8 +217,8 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)],
dnl use it. But if this macro is used in GNU gettext, and GNU
dnl gettext is already preinstalled in libintl, we update this
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
- if test "$gt_cv_func_gnugettext_libc" = "yes" \
- || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
&& test "$PACKAGE" != gettext-runtime \
&& test "$PACKAGE" != gettext-tools; }; then
gt_use_preinstalled_gnugettext=yes
@@ -267,7 +278,7 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)],
if test "$USE_NLS" = "yes"; then
AC_MSG_CHECKING([where the gettext function comes from])
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
- if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
gt_source="external libintl"
else
gt_source="libc"
@@ -281,7 +292,7 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)],
if test "$USE_NLS" = "yes"; then
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
- if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
AC_MSG_CHECKING([how to link with libintl])
AC_MSG_RESULT([$LIBINTL])
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
@@ -349,227 +360,6 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)],
])
-dnl Checks for all prerequisites of the intl subdirectory,
-dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
-dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
-AC_DEFUN([AM_INTL_SUBDIR],
-[
- AC_REQUIRE([AC_PROG_INSTALL])dnl
- AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
- AC_REQUIRE([AC_PROG_CC])dnl
- AC_REQUIRE([AC_CANONICAL_HOST])dnl
- AC_REQUIRE([gt_GLIBC2])dnl
- AC_REQUIRE([AC_PROG_RANLIB])dnl
- AC_REQUIRE([gl_VISIBILITY])dnl
- AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
- AC_REQUIRE([bh_C_SIGNED])dnl
- AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
- AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
- AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
- AC_REQUIRE([gt_TYPE_WINT_T])dnl
- AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([gt_TYPE_INTMAX_T])
- AC_REQUIRE([gt_PRINTF_POSIX])
- AC_REQUIRE([gl_GLIBC21])dnl
- AC_REQUIRE([gl_XSIZE])dnl
- AC_REQUIRE([gt_INTL_MACOSX])dnl
-
- AC_CHECK_TYPE([ptrdiff_t], ,
- [AC_DEFINE([ptrdiff_t], [long],
- [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
- ])
- AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
- AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
-
- dnl Use the _snprintf function only if it is declared (because on NetBSD it
- dnl is defined as a weak alias of snprintf; we prefer to use the latter).
- gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
- gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
-
- dnl Use the *_unlocked functions only if they are declared.
- dnl (because some of them were defined without being declared in Solaris
- dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
- dnl on Solaris 2.5.1 to run on Solaris 2.6).
- dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
- gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
-
- case $gt_cv_func_printf_posix in
- *yes) HAVE_POSIX_PRINTF=1 ;;
- *) HAVE_POSIX_PRINTF=0 ;;
- esac
- AC_SUBST([HAVE_POSIX_PRINTF])
- if test "$ac_cv_func_asprintf" = yes; then
- HAVE_ASPRINTF=1
- else
- HAVE_ASPRINTF=0
- fi
- AC_SUBST([HAVE_ASPRINTF])
- if test "$ac_cv_func_snprintf" = yes; then
- HAVE_SNPRINTF=1
- else
- HAVE_SNPRINTF=0
- fi
- AC_SUBST([HAVE_SNPRINTF])
- if test "$ac_cv_func_wprintf" = yes; then
- HAVE_WPRINTF=1
- else
- HAVE_WPRINTF=0
- fi
- AC_SUBST([HAVE_WPRINTF])
-
- AM_LANGINFO_CODESET
- gt_LC_MESSAGES
-
- dnl Compilation on mingw and Cygwin needs special Makefile rules, because
- dnl 1. when we install a shared library, we must arrange to export
- dnl auxiliary pointer variables for every exported variable,
- dnl 2. when we install a shared library and a static library simultaneously,
- dnl the include file specifies __declspec(dllimport) and therefore we
- dnl must arrange to define the auxiliary pointer variables for the
- dnl exported variables _also_ in the static library.
- if test "$enable_shared" = yes; then
- case "$host_os" in
- cygwin*) is_woe32dll=yes ;;
- *) is_woe32dll=no ;;
- esac
- else
- is_woe32dll=no
- fi
- WOE32DLL=$is_woe32dll
- AC_SUBST([WOE32DLL])
-
- dnl Rename some macros and functions used for locking.
- AH_BOTTOM([
-#define __libc_lock_t gl_lock_t
-#define __libc_lock_define gl_lock_define
-#define __libc_lock_define_initialized gl_lock_define_initialized
-#define __libc_lock_init gl_lock_init
-#define __libc_lock_lock gl_lock_lock
-#define __libc_lock_unlock gl_lock_unlock
-#define __libc_lock_recursive_t gl_recursive_lock_t
-#define __libc_lock_define_recursive gl_recursive_lock_define
-#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
-#define __libc_lock_init_recursive gl_recursive_lock_init
-#define __libc_lock_lock_recursive gl_recursive_lock_lock
-#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
-#define glthread_in_use libintl_thread_in_use
-#define glthread_lock_init libintl_lock_init
-#define glthread_lock_lock libintl_lock_lock
-#define glthread_lock_unlock libintl_lock_unlock
-#define glthread_lock_destroy libintl_lock_destroy
-#define glthread_rwlock_init libintl_rwlock_init
-#define glthread_rwlock_rdlock libintl_rwlock_rdlock
-#define glthread_rwlock_wrlock libintl_rwlock_wrlock
-#define glthread_rwlock_unlock libintl_rwlock_unlock
-#define glthread_rwlock_destroy libintl_rwlock_destroy
-#define glthread_recursive_lock_init libintl_recursive_lock_init
-#define glthread_recursive_lock_lock libintl_recursive_lock_lock
-#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
-#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
-#define glthread_once libintl_once
-#define glthread_once_call libintl_once_call
-#define glthread_once_singlethreaded libintl_once_singlethreaded
-])
-])
-
-
-dnl Checks for the core files of the intl subdirectory:
-dnl dcigettext.c
-dnl eval-plural.h
-dnl explodename.c
-dnl finddomain.c
-dnl gettextP.h
-dnl gmo.h
-dnl hash-string.h hash-string.c
-dnl l10nflist.c
-dnl libgnuintl.h.in (except the *printf stuff)
-dnl loadinfo.h
-dnl loadmsgcat.c
-dnl localealias.c
-dnl log.c
-dnl plural-exp.h plural-exp.c
-dnl plural.y
-dnl Used by libglocale.
-AC_DEFUN([gt_INTL_SUBDIR_CORE],
-[
- AC_REQUIRE([AC_C_INLINE])dnl
- AC_REQUIRE([AC_TYPE_SIZE_T])dnl
- AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- AC_REQUIRE([AC_FUNC_ALLOCA])dnl
- AC_REQUIRE([AC_FUNC_MMAP])dnl
- AC_REQUIRE([gt_INTDIV0])dnl
- AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
- AC_REQUIRE([gt_INTTYPES_PRI])dnl
- AC_REQUIRE([gl_LOCK])dnl
-
- AC_TRY_LINK(
- [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
- [],
- [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
- [Define to 1 if the compiler understands __builtin_expect.])])
-
- AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
- AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
- stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
- argz_next __fsetlocking])
-
- dnl Use the *_unlocked functions only if they are declared.
- dnl (because some of them were defined without being declared in Solaris
- dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
- dnl on Solaris 2.5.1 to run on Solaris 2.6).
- dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
- gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
- gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
-
- AM_ICONV
-
- dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
- dnl and a _NL_LOCALE_NAME macro always.
- AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
- [AC_TRY_LINK([#include <langinfo.h>
-#include <locale.h>],
- [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));],
- gt_cv_nl_locale_name=yes,
- gt_cv_nl_locale_name=no)
- ])
- if test $gt_cv_nl_locale_name = yes; then
- AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
- [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
- fi
-
- dnl intl/plural.c is generated from intl/plural.y. It requires bison,
- dnl because plural.y uses bison specific features. It requires at least
- dnl bison-1.26 because earlier versions generate a plural.c that doesn't
- dnl compile.
- dnl bison is only needed for the maintainer (who touches plural.y). But in
- dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
- dnl the rule in general Makefile. Now, some people carelessly touch the
- dnl files or have a broken "make" program, hence the plural.c rule will
- dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
- dnl present or too old.
- AC_CHECK_PROGS([INTLBISON], [bison])
- if test -z "$INTLBISON"; then
- ac_verc_fail=yes
- else
- dnl Found it, now check the version.
- AC_MSG_CHECKING([version of bison])
-changequote(<<,>>)dnl
- ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
- case $ac_prog_version in
- '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
-changequote([,])dnl
- ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
- *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
- esac
- AC_MSG_RESULT([$ac_prog_version])
- fi
- if test $ac_verc_fail = yes; then
- INTLBISON=:
- fi
-])
-
-
dnl Checks for special options needed on MacOS X.
dnl Defines INTL_MACOSX_LIBS.
AC_DEFUN([gt_INTL_MACOSX],
@@ -608,23 +398,18 @@ AC_DEFUN([gt_INTL_MACOSX],
])
-dnl gt_CHECK_DECL(FUNC, INCLUDES)
-dnl Check whether a function is declared.
-AC_DEFUN([gt_CHECK_DECL],
+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
[
- AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
- [AC_TRY_COMPILE([$2], [
-#ifndef $1
- char *p = (char *) $1;
-#endif
-], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
- if test $ac_cv_have_decl_$1 = yes; then
- gt_value=1
- else
- gt_value=0
- fi
- AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
- [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
+ m4_divert_text([DEFAULTS], [gt_needs=])
+ m4_define([gt_NEEDS_INIT], [])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
+[
+ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
])
diff --git a/lgl/m4/gnulib-cache.m4 b/lgl/m4/gnulib-cache.m4
index ee20f74c24..39f49de6d9 100644
--- a/lgl/m4/gnulib-cache.m4
+++ b/lgl/m4/gnulib-cache.m4
@@ -15,11 +15,11 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --aux-dir=. --lgpl --libtool --macro-prefix=lgl gc gc-arcfour gc-arctwo gc-des gc-hmac-md5 gc-md2 gc-md4 gc-md5 gc-pbkdf2-sha1 gc-random gc-rijndael gc-sha1 gettext memmem memmove minmax read-file snprintf socklen stdint
+# gnulib-tool --import --dir=. --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --aux-dir=. --lgpl --libtool --macro-prefix=lgl gc gc-arcfour gc-arctwo gc-des gc-hmac-md5 gc-md2 gc-md4 gc-md5 gc-pbkdf2-sha1 gc-random gc-rijndael gc-sha1 gettext memmem memmove minmax read-file snprintf socklen stdint sys_socket sys_stat unistd
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
-gl_MODULES([gc gc-arcfour gc-arctwo gc-des gc-hmac-md5 gc-md2 gc-md4 gc-md5 gc-pbkdf2-sha1 gc-random gc-rijndael gc-sha1 gettext memmem memmove minmax read-file snprintf socklen stdint])
+gl_MODULES([gc gc-arcfour gc-arctwo gc-des gc-hmac-md5 gc-md2 gc-md4 gc-md5 gc-pbkdf2-sha1 gc-random gc-rijndael gc-sha1 gettext memmem memmove minmax read-file snprintf socklen stdint sys_socket sys_stat unistd])
gl_AVOID([])
gl_SOURCE_BASE([lgl])
gl_M4_BASE([lgl/m4])
diff --git a/lgl/m4/gnulib-comp.m4 b/lgl/m4/gnulib-comp.m4
index 13e72201df..2164125af8 100644
--- a/lgl/m4/gnulib-comp.m4
+++ b/lgl/m4/gnulib-comp.m4
@@ -181,9 +181,10 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/hmac-sha1.m4
m4/iconv.m4
m4/intdiv0.m4
+ m4/intl.m4
+ m4/intldir.m4
m4/intmax.m4
m4/intmax_t.m4
- m4/inttypes-h.m4
m4/inttypes-pri.m4
m4/inttypes_h.m4
m4/lcmessage.m4
@@ -207,7 +208,6 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/read-file.m4
m4/rijndael.m4
m4/sha1.m4
- m4/signed.m4
m4/size_max.m4
m4/snprintf.m4
m4/socklen.m4
diff --git a/lgl/m4/intl.m4 b/lgl/m4/intl.m4
new file mode 100644
index 0000000000..dcefb118c7
--- /dev/null
+++ b/lgl/m4/intl.m4
@@ -0,0 +1,259 @@
+# intl.m4 serial 3 (gettext-0.16)
+dnl Copyright (C) 1995-2006 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
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
+
+AC_PREREQ(2.52)
+
+dnl Checks for all prerequisites of the intl subdirectory,
+dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
+dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
+AC_DEFUN([AM_INTL_SUBDIR],
+[
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+ AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([gt_GLIBC2])dnl
+ AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([gl_VISIBILITY])dnl
+ AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
+ AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
+ AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
+ AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
+ AC_REQUIRE([gt_TYPE_WINT_T])dnl
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gt_TYPE_INTMAX_T])
+ AC_REQUIRE([gt_PRINTF_POSIX])
+ AC_REQUIRE([gl_GLIBC21])dnl
+ AC_REQUIRE([gl_XSIZE])dnl
+ AC_REQUIRE([gt_INTL_MACOSX])dnl
+
+ AC_CHECK_TYPE([ptrdiff_t], ,
+ [AC_DEFINE([ptrdiff_t], [long],
+ [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
+ ])
+ AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
+ AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
+
+ dnl Use the _snprintf function only if it is declared (because on NetBSD it
+ dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+ gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
+ gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
+
+ dnl Use the *_unlocked functions only if they are declared.
+ dnl (because some of them were defined without being declared in Solaris
+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
+ dnl on Solaris 2.5.1 to run on Solaris 2.6).
+ dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
+ gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
+
+ case $gt_cv_func_printf_posix in
+ *yes) HAVE_POSIX_PRINTF=1 ;;
+ *) HAVE_POSIX_PRINTF=0 ;;
+ esac
+ AC_SUBST([HAVE_POSIX_PRINTF])
+ if test "$ac_cv_func_asprintf" = yes; then
+ HAVE_ASPRINTF=1
+ else
+ HAVE_ASPRINTF=0
+ fi
+ AC_SUBST([HAVE_ASPRINTF])
+ if test "$ac_cv_func_snprintf" = yes; then
+ HAVE_SNPRINTF=1
+ else
+ HAVE_SNPRINTF=0
+ fi
+ AC_SUBST([HAVE_SNPRINTF])
+ if test "$ac_cv_func_wprintf" = yes; then
+ HAVE_WPRINTF=1
+ else
+ HAVE_WPRINTF=0
+ fi
+ AC_SUBST([HAVE_WPRINTF])
+
+ AM_LANGINFO_CODESET
+ gt_LC_MESSAGES
+
+ dnl Compilation on mingw and Cygwin needs special Makefile rules, because
+ dnl 1. when we install a shared library, we must arrange to export
+ dnl auxiliary pointer variables for every exported variable,
+ dnl 2. when we install a shared library and a static library simultaneously,
+ dnl the include file specifies __declspec(dllimport) and therefore we
+ dnl must arrange to define the auxiliary pointer variables for the
+ dnl exported variables _also_ in the static library.
+ if test "$enable_shared" = yes; then
+ case "$host_os" in
+ cygwin*) is_woe32dll=yes ;;
+ *) is_woe32dll=no ;;
+ esac
+ else
+ is_woe32dll=no
+ fi
+ WOE32DLL=$is_woe32dll
+ AC_SUBST([WOE32DLL])
+
+ dnl Rename some macros and functions used for locking.
+ AH_BOTTOM([
+#define __libc_lock_t gl_lock_t
+#define __libc_lock_define gl_lock_define
+#define __libc_lock_define_initialized gl_lock_define_initialized
+#define __libc_lock_init gl_lock_init
+#define __libc_lock_lock gl_lock_lock
+#define __libc_lock_unlock gl_lock_unlock
+#define __libc_lock_recursive_t gl_recursive_lock_t
+#define __libc_lock_define_recursive gl_recursive_lock_define
+#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
+#define __libc_lock_init_recursive gl_recursive_lock_init
+#define __libc_lock_lock_recursive gl_recursive_lock_lock
+#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
+#define glthread_in_use libintl_thread_in_use
+#define glthread_lock_init libintl_lock_init
+#define glthread_lock_lock libintl_lock_lock
+#define glthread_lock_unlock libintl_lock_unlock
+#define glthread_lock_destroy libintl_lock_destroy
+#define glthread_rwlock_init libintl_rwlock_init
+#define glthread_rwlock_rdlock libintl_rwlock_rdlock
+#define glthread_rwlock_wrlock libintl_rwlock_wrlock
+#define glthread_rwlock_unlock libintl_rwlock_unlock
+#define glthread_rwlock_destroy libintl_rwlock_destroy
+#define glthread_recursive_lock_init libintl_recursive_lock_init
+#define glthread_recursive_lock_lock libintl_recursive_lock_lock
+#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
+#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
+#define glthread_once libintl_once
+#define glthread_once_call libintl_once_call
+#define glthread_once_singlethreaded libintl_once_singlethreaded
+])
+])
+
+
+dnl Checks for the core files of the intl subdirectory:
+dnl dcigettext.c
+dnl eval-plural.h
+dnl explodename.c
+dnl finddomain.c
+dnl gettextP.h
+dnl gmo.h
+dnl hash-string.h hash-string.c
+dnl l10nflist.c
+dnl libgnuintl.h.in (except the *printf stuff)
+dnl loadinfo.h
+dnl loadmsgcat.c
+dnl localealias.c
+dnl log.c
+dnl plural-exp.h plural-exp.c
+dnl plural.y
+dnl Used by libglocale.
+AC_DEFUN([gt_INTL_SUBDIR_CORE],
+[
+ AC_REQUIRE([AC_C_INLINE])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+ AC_REQUIRE([gt_INTDIV0])dnl
+ AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
+ AC_REQUIRE([gt_INTTYPES_PRI])dnl
+ AC_REQUIRE([gl_LOCK])dnl
+
+ AC_TRY_LINK(
+ [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
+ [],
+ [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
+ [Define to 1 if the compiler understands __builtin_expect.])])
+
+ AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
+ AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
+ stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
+ argz_next __fsetlocking])
+
+ dnl Use the *_unlocked functions only if they are declared.
+ dnl (because some of them were defined without being declared in Solaris
+ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
+ dnl on Solaris 2.5.1 to run on Solaris 2.6).
+ dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
+ gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
+ gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
+
+ AM_ICONV
+
+ dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
+ dnl and a _NL_LOCALE_NAME macro always.
+ AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
+ [AC_TRY_LINK([#include <langinfo.h>
+#include <locale.h>],
+ [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));],
+ gt_cv_nl_locale_name=yes,
+ gt_cv_nl_locale_name=no)
+ ])
+ if test $gt_cv_nl_locale_name = yes; then
+ AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
+ [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
+ fi
+
+ dnl intl/plural.c is generated from intl/plural.y. It requires bison,
+ dnl because plural.y uses bison specific features. It requires at least
+ dnl bison-1.26 because earlier versions generate a plural.c that doesn't
+ dnl compile.
+ dnl bison is only needed for the maintainer (who touches plural.y). But in
+ dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
+ dnl the rule in general Makefile. Now, some people carelessly touch the
+ dnl files or have a broken "make" program, hence the plural.c rule will
+ dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
+ dnl present or too old.
+ AC_CHECK_PROGS([INTLBISON], [bison])
+ if test -z "$INTLBISON"; then
+ ac_verc_fail=yes
+ else
+ dnl Found it, now check the version.
+ AC_MSG_CHECKING([version of bison])
+changequote(<<,>>)dnl
+ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+changequote([,])dnl
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+ esac
+ AC_MSG_RESULT([$ac_prog_version])
+ fi
+ if test $ac_verc_fail = yes; then
+ INTLBISON=:
+ fi
+])
+
+
+dnl gt_CHECK_DECL(FUNC, INCLUDES)
+dnl Check whether a function is declared.
+AC_DEFUN([gt_CHECK_DECL],
+[
+ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
+ [AC_TRY_COMPILE([$2], [
+#ifndef $1
+ char *p = (char *) $1;
+#endif
+], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
+ if test $ac_cv_have_decl_$1 = yes; then
+ gt_value=1
+ else
+ gt_value=0
+ fi
+ AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
+ [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
+])
diff --git a/lgl/m4/intldir.m4 b/lgl/m4/intldir.m4
new file mode 100644
index 0000000000..7a28843f64
--- /dev/null
+++ b/lgl/m4/intldir.m4
@@ -0,0 +1,19 @@
+# intldir.m4 serial 1 (gettext-0.16)
+dnl Copyright (C) 2006 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
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+AC_PREREQ(2.52)
+
+dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
+AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
diff --git a/lgl/m4/intmax.m4 b/lgl/m4/intmax.m4
index 2d0ad5b9a6..ce7a8a49de 100644
--- a/lgl/m4/intmax.m4
+++ b/lgl/m4/intmax.m4
@@ -1,4 +1,4 @@
-# intmax.m4 serial 3 (gettext-0.15.1)
+# intmax.m4 serial 3 (gettext-0.16)
dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lgl/m4/inttypes-h.m4 b/lgl/m4/inttypes-h.m4
deleted file mode 100644
index f8853c9335..0000000000
--- a/lgl/m4/inttypes-h.m4
+++ /dev/null
@@ -1 +0,0 @@
-/* This file will go away when gettext-0.15.1 is released. */
diff --git a/lgl/m4/inttypes-pri.m4 b/lgl/m4/inttypes-pri.m4
index d7f5a50634..7c7f89401a 100644
--- a/lgl/m4/inttypes-pri.m4
+++ b/lgl/m4/inttypes-pri.m4
@@ -1,4 +1,4 @@
-# inttypes-pri.m4 serial 4 (gettext-0.15.1)
+# inttypes-pri.m4 serial 4 (gettext-0.16)
dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lgl/m4/lib-link.m4 b/lgl/m4/lib-link.m4
index a196556c24..f95b7ba88d 100644
--- a/lgl/m4/lib-link.m4
+++ b/lgl/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 9 (gettext-0.15.1)
+# lib-link.m4 serial 9 (gettext-0.16)
dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lgl/m4/lock.m4 b/lgl/m4/lock.m4
index e031415851..0224f2ff87 100644
--- a/lgl/m4/lock.m4
+++ b/lgl/m4/lock.m4
@@ -1,4 +1,4 @@
-# lock.m4 serial 6 (gettext-0.15.1)
+# lock.m4 serial 6 (gettext-0.16)
dnl Copyright (C) 2005-2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/lgl/m4/signed.m4 b/lgl/m4/signed.m4
deleted file mode 100644
index 5ac7672847..0000000000
--- a/lgl/m4/signed.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-# signed.m4 serial 2
-dnl Copyright (C) 2001-2002, 2006 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 From Bruno Haible.
-
-AC_DEFUN([bh_C_SIGNED],
-[
- AC_CACHE_CHECK([for signed], bh_cv_c_signed,
- [AC_TRY_COMPILE(, [signed char x; return !x;],
- bh_cv_c_signed=yes, bh_cv_c_signed=no)])
- if test $bh_cv_c_signed = no; then
- AC_DEFINE(signed, ,
- [Define to empty if the C compiler doesn't support this keyword.])
- fi
-])
diff --git a/lgl/m4/sys_stat_h.m4 b/lgl/m4/sys_stat_h.m4
index c432ac2544..9ca13116b1 100644
--- a/lgl/m4/sys_stat_h.m4
+++ b/lgl/m4/sys_stat_h.m4
@@ -1,4 +1,4 @@
-# sys_stat_h.m4 serial 3 -*- Autoconf -*-
+# sys_stat_h.m4 serial 4 -*- Autoconf -*-
dnl Copyright (C) 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -15,18 +15,18 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard <io.h>
dnl instead.
- AC_CHECK_DECLS([mkdir], [], [], [#include <sys/stat.h>])
+ AC_CHECK_DECLS([mkdir],
+ [],
+ [AC_CHECK_HEADERS([io.h])],
+ [#include <sys/stat.h>])
+ AC_REQUIRE([AC_C_INLINE])
- SYS_STAT_H=
- if test $ac_cv_func_lstat:$ac_cv_have_decl_mkdir != yes:yes ; then
- gl_ABSOLUTE_HEADER([sys/stat.h])
- ABSOLUTE_SYS_STAT_H=\"$gl_cv_absolute_sys_stat_h\"
- AC_CHECK_HEADERS([io.h])
- AC_REQUIRE([AC_C_INLINE])
- SYS_STAT_H='sys/stat.h'
- else
- ABSOLUTE_SYS_STAT_H=\"no/such/file/sys/stat.h\"
- fi
+ dnl Check for broken stat macros.
+ AC_REQUIRE([AC_HEADER_STAT])
+
+ gl_ABSOLUTE_HEADER([sys/stat.h])
+ ABSOLUTE_SYS_STAT_H=\"$gl_cv_absolute_sys_stat_h\"
AC_SUBST([ABSOLUTE_SYS_STAT_H])
+ SYS_STAT_H='sys/stat.h'
AC_SUBST([SYS_STAT_H])
]) # gl_HEADER_SYS_STAT_H
diff --git a/lgl/m4/unistd_h.m4 b/lgl/m4/unistd_h.m4
new file mode 100644
index 0000000000..9c77f9bd0d
--- /dev/null
+++ b/lgl/m4/unistd_h.m4
@@ -0,0 +1,18 @@
+# unistd_h.m4 serial 2
+dnl Copyright (C) 2006 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 Simon Josefsson
+
+AC_DEFUN([gl_HEADER_UNISTD],
+[
+ dnl Prerequisites of lib/unistd.h.
+ AC_CHECK_HEADERS([unistd.h], [
+ UNISTD_H=''
+ ], [
+ UNISTD_H='unistd.h'
+ ])
+ AC_SUBST(UNISTD_H)
+])
diff --git a/lgl/m4/vasnprintf.m4 b/lgl/m4/vasnprintf.m4
index 32d3149b5f..72c9a13e2f 100644
--- a/lgl/m4/vasnprintf.m4
+++ b/lgl/m4/vasnprintf.m4
@@ -1,4 +1,4 @@
-# vasnprintf.m4 serial 6
+# vasnprintf.m4 serial 7
dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,6 @@ AC_DEFUN([gl_FUNC_VASNPRINTF],
# Prequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
- AC_REQUIRE([bh_C_SIGNED])
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_LONGDOUBLE])
AC_REQUIRE([gt_TYPE_WCHAR_T])
diff --git a/lgl/md2.c b/lgl/md2.c
index b7b607a40e..63033ef568 100644
--- a/lgl/md2.c
+++ b/lgl/md2.c
@@ -1,6 +1,6 @@
/* Functions to compute MD2 message digest of files or memory blocks.
according to the definition of MD2 in RFC 1319 from April 1992.
- Copyright (C) 1995,1996,1997,1999,2000,2001,2002,2003,2005
+ Copyright (C) 1995,1996,1997,1999,2000,2001,2002,2003,2005,2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -20,9 +20,7 @@
/* Adapted by Simon Josefsson from public domain Libtomcrypt 1.06 by
Tom St Denis. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "md2.h"
diff --git a/lgl/md4.c b/lgl/md4.c
index 74ee419b2c..d3f6e3869c 100644
--- a/lgl/md4.c
+++ b/lgl/md4.c
@@ -20,9 +20,7 @@
/* Adapted by Simon Josefsson from gnulib md5.? and Libgcrypt
cipher/md4.c . */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "md4.h"
diff --git a/lgl/memxor.c b/lgl/memxor.c
index a046844604..7b0b6ae955 100644
--- a/lgl/memxor.c
+++ b/lgl/memxor.c
@@ -1,5 +1,5 @@
/* memxor.c -- perform binary exclusive OR operation of two memory blocks.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -18,9 +18,7 @@
/* Written by Simon Josefsson. The interface was inspired by memxor
in Niels Möller's Nettle. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "memxor.h"
diff --git a/lgl/read-file.c b/lgl/read-file.c
index e915b10920..5771488ab1 100644
--- a/lgl/read-file.c
+++ b/lgl/read-file.c
@@ -16,9 +16,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
#include "read-file.h"
diff --git a/lgl/rijndael-alg-fst.c b/lgl/rijndael-alg-fst.c
index 5bc5e7e072..ff2d024eea 100644
--- a/lgl/rijndael-alg-fst.c
+++ b/lgl/rijndael-alg-fst.c
@@ -1,5 +1,5 @@
/* rijndael-alg-fst.c --- Rijndael cipher implementation.
- * Copyright (C) 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2005, 2006 Free Software Foundation, Inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -25,9 +25,7 @@
* http://www.iaik.tu-graz.ac.at/research/krypto/AES/old/~rijmen/rijndael/rijndael-fst-3.0.zip
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
/**
* rijndael-alg-fst.c
diff --git a/lgl/rijndael-api-fst.c b/lgl/rijndael-api-fst.c
index 85cc480e8f..bfa49b5b55 100644
--- a/lgl/rijndael-api-fst.c
+++ b/lgl/rijndael-api-fst.c
@@ -25,9 +25,7 @@
* http://www.iaik.tu-graz.ac.at/research/krypto/AES/old/~rijmen/rijndael/rijndael-fst-3.0.zip
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
/**
* rijndael-api-fst.c
diff --git a/lgl/stat_.h b/lgl/stat_.h
index 4be57238f9..bc1db08d9a 100644
--- a/lgl/stat_.h
+++ b/lgl/stat_.h
@@ -1,6 +1,5 @@
-/* Provide a complete sys/stat header file.
+/* Provide a more complete sys/stat header file.
Copyright (C) 2006 Free Software Foundation, Inc.
- Written by Eric Blake.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -16,6 +15,8 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */
+
#ifndef _gl_SYS_STAT_H
#define _gl_SYS_STAT_H
@@ -24,6 +25,232 @@
needed by an application. Start with what the system provides. */
#include @ABSOLUTE_SYS_STAT_H@
+#ifndef S_IFMT
+# define S_IFMT 0170000
+#endif
+
+#if STAT_MACROS_BROKEN
+# undef S_ISBLK
+# undef S_ISCHR
+# undef S_ISDIR
+# undef S_ISFIFO
+# undef S_ISLNK
+# undef S_ISNAM
+# undef S_ISMPB
+# undef S_ISMPC
+# undef S_ISNWK
+# undef S_ISREG
+# undef S_ISSOCK
+#endif
+
+#ifndef S_ISBLK
+# ifdef S_IFBLK
+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+# else
+# define S_ISBLK(m) 0
+# endif
+#endif
+
+#ifndef S_ISCHR
+# ifdef S_IFCHR
+# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+# else
+# define S_ISCHR(m) 0
+# endif
+#endif
+
+#ifndef S_ISDIR
+# ifdef S_IFDIR
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+# else
+# define S_ISDIR(m) 0
+# endif
+#endif
+
+#ifndef S_ISDOOR /* Solaris 2.5 and up */
+# define S_ISDOOR(m) 0
+#endif
+
+#ifndef S_ISFIFO
+# ifdef S_IFIFO
+# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+# else
+# define S_ISFIFO(m) 0
+# endif
+#endif
+
+#ifndef S_ISLNK
+# ifdef S_IFLNK
+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+# else
+# define S_ISLNK(m) 0
+# endif
+#endif
+
+#ifndef S_ISMPB /* V7 */
+# ifdef S_IFMPB
+# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
+# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
+# else
+# define S_ISMPB(m) 0
+# define S_ISMPC(m) 0
+# endif
+#endif
+
+#ifndef S_ISNAM /* Xenix */
+# ifdef S_IFNAM
+# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
+# else
+# define S_ISNAM(m) 0
+# endif
+#endif
+
+#ifndef S_ISNWK /* HP/UX */
+# ifdef S_IFNWK
+# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
+# else
+# define S_ISNWK(m) 0
+# endif
+#endif
+
+#ifndef S_ISPORT /* Solaris 10 and up */
+# define S_ISPORT(m) 0
+#endif
+
+#ifndef S_ISREG
+# ifdef S_IFREG
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+# else
+# define S_ISREG(m) 0
+# endif
+#endif
+
+#ifndef S_ISSOCK
+# ifdef S_IFSOCK
+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+# else
+# define S_ISSOCK(m) 0
+# endif
+#endif
+
+
+#ifndef S_TYPEISMQ
+# define S_TYPEISMQ(p) 0
+#endif
+
+#ifndef S_TYPEISTMO
+# define S_TYPEISTMO(p) 0
+#endif
+
+
+#ifndef S_TYPEISSEM
+# ifdef S_INSEM
+# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM)
+# else
+# define S_TYPEISSEM(p) 0
+# endif
+#endif
+
+#ifndef S_TYPEISSHM
+# ifdef S_INSHD
+# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD)
+# else
+# define S_TYPEISSHM(p) 0
+# endif
+#endif
+
+/* high performance ("contiguous data") */
+#ifndef S_ISCTG
+# define S_ISCTG(p) 0
+#endif
+
+/* Cray DMF (data migration facility): off line, with data */
+#ifndef S_ISOFD
+# define S_ISOFD(p) 0
+#endif
+
+/* Cray DMF (data migration facility): off line, with no data */
+#ifndef S_ISOFL
+# define S_ISOFL(p) 0
+#endif
+
+/* 4.4BSD whiteout */
+#ifndef S_ISWHT
+# define S_ISWHT(m) 0
+#endif
+
+/* If any of the following are undefined,
+ define them to their de facto standard values. */
+#if !S_ISUID
+# define S_ISUID 04000
+#endif
+#if !S_ISGID
+# define S_ISGID 02000
+#endif
+
+/* S_ISVTX is a common extension to POSIX. */
+#ifndef S_ISVTX
+# define S_ISVTX 01000
+#endif
+
+#if !S_IRUSR && S_IREAD
+# define S_IRUSR S_IREAD
+#endif
+#if !S_IRUSR
+# define S_IRUSR 00400
+#endif
+#if !S_IRGRP
+# define S_IRGRP (S_IRUSR >> 3)
+#endif
+#if !S_IROTH
+# define S_IROTH (S_IRUSR >> 6)
+#endif
+
+#if !S_IWUSR && S_IWRITE
+# define S_IWUSR S_IWRITE
+#endif
+#if !S_IWUSR
+# define S_IWUSR 00200
+#endif
+#if !S_IWGRP
+# define S_IWGRP (S_IWUSR >> 3)
+#endif
+#if !S_IWOTH
+# define S_IWOTH (S_IWUSR >> 6)
+#endif
+
+#if !S_IXUSR && S_IEXEC
+# define S_IXUSR S_IEXEC
+#endif
+#if !S_IXUSR
+# define S_IXUSR 00100
+#endif
+#if !S_IXGRP
+# define S_IXGRP (S_IXUSR >> 3)
+#endif
+#if !S_IXOTH
+# define S_IXOTH (S_IXUSR >> 6)
+#endif
+
+#if !S_IRWXU
+# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
+#endif
+#if !S_IRWXG
+# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
+#endif
+#if !S_IRWXO
+# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
+#endif
+
+/* S_IXUGO is a common extension to POSIX. */
+#if !S_IXUGO
+# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
+#endif
+
+#ifndef S_IRWXUGO
+# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
+#endif
+
/* mingw does not support symlinks, therefore it does not have lstat. But
without links, stat does just fine. */
#if ! HAVE_LSTAT