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
commitefa0d800987baa5e7a921e94e93b08bdbc268950 (patch)
tree8dec0a0cf3cd09ad4d7f063e3fa3216c24714e1d
parent7acf8c36cd2da7f0b4cff26d175a03444dc408b2 (diff)
downloadgnutls-efa0d800987baa5e7a921e94e93b08bdbc268950.tar.gz
Update.
-rw-r--r--lgl/m4/gnulib-comp.m412
-rw-r--r--lgl/m4/sys_stat_h.m432
-rw-r--r--lgl/stat_.h48
3 files changed, 92 insertions, 0 deletions
diff --git a/lgl/m4/gnulib-comp.m4 b/lgl/m4/gnulib-comp.m4
index e1ff3c8bad..13e72201df 100644
--- a/lgl/m4/gnulib-comp.m4
+++ b/lgl/m4/gnulib-comp.m4
@@ -60,12 +60,16 @@ AC_DEFUN([lgl_INIT],
AM_GNU_GETTEXT_VERSION([0.15])
gl_MD2
gl_FUNC_MEMMEM
+ gl_FUNC_MEMMOVE
gl_MINMAX
+ gl_FUNC_READ_FILE
gl_SIZE_MAX
gl_FUNC_SNPRINTF
gl_TYPE_SOCKLEN_T
gl_STDINT_H
gl_HEADER_SYS_SOCKET
+ gl_HEADER_SYS_STAT_H
+ gl_HEADER_UNISTD
gl_FUNC_VASNPRINTF
gl_XSIZE
m4_popdef([AC_REPLACE_FUNCS])
@@ -125,6 +129,7 @@ AC_DEFUN([lgl_FILE_LIST], [
lib/md5.h
lib/memmem.c
lib/memmem.h
+ lib/memmove.c
lib/memxor.c
lib/memxor.h
lib/minmax.h
@@ -132,6 +137,8 @@ AC_DEFUN([lgl_FILE_LIST], [
lib/printf-args.h
lib/printf-parse.c
lib/printf-parse.h
+ lib/read-file.c
+ lib/read-file.h
lib/rijndael-alg-fst.c
lib/rijndael-alg-fst.h
lib/rijndael-api-fst.c
@@ -142,6 +149,7 @@ AC_DEFUN([lgl_FILE_LIST], [
lib/snprintf.c
lib/snprintf.h
lib/socket_.h
+ lib/stat_.h
lib/stdint_.h
lib/vasnprintf.c
lib/vasnprintf.h
@@ -189,12 +197,14 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/md4.m4
m4/md5.m4
m4/memmem.m4
+ m4/memmove.m4
m4/memxor.m4
m4/minmax.m4
m4/nls.m4
m4/po.m4
m4/printf-posix.m4
m4/progtest.m4
+ m4/read-file.m4
m4/rijndael.m4
m4/sha1.m4
m4/signed.m4
@@ -205,8 +215,10 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/stdint.m4
m4/stdint_h.m4
m4/sys_socket_h.m4
+ m4/sys_stat_h.m4
m4/uintmax_t.m4
m4/ulonglong.m4
+ m4/unistd_h.m4
m4/vasnprintf.m4
m4/visibility.m4
m4/wchar_t.m4
diff --git a/lgl/m4/sys_stat_h.m4 b/lgl/m4/sys_stat_h.m4
new file mode 100644
index 0000000000..c432ac2544
--- /dev/null
+++ b/lgl/m4/sys_stat_h.m4
@@ -0,0 +1,32 @@
+# sys_stat_h.m4 serial 3 -*- 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,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Eric Blake.
+dnl Test whether <sys/stat.h> contains lstat and mkdir or must be substituted.
+
+AC_DEFUN([gl_HEADER_SYS_STAT_H],
+[
+ dnl Check for lstat. Systems that lack it (mingw) also lack symlinks, so
+ dnl stat is a good replacement.
+ AC_CHECK_FUNCS_ONCE([lstat])
+
+ dnl Check for mkdir. Mingw has _mkdir(name) in the nonstandard <io.h>
+ dnl instead.
+ AC_CHECK_DECLS([mkdir], [], [], [#include <sys/stat.h>])
+
+ 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
+ AC_SUBST([ABSOLUTE_SYS_STAT_H])
+ AC_SUBST([SYS_STAT_H])
+]) # gl_HEADER_SYS_STAT_H
diff --git a/lgl/stat_.h b/lgl/stat_.h
new file mode 100644
index 0000000000..4be57238f9
--- /dev/null
+++ b/lgl/stat_.h
@@ -0,0 +1,48 @@
+/* Provide a 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
+ the Free Software Foundation; either version 2.1, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifndef _gl_SYS_STAT_H
+#define _gl_SYS_STAT_H
+
+/* This file is supposed to be used on platforms where <sys/stat.h> is
+ incomplete. It is intended to provide definitions and prototypes
+ needed by an application. Start with what the system provides. */
+#include @ABSOLUTE_SYS_STAT_H@
+
+/* 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
+
+/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
+ Additionally, it declares _mkdir (and depending on compile flags, an
+ alias mkdir), only in the nonstandard io.h. */
+#if ! HAVE_DECL_MKDIR && HAVE_IO_H
+# include <io.h>
+
+static inline int
+rpl_mkdir (char const *name, mode_t mode)
+{
+ return _mkdir (name);
+}
+
+# define mkdir rpl_mkdir
+#endif
+
+#endif /* _gl_SYS_STAT_H */