Import rename module

This patch is to import rename module.

gdb:

2014-11-28  Yao Qi  <yao@codesourcery.com>

	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add
	rename.
	* gnulib/aclocal.m4: Re-generated.
	* gnulib/config.in: Re-generated.
	* gnulib/configure: Re-generated.
	* gnulib/import/Makefile.am: Re-generated.
	* gnulib/import/Makefile.in: Re-generated.
	* gnulib/import/m4/gnulib-cache.m4: Re-generated.
	* gnulib/import/m4/gnulib-comp.m4: Re-generated.
	* import/basename-lgpl.c: New file.
	* import/dirname-lgpl.c: New file.
	* import/dirname.h: New file.
	* import/m4/dirname.m4: New file.
	* import/m4/malloc.m4: New file.
	* import/m4/rename.m4: New file.
	* import/m4/rmdir.m4: New file.
	* import/m4/stdio_h.m4: New file.
	* import/malloc.c: New file.
	* import/rename.c: New file.
	* import/rmdir.c: New file.
	* import/same-inode.h: New file.
	* import/stdio.c: New file.
	* import/stdio.in.h: New file.
	* import/stripslash.c: New file.
This commit is contained in:
Yao Qi 2014-11-23 22:19:49 +08:00
parent abbffc8924
commit 6a29c58ef8
24 changed files with 4303 additions and 35 deletions

View File

@ -1,3 +1,30 @@
2014-11-28 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add
rename.
* gnulib/aclocal.m4: Re-generated.
* gnulib/config.in: Re-generated.
* gnulib/configure: Re-generated.
* gnulib/import/Makefile.am: Re-generated.
* gnulib/import/Makefile.in: Re-generated.
* gnulib/import/m4/gnulib-cache.m4: Re-generated.
* gnulib/import/m4/gnulib-comp.m4: Re-generated.
* import/basename-lgpl.c: New file.
* import/dirname-lgpl.c: New file.
* import/dirname.h: New file.
* import/m4/dirname.m4: New file.
* import/m4/malloc.m4: New file.
* import/m4/rename.m4: New file.
* import/m4/rmdir.m4: New file.
* import/m4/stdio_h.m4: New file.
* import/malloc.c: New file.
* import/rename.c: New file.
* import/rmdir.c: New file.
* import/same-inode.h: New file.
* import/stdio.c: New file.
* import/stdio.in.h: New file.
* import/stripslash.c: New file.
2014-11-28 Yao Qi <yao@codesourcery.com>
* configure.ac (AC_CHECK_FUNCS): Remove canonicalize_file_name

View File

@ -1019,6 +1019,7 @@ m4_include([import/m4/codeset.m4])
m4_include([import/m4/configmake.m4])
m4_include([import/m4/dirent_h.m4])
m4_include([import/m4/dirfd.m4])
m4_include([import/m4/dirname.m4])
m4_include([import/m4/double-slash-root.m4])
m4_include([import/m4/eealloc.m4])
m4_include([import/m4/errno_h.m4])
@ -1047,6 +1048,7 @@ m4_include([import/m4/locale-ja.m4])
m4_include([import/m4/locale-zh.m4])
m4_include([import/m4/longlong.m4])
m4_include([import/m4/lstat.m4])
m4_include([import/m4/malloc.m4])
m4_include([import/m4/malloca.m4])
m4_include([import/m4/math_h.m4])
m4_include([import/m4/mbrtowc.m4])
@ -1061,11 +1063,14 @@ m4_include([import/m4/nocrash.m4])
m4_include([import/m4/off_t.m4])
m4_include([import/m4/pathmax.m4])
m4_include([import/m4/readlink.m4])
m4_include([import/m4/rename.m4])
m4_include([import/m4/rmdir.m4])
m4_include([import/m4/ssize_t.m4])
m4_include([import/m4/stat.m4])
m4_include([import/m4/stdbool.m4])
m4_include([import/m4/stddef_h.m4])
m4_include([import/m4/stdint.m4])
m4_include([import/m4/stdio_h.m4])
m4_include([import/m4/stdlib_h.m4])
m4_include([import/m4/string_h.m4])
m4_include([import/m4/strstr.m4])

View File

@ -54,10 +54,21 @@
whether the gnulib module canonicalize-lgpl shall be considered present. */
#undef GNULIB_CANONICALIZE_LGPL
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
whether the gnulib module fscanf shall be considered present. */
#undef GNULIB_FSCANF
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
whether the gnulib module scanf shall be considered present. */
#undef GNULIB_SCANF
/* Define to 1 when the gnulib module canonicalize_file_name should be tested.
*/
#undef GNULIB_TEST_CANONICALIZE_FILE_NAME
/* Define to 1 when the gnulib module chdir should be tested. */
#undef GNULIB_TEST_CHDIR
/* Define to 1 when the gnulib module dirfd should be tested. */
#undef GNULIB_TEST_DIRFD
@ -70,6 +81,9 @@
/* Define to 1 when the gnulib module lstat should be tested. */
#undef GNULIB_TEST_LSTAT
/* Define to 1 when the gnulib module malloc-posix should be tested. */
#undef GNULIB_TEST_MALLOC_POSIX
/* Define to 1 when the gnulib module mbrtowc should be tested. */
#undef GNULIB_TEST_MBRTOWC
@ -91,6 +105,12 @@
/* Define to 1 when the gnulib module realpath should be tested. */
#undef GNULIB_TEST_REALPATH
/* Define to 1 when the gnulib module rename should be tested. */
#undef GNULIB_TEST_RENAME
/* Define to 1 when the gnulib module rmdir should be tested. */
#undef GNULIB_TEST_RMDIR
/* Define to 1 when the gnulib module stat should be tested. */
#undef GNULIB_TEST_STAT
@ -188,12 +208,18 @@
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#undef HAVE_LANGINFO_CODESET
/* Define to 1 if you have the `link' function. */
#undef HAVE_LINK
/* Define to 1 if the system has the type 'long long int'. */
#undef HAVE_LONG_LONG_INT
/* Define to 1 if you have the `lstat' function. */
#undef HAVE_LSTAT
/* Define if the 'malloc' function is POSIX compliant. */
#undef HAVE_MALLOC_POSIX
/* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
config.h and <sys/mman.h>. */
#undef HAVE_MAP_ANONYMOUS
@ -301,6 +327,9 @@
/* Define to 1 if dirfd is declared even after undefining macros. */
#undef HAVE_RAW_DECL_DIRFD
/* Define to 1 if dprintf is declared even after undefining macros. */
#undef HAVE_RAW_DECL_DPRINTF
/* Define to 1 if dup is declared even after undefining macros. */
#undef HAVE_RAW_DECL_DUP
@ -397,12 +426,18 @@
/* Define to 1 if fmodl is declared even after undefining macros. */
#undef HAVE_RAW_DECL_FMODL
/* Define to 1 if fpurge is declared even after undefining macros. */
#undef HAVE_RAW_DECL_FPURGE
/* Define to 1 if frexpf is declared even after undefining macros. */
#undef HAVE_RAW_DECL_FREXPF
/* Define to 1 if frexpl is declared even after undefining macros. */
#undef HAVE_RAW_DECL_FREXPL
/* Define to 1 if fseeko is declared even after undefining macros. */
#undef HAVE_RAW_DECL_FSEEKO
/* Define to 1 if fstat is declared even after undefining macros. */
#undef HAVE_RAW_DECL_FSTAT
@ -412,6 +447,9 @@
/* Define to 1 if fsync is declared even after undefining macros. */
#undef HAVE_RAW_DECL_FSYNC
/* Define to 1 if ftello is declared even after undefining macros. */
#undef HAVE_RAW_DECL_FTELLO
/* Define to 1 if ftruncate is declared even after undefining macros. */
#undef HAVE_RAW_DECL_FTRUNCATE
@ -421,6 +459,9 @@
/* Define to 1 if getcwd is declared even after undefining macros. */
#undef HAVE_RAW_DECL_GETCWD
/* Define to 1 if getdelim is declared even after undefining macros. */
#undef HAVE_RAW_DECL_GETDELIM
/* Define to 1 if getdomainname is declared even after undefining macros. */
#undef HAVE_RAW_DECL_GETDOMAINNAME
@ -433,6 +474,9 @@
/* Define to 1 if gethostname is declared even after undefining macros. */
#undef HAVE_RAW_DECL_GETHOSTNAME
/* Define to 1 if getline is declared even after undefining macros. */
#undef HAVE_RAW_DECL_GETLINE
/* Define to 1 if getloadavg is declared even after undefining macros. */
#undef HAVE_RAW_DECL_GETLOADAVG
@ -445,6 +489,9 @@
/* Define to 1 if getpagesize is declared even after undefining macros. */
#undef HAVE_RAW_DECL_GETPAGESIZE
/* Define to 1 if gets is declared even after undefining macros. */
#undef HAVE_RAW_DECL_GETS
/* Define to 1 if getsubopt is declared even after undefining macros. */
#undef HAVE_RAW_DECL_GETSUBOPT
@ -625,12 +672,18 @@
/* Define to 1 if opendir is declared even after undefining macros. */
#undef HAVE_RAW_DECL_OPENDIR
/* Define to 1 if pclose is declared even after undefining macros. */
#undef HAVE_RAW_DECL_PCLOSE
/* Define to 1 if pipe is declared even after undefining macros. */
#undef HAVE_RAW_DECL_PIPE
/* Define to 1 if pipe2 is declared even after undefining macros. */
#undef HAVE_RAW_DECL_PIPE2
/* Define to 1 if popen is declared even after undefining macros. */
#undef HAVE_RAW_DECL_POPEN
/* Define to 1 if posix_openpt is declared even after undefining macros. */
#undef HAVE_RAW_DECL_POSIX_OPENPT
@ -679,6 +732,9 @@
/* Define to 1 if remainderl is declared even after undefining macros. */
#undef HAVE_RAW_DECL_REMAINDERL
/* Define to 1 if renameat is declared even after undefining macros. */
#undef HAVE_RAW_DECL_RENAMEAT
/* Define to 1 if rewinddir is declared even after undefining macros. */
#undef HAVE_RAW_DECL_REWINDDIR
@ -736,6 +792,9 @@
/* Define to 1 if sleep is declared even after undefining macros. */
#undef HAVE_RAW_DECL_SLEEP
/* Define to 1 if snprintf is declared even after undefining macros. */
#undef HAVE_RAW_DECL_SNPRINTF
/* Define to 1 if sqrtf is declared even after undefining macros. */
#undef HAVE_RAW_DECL_SQRTF
@ -823,6 +882,9 @@
/* Define to 1 if tanl is declared even after undefining macros. */
#undef HAVE_RAW_DECL_TANL
/* Define to 1 if tmpfile is declared even after undefining macros. */
#undef HAVE_RAW_DECL_TMPFILE
/* Define to 1 if towctrans is declared even after undefining macros. */
#undef HAVE_RAW_DECL_TOWCTRANS
@ -856,6 +918,12 @@
/* Define to 1 if utimensat is declared even after undefining macros. */
#undef HAVE_RAW_DECL_UTIMENSAT
/* Define to 1 if vdprintf is declared even after undefining macros. */
#undef HAVE_RAW_DECL_VDPRINTF
/* Define to 1 if vsnprintf is declared even after undefining macros. */
#undef HAVE_RAW_DECL_VSNPRINTF
/* Define to 1 if wcpcpy is declared even after undefining macros. */
#undef HAVE_RAW_DECL_WCPCPY
@ -1114,6 +1182,22 @@
/* Define to 1 if readlink fails to recognize a trailing slash. */
#undef READLINK_TRAILING_SLASH_BUG
/* Define if rename does not work when the destination file exists, as on
Cygwin 1.5 or Windows. */
#undef RENAME_DEST_EXISTS_BUG
/* Define if rename fails to leave hard links alone, as on NetBSD 1.6 or
Cygwin 1.5. */
#undef RENAME_HARD_LINK_BUG
/* Define if rename does not correctly handle slashes on the destination
argument, such as on Solaris 10 or NetBSD 1.6. */
#undef RENAME_TRAILING_SLASH_DEST_BUG
/* Define if rename does not correctly handle slashes on the source argument,
such as on Solaris 9 or cygwin 1.5. */
#undef RENAME_TRAILING_SLASH_SOURCE_BUG
/* Define to 1 if stat needs help when passed a directory name with a trailing
slash */
#undef REPLACE_FUNC_STAT_DIR

921
gdb/gnulib/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca canonicalize-lgpl dirent dirfd errno fnmatch-gnu frexpl inttypes lstat memchr memmem pathmax readlink strstr sys_stat unistd update-copyright wchar wctype-h
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca canonicalize-lgpl dirent dirfd errno fnmatch-gnu frexpl inttypes lstat memchr memmem pathmax readlink rename strstr sys_stat unistd update-copyright wchar wctype-h
AUTOMAKE_OPTIONS = 1.5 gnits
@ -193,6 +193,14 @@ EXTRA_libgnu_a_SOURCES += dirfd.c
## end gnulib module dirfd
## begin gnulib module dirname-lgpl
libgnu_a_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
EXTRA_DIST += dirname.h
## end gnulib module dirname-lgpl
## begin gnulib module dosname
@ -461,6 +469,15 @@ EXTRA_libgnu_a_SOURCES += lstat.c
## end gnulib module lstat
## begin gnulib module malloc-posix
EXTRA_DIST += malloc.c
EXTRA_libgnu_a_SOURCES += malloc.c
## end gnulib module malloc-posix
## begin gnulib module malloca
libgnu_a_SOURCES += malloca.c
@ -814,6 +831,31 @@ EXTRA_libgnu_a_SOURCES += readlink.c
## end gnulib module readlink
## begin gnulib module rename
EXTRA_DIST += rename.c
EXTRA_libgnu_a_SOURCES += rename.c
## end gnulib module rename
## begin gnulib module rmdir
EXTRA_DIST += rmdir.c
EXTRA_libgnu_a_SOURCES += rmdir.c
## end gnulib module rmdir
## begin gnulib module same-inode
EXTRA_DIST += same-inode.h
## end gnulib module same-inode
## begin gnulib module snippet/_Noreturn
# Because this Makefile snippet defines a variable used by other
@ -1007,6 +1049,135 @@ EXTRA_DIST += stdint.in.h
## end gnulib module stdint
## begin gnulib module stdio
BUILT_SOURCES += stdio.h
libgnu_a_SOURCES += stdio.c
# We need the following in order to create <stdio.h> when the system
# doesn't have one that works with the given compiler.
stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
-e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
-e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
-e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
-e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
-e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
-e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
-e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
-e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
-e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
-e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
-e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
-e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
-e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
-e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
-e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
-e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
-e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
-e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
-e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
-e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
-e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
-e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
-e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
-e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
-e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
-e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
-e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
-e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
-e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
-e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
-e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
-e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
-e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
-e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
-e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
-e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
-e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
-e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
-e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
-e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
-e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
-e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
-e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
-e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
-e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
-e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
< $(srcdir)/stdio.in.h | \
sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
-e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
-e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
-e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
-e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
-e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
-e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
-e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
-e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
-e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
-e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
-e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
-e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
-e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
-e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
-e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
-e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
-e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
-e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
-e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
-e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
-e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
MOSTLYCLEANFILES += stdio.h stdio.h-t
EXTRA_DIST += stdio.in.h
## end gnulib module stdio
## begin gnulib module stdlib
BUILT_SOURCES += stdlib.h

View File

@ -36,7 +36,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca canonicalize-lgpl dirent dirfd errno fnmatch-gnu frexpl inttypes lstat memchr memmem pathmax readlink strstr sys_stat unistd update-copyright wchar wctype-h
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca canonicalize-lgpl dirent dirfd errno fnmatch-gnu frexpl inttypes lstat memchr memmem pathmax readlink rename strstr sys_stat unistd update-copyright wchar wctype-h
@ -70,6 +70,7 @@ am__aclocal_m4_deps = $(top_srcdir)/import/m4/00gnulib.m4 \
$(top_srcdir)/import/m4/configmake.m4 \
$(top_srcdir)/import/m4/dirent_h.m4 \
$(top_srcdir)/import/m4/dirfd.m4 \
$(top_srcdir)/import/m4/dirname.m4 \
$(top_srcdir)/import/m4/double-slash-root.m4 \
$(top_srcdir)/import/m4/eealloc.m4 \
$(top_srcdir)/import/m4/errno_h.m4 \
@ -98,6 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/import/m4/00gnulib.m4 \
$(top_srcdir)/import/m4/locale-zh.m4 \
$(top_srcdir)/import/m4/longlong.m4 \
$(top_srcdir)/import/m4/lstat.m4 \
$(top_srcdir)/import/m4/malloc.m4 \
$(top_srcdir)/import/m4/malloca.m4 \
$(top_srcdir)/import/m4/math_h.m4 \
$(top_srcdir)/import/m4/mbrtowc.m4 \
@ -112,11 +114,14 @@ am__aclocal_m4_deps = $(top_srcdir)/import/m4/00gnulib.m4 \
$(top_srcdir)/import/m4/off_t.m4 \
$(top_srcdir)/import/m4/pathmax.m4 \
$(top_srcdir)/import/m4/readlink.m4 \
$(top_srcdir)/import/m4/rename.m4 \
$(top_srcdir)/import/m4/rmdir.m4 \
$(top_srcdir)/import/m4/ssize_t.m4 \
$(top_srcdir)/import/m4/stat.m4 \
$(top_srcdir)/import/m4/stdbool.m4 \
$(top_srcdir)/import/m4/stddef_h.m4 \
$(top_srcdir)/import/m4/stdint.m4 \
$(top_srcdir)/import/m4/stdio_h.m4 \
$(top_srcdir)/import/m4/stdlib_h.m4 \
$(top_srcdir)/import/m4/string_h.m4 \
$(top_srcdir)/import/m4/strstr.m4 \
@ -138,9 +143,10 @@ CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
libgnu_a_AR = $(AR) $(ARFLAGS)
am__DEPENDENCIES_1 =
am_libgnu_a_OBJECTS = localcharset.$(OBJEXT) malloca.$(OBJEXT) \
math.$(OBJEXT) strnlen1.$(OBJEXT) unistd.$(OBJEXT) \
wctype-h.$(OBJEXT)
am_libgnu_a_OBJECTS = dirname-lgpl.$(OBJEXT) basename-lgpl.$(OBJEXT) \
stripslash.$(OBJEXT) localcharset.$(OBJEXT) malloca.$(OBJEXT) \
math.$(OBJEXT) stdio.$(OBJEXT) strnlen1.$(OBJEXT) \
unistd.$(OBJEXT) wctype-h.$(OBJEXT)
libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS)
LTLIBRARIES = $(noinst_LTLIBRARIES)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@ -266,6 +272,7 @@ GNULIB_COSF = @GNULIB_COSF@
GNULIB_COSHF = @GNULIB_COSHF@
GNULIB_COSL = @GNULIB_COSL@
GNULIB_DIRFD = @GNULIB_DIRFD@
GNULIB_DPRINTF = @GNULIB_DPRINTF@
GNULIB_DUP = @GNULIB_DUP@
GNULIB_DUP2 = @GNULIB_DUP2@
GNULIB_DUP3 = @GNULIB_DUP3@
@ -285,10 +292,15 @@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
GNULIB_FCHDIR = @GNULIB_FCHDIR@
GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
GNULIB_FCLOSE = @GNULIB_FCLOSE@
GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
GNULIB_FDOPEN = @GNULIB_FDOPEN@
GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
GNULIB_FFLUSH = @GNULIB_FFLUSH@
GNULIB_FFSL = @GNULIB_FFSL@
GNULIB_FFSLL = @GNULIB_FFSLL@
GNULIB_FGETC = @GNULIB_FGETC@
GNULIB_FGETS = @GNULIB_FGETS@
GNULIB_FLOOR = @GNULIB_FLOOR@
GNULIB_FLOORF = @GNULIB_FLOORF@
GNULIB_FLOORL = @GNULIB_FLOORL@
@ -298,19 +310,37 @@ GNULIB_FMAL = @GNULIB_FMAL@
GNULIB_FMOD = @GNULIB_FMOD@
GNULIB_FMODF = @GNULIB_FMODF@
GNULIB_FMODL = @GNULIB_FMODL@
GNULIB_FOPEN = @GNULIB_FOPEN@
GNULIB_FPRINTF = @GNULIB_FPRINTF@
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
GNULIB_FPURGE = @GNULIB_FPURGE@
GNULIB_FPUTC = @GNULIB_FPUTC@
GNULIB_FPUTS = @GNULIB_FPUTS@
GNULIB_FREAD = @GNULIB_FREAD@
GNULIB_FREOPEN = @GNULIB_FREOPEN@
GNULIB_FREXP = @GNULIB_FREXP@
GNULIB_FREXPF = @GNULIB_FREXPF@
GNULIB_FREXPL = @GNULIB_FREXPL@
GNULIB_FSCANF = @GNULIB_FSCANF@
GNULIB_FSEEK = @GNULIB_FSEEK@
GNULIB_FSEEKO = @GNULIB_FSEEKO@
GNULIB_FSTAT = @GNULIB_FSTAT@
GNULIB_FSTATAT = @GNULIB_FSTATAT@
GNULIB_FSYNC = @GNULIB_FSYNC@
GNULIB_FTELL = @GNULIB_FTELL@
GNULIB_FTELLO = @GNULIB_FTELLO@
GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
GNULIB_FWRITE = @GNULIB_FWRITE@
GNULIB_GETC = @GNULIB_GETC@
GNULIB_GETCHAR = @GNULIB_GETCHAR@
GNULIB_GETCWD = @GNULIB_GETCWD@
GNULIB_GETDELIM = @GNULIB_GETDELIM@
GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
GNULIB_GETLINE = @GNULIB_GETLINE@
GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
@ -399,15 +429,25 @@ GNULIB_MODF = @GNULIB_MODF@
GNULIB_MODFF = @GNULIB_MODFF@
GNULIB_MODFL = @GNULIB_MODFL@
GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
GNULIB_OPENDIR = @GNULIB_OPENDIR@
GNULIB_PCLOSE = @GNULIB_PCLOSE@
GNULIB_PERROR = @GNULIB_PERROR@
GNULIB_PIPE = @GNULIB_PIPE@
GNULIB_PIPE2 = @GNULIB_PIPE2@
GNULIB_POPEN = @GNULIB_POPEN@
GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
GNULIB_POWF = @GNULIB_POWF@
GNULIB_PREAD = @GNULIB_PREAD@
GNULIB_PRINTF = @GNULIB_PRINTF@
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
GNULIB_PTSNAME = @GNULIB_PTSNAME@
GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM = @GNULIB_RANDOM@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
@ -421,6 +461,9 @@ GNULIB_REALPATH = @GNULIB_REALPATH@
GNULIB_REMAINDER = @GNULIB_REMAINDER@
GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
GNULIB_REMOVE = @GNULIB_REMOVE@
GNULIB_RENAME = @GNULIB_RENAME@
GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
GNULIB_RINT = @GNULIB_RINT@
GNULIB_RINTF = @GNULIB_RINTF@
@ -431,6 +474,7 @@ GNULIB_ROUNDF = @GNULIB_ROUNDF@
GNULIB_ROUNDL = @GNULIB_ROUNDL@
GNULIB_RPMATCH = @GNULIB_RPMATCH@
GNULIB_SCANDIR = @GNULIB_SCANDIR@
GNULIB_SCANF = @GNULIB_SCANF@
GNULIB_SETENV = @GNULIB_SETENV@
GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
@ -438,9 +482,13 @@ GNULIB_SINF = @GNULIB_SINF@
GNULIB_SINHF = @GNULIB_SINHF@
GNULIB_SINL = @GNULIB_SINL@
GNULIB_SLEEP = @GNULIB_SLEEP@
GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
GNULIB_SQRTF = @GNULIB_SQRTF@
GNULIB_SQRTL = @GNULIB_SQRTL@
GNULIB_STAT = @GNULIB_STAT@
GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
GNULIB_STPCPY = @GNULIB_STPCPY@
GNULIB_STPNCPY = @GNULIB_STPNCPY@
GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
@ -471,6 +519,7 @@ GNULIB_TANHF = @GNULIB_TANHF@
GNULIB_TANL = @GNULIB_TANL@
GNULIB_TIMEGM = @GNULIB_TIMEGM@
GNULIB_TIME_R = @GNULIB_TIME_R@
GNULIB_TMPFILE = @GNULIB_TMPFILE@
GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
GNULIB_TRUNC = @GNULIB_TRUNC@
GNULIB_TRUNCF = @GNULIB_TRUNCF@
@ -484,6 +533,16 @@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
GNULIB_UNSETENV = @GNULIB_UNSETENV@
GNULIB_USLEEP = @GNULIB_USLEEP@
GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
GNULIB_VFSCANF = @GNULIB_VFSCANF@
GNULIB_VPRINTF = @GNULIB_VPRINTF@
GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
GNULIB_VSCANF = @GNULIB_VSCANF@
GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
GNULIB_WCPCPY = @GNULIB_WCPCPY@
GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
@ -565,8 +624,13 @@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
@ -583,6 +647,7 @@ HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
@ -592,6 +657,7 @@ HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
HAVE_DECL_SINL = @HAVE_DECL_SINL@
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
@ -607,9 +673,11 @@ HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
HAVE_DIRENT_H = @HAVE_DIRENT_H@
HAVE_DPRINTF = @HAVE_DPRINTF@
HAVE_DUP2 = @HAVE_DUP2@
HAVE_DUP3 = @HAVE_DUP3@
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
@ -634,8 +702,10 @@ HAVE_FMAL = @HAVE_FMAL@
HAVE_FMODF = @HAVE_FMODF@
HAVE_FMODL = @HAVE_FMODL@
HAVE_FREXPF = @HAVE_FREXPF@
HAVE_FSEEKO = @HAVE_FSEEKO@
HAVE_FSTATAT = @HAVE_FSTATAT@
HAVE_FSYNC = @HAVE_FSYNC@
HAVE_FTELLO = @HAVE_FTELLO@
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
HAVE_FUTIMENS = @HAVE_FUTIMENS@
HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
@ -696,8 +766,10 @@ HAVE_MODFL = @HAVE_MODFL@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
HAVE_OPENDIR = @HAVE_OPENDIR@
HAVE_OS_H = @HAVE_OS_H@
HAVE_PCLOSE = @HAVE_PCLOSE@
HAVE_PIPE = @HAVE_PIPE@
HAVE_PIPE2 = @HAVE_PIPE2@
HAVE_POPEN = @HAVE_POPEN@
HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
HAVE_POWF = @HAVE_POWF@
HAVE_PREAD = @HAVE_PREAD@
@ -714,6 +786,7 @@ HAVE_READLINKAT = @HAVE_READLINKAT@
HAVE_REALPATH = @HAVE_REALPATH@
HAVE_REMAINDER = @HAVE_REMAINDER@
HAVE_REMAINDERF = @HAVE_REMAINDERF@
HAVE_RENAMEAT = @HAVE_RENAMEAT@
HAVE_REWINDDIR = @HAVE_REWINDDIR@
HAVE_RINT = @HAVE_RINT@
HAVE_RINTL = @HAVE_RINTL@
@ -761,6 +834,8 @@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
HAVE_USLEEP = @HAVE_USLEEP@
HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
HAVE_VASPRINTF = @HAVE_VASPRINTF@
HAVE_VDPRINTF = @HAVE_VDPRINTF@
HAVE_WCHAR_H = @HAVE_WCHAR_H@
HAVE_WCHAR_T = @HAVE_WCHAR_T@
HAVE_WCPCPY = @HAVE_WCPCPY@
@ -831,6 +906,7 @@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
@ -846,6 +922,7 @@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
NEXT_MATH_H = @NEXT_MATH_H@
NEXT_STDDEF_H = @NEXT_STDDEF_H@
NEXT_STDINT_H = @NEXT_STDINT_H@
NEXT_STDIO_H = @NEXT_STDIO_H@
NEXT_STDLIB_H = @NEXT_STDLIB_H@
NEXT_STRING_H = @NEXT_STRING_H@
NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
@ -882,6 +959,7 @@ REPLACE_CHOWN = @REPLACE_CHOWN@
REPLACE_CLOSE = @REPLACE_CLOSE@
REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
REPLACE_DIRFD = @REPLACE_DIRFD@
REPLACE_DPRINTF = @REPLACE_DPRINTF@
REPLACE_DUP = @REPLACE_DUP@
REPLACE_DUP2 = @REPLACE_DUP2@
REPLACE_EXP2 = @REPLACE_EXP2@
@ -890,7 +968,10 @@ REPLACE_EXPM1 = @REPLACE_EXPM1@
REPLACE_EXPM1F = @REPLACE_EXPM1F@
REPLACE_FABSL = @REPLACE_FABSL@
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
REPLACE_FDOPEN = @REPLACE_FDOPEN@
REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
REPLACE_FLOOR = @REPLACE_FLOOR@
REPLACE_FLOORF = @REPLACE_FLOORF@
REPLACE_FLOORL = @REPLACE_FLOORL@
@ -900,16 +981,26 @@ REPLACE_FMAL = @REPLACE_FMAL@
REPLACE_FMOD = @REPLACE_FMOD@
REPLACE_FMODF = @REPLACE_FMODF@
REPLACE_FMODL = @REPLACE_FMODL@
REPLACE_FOPEN = @REPLACE_FOPEN@
REPLACE_FPRINTF = @REPLACE_FPRINTF@
REPLACE_FPURGE = @REPLACE_FPURGE@
REPLACE_FREOPEN = @REPLACE_FREOPEN@
REPLACE_FREXP = @REPLACE_FREXP@
REPLACE_FREXPF = @REPLACE_FREXPF@
REPLACE_FREXPL = @REPLACE_FREXPL@
REPLACE_FSEEK = @REPLACE_FSEEK@
REPLACE_FSEEKO = @REPLACE_FSEEKO@
REPLACE_FSTAT = @REPLACE_FSTAT@
REPLACE_FSTATAT = @REPLACE_FSTATAT@
REPLACE_FTELL = @REPLACE_FTELL@
REPLACE_FTELLO = @REPLACE_FTELLO@
REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
REPLACE_GETCWD = @REPLACE_GETCWD@
REPLACE_GETDELIM = @REPLACE_GETDELIM@
REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
REPLACE_GETLINE = @REPLACE_GETLINE@
REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
@ -968,8 +1059,12 @@ REPLACE_MODFL = @REPLACE_MODFL@
REPLACE_NAN = @REPLACE_NAN@
REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
REPLACE_OPENDIR = @REPLACE_OPENDIR@
REPLACE_PERROR = @REPLACE_PERROR@
REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PTSNAME = @REPLACE_PTSNAME@
REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
REPLACE_PUTENV = @REPLACE_PUTENV@
@ -982,6 +1077,9 @@ REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMAINDER = @REPLACE_REMAINDER@
REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
REPLACE_REMOVE = @REPLACE_REMOVE@
REPLACE_RENAME = @REPLACE_RENAME@
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
REPLACE_RMDIR = @REPLACE_RMDIR@
REPLACE_ROUND = @REPLACE_ROUND@
REPLACE_ROUNDF = @REPLACE_ROUNDF@
@ -990,8 +1088,12 @@ REPLACE_SETENV = @REPLACE_SETENV@
REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
REPLACE_SLEEP = @REPLACE_SLEEP@
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
REPLACE_SPRINTF = @REPLACE_SPRINTF@
REPLACE_SQRTL = @REPLACE_SQRTL@
REPLACE_STAT = @REPLACE_STAT@
REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
REPLACE_STPNCPY = @REPLACE_STPNCPY@
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
@ -1008,6 +1110,7 @@ REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
REPLACE_TRUNC = @REPLACE_TRUNC@
REPLACE_TRUNCF = @REPLACE_TRUNCF@
@ -1018,6 +1121,12 @@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
REPLACE_USLEEP = @REPLACE_USLEEP@
REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
REPLACE_VPRINTF = @REPLACE_VPRINTF@
REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
@ -1112,21 +1221,21 @@ noinst_HEADERS =
noinst_LIBRARIES = libgnu.a
noinst_LTLIBRARIES =
EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h \
canonicalize-lgpl.c dirent.in.h dirfd.c dosname.h errno.in.h \
float.c float.in.h itold.c fnmatch.c fnmatch.in.h \
canonicalize-lgpl.c dirent.in.h dirfd.c dirname.h dosname.h \
errno.in.h float.c float.in.h itold.c fnmatch.c fnmatch.in.h \
fnmatch_loop.c fpucw.h frexp.c frexp.c frexpl.c inttypes.in.h \
float+.h isnan.c isnand-nolibm.h isnand.c float+.h isnan.c \
isnanl-nolibm.h isnanl.c config.charset ref-add.sin \
ref-del.sin lstat.c malloca.h malloca.valgrind math.in.h \
mbrtowc.c mbsinit.c mbsrtowcs-impl.h mbsrtowcs-state.c \
mbsrtowcs.c memchr.c memchr.valgrind memmem.c str-two-way.h \
pathmax.h readlink.c \
$(top_srcdir)/import/extra/snippet/_Noreturn.h \
ref-del.sin lstat.c malloc.c malloca.h malloca.valgrind \
math.in.h mbrtowc.c mbsinit.c mbsrtowcs-impl.h \
mbsrtowcs-state.c mbsrtowcs.c memchr.c memchr.valgrind \
memmem.c str-two-way.h pathmax.h readlink.c rename.c rmdir.c \
same-inode.h $(top_srcdir)/import/extra/snippet/_Noreturn.h \
$(top_srcdir)/import/extra/snippet/arg-nonnull.h \
$(top_srcdir)/import/extra/snippet/c++defs.h \
$(top_srcdir)/import/extra/snippet/warn-on-use.h stat.c \
stdbool.in.h stddef.in.h stdint.in.h stdlib.in.h streq.h \
string.in.h str-two-way.h strstr.c sys_stat.in.h \
stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \
streq.h string.in.h str-two-way.h strstr.c sys_stat.in.h \
sys_types.in.h time.in.h unistd.in.h \
$(top_srcdir)/import/extra/update-copyright verify.h \
wchar.in.h wctype.in.h
@ -1143,18 +1252,18 @@ EXTRA_DIST = m4/gnulib-cache.m4 alloca.c alloca.in.h \
BUILT_SOURCES = $(ALLOCA_H) configmake.h dirent.h $(ERRNO_H) \
$(FLOAT_H) $(FNMATCH_H) inttypes.h math.h arg-nonnull.h \
c++defs.h warn-on-use.h $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \
stdlib.h string.h sys/stat.h sys/types.h time.h unistd.h \
wchar.h wctype.h
stdio.h stdlib.h string.h sys/stat.h sys/types.h time.h \
unistd.h wchar.h wctype.h
SUFFIXES = .sed .sin
MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \
dirent.h-t errno.h errno.h-t float.h float.h-t fnmatch.h \
fnmatch.h-t inttypes.h inttypes.h-t math.h math.h-t \
arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \
warn-on-use.h warn-on-use.h-t stdbool.h stdbool.h-t stddef.h \
stddef.h-t stdint.h stdint.h-t stdlib.h stdlib.h-t string.h \
string.h-t sys/stat.h sys/stat.h-t sys/types.h sys/types.h-t \
time.h time.h-t unistd.h unistd.h-t wchar.h wchar.h-t wctype.h \
wctype.h-t
stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t stdlib.h \
stdlib.h-t string.h string.h-t sys/stat.h sys/stat.h-t \
sys/types.h sys/types.h-t time.h time.h-t unistd.h unistd.h-t \
wchar.h wchar.h-t wctype.h wctype.h-t
MOSTLYCLEANDIRS = sys
CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \
ref-del.sed
@ -1162,15 +1271,16 @@ DISTCLEANFILES =
MAINTAINERCLEANFILES =
AM_CPPFLAGS =
AM_CFLAGS =
libgnu_a_SOURCES = localcharset.h localcharset.c malloca.c math.c \
libgnu_a_SOURCES = dirname-lgpl.c basename-lgpl.c stripslash.c \
localcharset.h localcharset.c malloca.c math.c stdio.c \
strnlen1.h strnlen1.c unistd.c wctype-h.c
libgnu_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@
libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@
EXTRA_libgnu_a_SOURCES = alloca.c canonicalize-lgpl.c dirfd.c float.c \
itold.c fnmatch.c fnmatch_loop.c frexp.c frexp.c frexpl.c \
isnan.c isnand.c isnan.c isnanl.c lstat.c mbrtowc.c mbsinit.c \
mbsrtowcs-state.c mbsrtowcs.c memchr.c memmem.c readlink.c \
stat.c strstr.c
isnan.c isnand.c isnan.c isnanl.c lstat.c malloc.c mbrtowc.c \
mbsinit.c mbsrtowcs-state.c mbsrtowcs.c memchr.c memmem.c \
readlink.c rename.c rmdir.c stat.c strstr.c
charset_alias = $(DESTDIR)$(libdir)/charset.alias
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
@ -1241,8 +1351,10 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloca.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename-lgpl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canonicalize-lgpl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirfd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname-lgpl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fnmatch_loop.Po@am__quote@
@ -1254,6 +1366,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Po@am__quote@
@ -1263,7 +1376,11 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memmem.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strstr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Po@am__quote@
@ -2203,6 +2320,125 @@ warn-on-use.h: $(top_srcdir)/import/extra/snippet/warn-on-use.h
@GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status
@GL_GENERATE_STDINT_H_FALSE@ rm -f $@
# We need the following in order to create <stdio.h> when the system
# doesn't have one that works with the given compiler.
stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
-e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
-e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
-e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
-e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
-e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
-e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
-e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
-e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
-e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
-e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
-e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
-e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
-e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
-e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
-e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
-e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
-e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
-e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
-e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
-e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
-e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
-e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
-e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
-e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
-e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
-e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
-e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
-e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
-e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
-e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
-e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
-e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
-e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
-e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
-e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
-e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
-e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
-e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
-e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
-e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
-e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
-e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
-e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
-e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
-e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
-e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
-e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
< $(srcdir)/stdio.in.h | \
sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
-e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
-e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
-e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
-e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
-e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
-e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
-e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
-e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
-e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
-e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
-e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
-e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
-e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
-e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
-e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
-e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
-e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
-e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
-e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
-e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
-e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
-e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
-e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
-e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
-e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
-e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
-e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > $@-t && \
mv $@-t $@
# We need the following in order to create <stdlib.h> when the system
# doesn't have one that works with the given compiler.
stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \

View File

@ -0,0 +1,75 @@
/* basename.c -- return the last element in a file name
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2012 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 published by
the Free Software Foundation; either version 3 of the License, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include "dirname.h"
#include <string.h>
/* Return the address of the last file name component of NAME. If
NAME has no relative file name components because it is a file
system root, return the empty string. */
char *
last_component (char const *name)
{
char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
char const *p;
bool saw_slash = false;
while (ISSLASH (*base))
base++;
for (p = base; *p; p++)
{
if (ISSLASH (*p))
saw_slash = true;
else if (saw_slash)
{
base = p;
saw_slash = false;
}
}
return (char *) base;
}
/* Return the length of the basename NAME. Typically NAME is the
value returned by base_name or last_component. Act like strlen
(NAME), except omit all trailing slashes. */
size_t
base_len (char const *name)
{
size_t len;
size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--)
continue;
if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1
&& ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2])
return 2;
if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len
&& len == prefix_len && ISSLASH (name[prefix_len]))
return prefix_len + 1;
return len;
}

View File

@ -0,0 +1,86 @@
/* dirname.c -- return all but the last element in a file name
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2012 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 published by
the Free Software Foundation; either version 3 of the License, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include "dirname.h"
#include <stdlib.h>
#include <string.h>
/* Return the length of the prefix of FILE that will be used by
dir_name. If FILE is in the working directory, this returns zero
even though 'dir_name (FILE)' will return ".". Works properly even
if there are trailing slashes (by effectively ignoring them). */
size_t
dir_len (char const *file)
{
size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
size_t length;
/* Advance prefix_length beyond important leading slashes. */
prefix_length += (prefix_length != 0
? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
&& ISSLASH (file[prefix_length]))
: (ISSLASH (file[0])
? ((DOUBLE_SLASH_IS_DISTINCT_ROOT
&& ISSLASH (file[1]) && ! ISSLASH (file[2])
? 2 : 1))
: 0));
/* Strip the basename and any redundant slashes before it. */
for (length = last_component (file) - file;
prefix_length < length; length--)
if (! ISSLASH (file[length - 1]))
break;
return length;
}
/* In general, we can't use the builtin 'dirname' function if available,
since it has different meanings in different environments.
In some environments the builtin 'dirname' modifies its argument.
Return the leading directories part of FILE, allocated with malloc.
Works properly even if there are trailing slashes (by effectively
ignoring them). Return NULL on failure.
If lstat (FILE) would succeed, then { chdir (dir_name (FILE));
lstat (base_name (FILE)); } will access the same file. Likewise,
if the sequence { chdir (dir_name (FILE));
rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE
to "foo" in the same directory FILE was in. */
char *
mdir_name (char const *file)
{
size_t length = dir_len (file);
bool append_dot = (length == 0
|| (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
&& length == FILE_SYSTEM_PREFIX_LEN (file)
&& file[2] != '\0' && ! ISSLASH (file[2])));
char *dir = malloc (length + append_dot + 1);
if (!dir)
return NULL;
memcpy (dir, file, length);
if (append_dot)
dir[length++] = '.';
dir[length] = '\0';
return dir;
}

View File

@ -0,0 +1,46 @@
/* Take file names apart into directory and base names.
Copyright (C) 1998, 2001, 2003-2006, 2009-2012 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 published by
the Free Software Foundation; either version 3 of the License, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef DIRNAME_H_
# define DIRNAME_H_ 1
# include <stdbool.h>
# include <stddef.h>
# include "dosname.h"
# ifndef DIRECTORY_SEPARATOR
# define DIRECTORY_SEPARATOR '/'
# endif
# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
# endif
# if GNULIB_DIRNAME
char *base_name (char const *file);
char *dir_name (char const *file);
# endif
char *mdir_name (char const *file);
size_t base_len (char const *file) _GL_ATTRIBUTE_PURE;
size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE;
char *last_component (char const *file) _GL_ATTRIBUTE_PURE;
bool strip_trailing_slashes (char *file);
#endif /* not DIRNAME_H_ */

View File

@ -0,0 +1,19 @@
#serial 10 -*- autoconf -*-
dnl Copyright (C) 2002-2006, 2009-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_DIRNAME],
[
AC_REQUIRE([gl_DIRNAME_LGPL])
])
AC_DEFUN([gl_DIRNAME_LGPL],
[
dnl Prerequisites of lib/dirname.h.
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
dnl lib/stripslash.c.
])

View File

@ -27,7 +27,7 @@
# Specification in the form of a command-line invocation:
# gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca canonicalize-lgpl dirent dirfd errno fnmatch-gnu frexpl inttypes lstat memchr memmem pathmax readlink strstr sys_stat unistd update-copyright wchar wctype-h
# gnulib-tool --import --dir=. --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca canonicalize-lgpl dirent dirfd errno fnmatch-gnu frexpl inttypes lstat memchr memmem pathmax readlink rename strstr sys_stat unistd update-copyright wchar wctype-h
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
@ -45,6 +45,7 @@ gl_MODULES([
memmem
pathmax
readlink
rename
strstr
sys_stat
unistd

View File

@ -41,10 +41,13 @@ AC_DEFUN([gl_EARLY],
# Code from module alloca:
# Code from module alloca-opt:
# Code from module canonicalize-lgpl:
# Code from module chdir:
# Code from module configmake:
# Code from module dirent:
# Code from module dirfd:
# Code from module dirname-lgpl:
# Code from module dosname:
# Code from module double-slash-root:
# Code from module errno:
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
@ -66,6 +69,7 @@ AC_DEFUN([gl_EARLY],
AC_REQUIRE([AC_SYS_LARGEFILE])
# Code from module localcharset:
# Code from module lstat:
# Code from module malloc-posix:
# Code from module malloca:
# Code from module math:
# Code from module mbrtowc:
@ -78,6 +82,9 @@ AC_DEFUN([gl_EARLY],
# Code from module nocrash:
# Code from module pathmax:
# Code from module readlink:
# Code from module rename:
# Code from module rmdir:
# Code from module same-inode:
# Code from module snippet/_Noreturn:
# Code from module snippet/arg-nonnull:
# Code from module snippet/c++defs:
@ -87,6 +94,7 @@ AC_DEFUN([gl_EARLY],
# Code from module stdbool:
# Code from module stddef:
# Code from module stdint:
# Code from module stdio:
# Code from module stdlib:
# Code from module streq:
# Code from module string:
@ -127,6 +135,7 @@ AC_DEFUN([gl_INIT],
gl_MODULE_INDICATOR([canonicalize-lgpl])
gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
gl_STDLIB_MODULE_INDICATOR([realpath])
gl_UNISTD_MODULE_INDICATOR([chdir])
gl_CONFIGMAKE_PREP
gl_DIRENT_H
gl_FUNC_DIRFD
@ -135,6 +144,8 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_DIRFD
fi
gl_DIRENT_MODULE_INDICATOR([dirfd])
gl_DIRNAME_LGPL
gl_DOUBLE_SLASH_ROOT
gl_HEADER_ERRNO_H
AC_REQUIRE([gl_EXTERN_INLINE])
gl_FLOAT_H
@ -186,6 +197,11 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_LSTAT
fi
gl_SYS_STAT_MODULE_INDICATOR([lstat])
gl_FUNC_MALLOC_POSIX
if test $REPLACE_MALLOC = 1; then
AC_LIBOBJ([malloc])
fi
gl_STDLIB_MODULE_INDICATOR([malloc-posix])
gl_MALLOCA
gl_MATH_H
gl_FUNC_MBRTOWC
@ -230,6 +246,16 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_READLINK
fi
gl_UNISTD_MODULE_INDICATOR([readlink])
gl_FUNC_RENAME
if test $REPLACE_RENAME = 1; then
AC_LIBOBJ([rename])
fi
gl_STDIO_MODULE_INDICATOR([rename])
gl_FUNC_RMDIR
if test $REPLACE_RMDIR = 1; then
AC_LIBOBJ([rmdir])
fi
gl_UNISTD_MODULE_INDICATOR([rmdir])
gt_TYPE_SSIZE_T
gl_FUNC_STAT
if test $REPLACE_STAT = 1; then
@ -240,6 +266,7 @@ AC_DEFUN([gl_INIT],
AM_STDBOOL_H
gl_STDDEF_H
gl_STDINT_H
gl_STDIO_H
gl_STDLIB_H
gl_HEADER_STRING_H
gl_FUNC_STRSTR
@ -406,10 +433,13 @@ AC_DEFUN([gl_FILE_LIST], [
build-aux/update-copyright
lib/alloca.c
lib/alloca.in.h
lib/basename-lgpl.c
lib/canonicalize-lgpl.c
lib/config.charset
lib/dirent.in.h
lib/dirfd.c
lib/dirname-lgpl.c
lib/dirname.h
lib/dosname.h
lib/errno.in.h
lib/float+.h
@ -431,6 +461,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/localcharset.c
lib/localcharset.h
lib/lstat.c
lib/malloc.c
lib/malloca.c
lib/malloca.h
lib/malloca.valgrind
@ -448,14 +479,20 @@ AC_DEFUN([gl_FILE_LIST], [
lib/readlink.c
lib/ref-add.sin
lib/ref-del.sin
lib/rename.c
lib/rmdir.c
lib/same-inode.h
lib/stat.c
lib/stdbool.in.h
lib/stddef.in.h
lib/stdint.in.h
lib/stdio.c
lib/stdio.in.h
lib/stdlib.in.h
lib/str-two-way.h
lib/streq.h
lib/string.in.h
lib/stripslash.c
lib/strnlen1.c
lib/strnlen1.h
lib/strstr.c
@ -475,6 +512,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/configmake.m4
m4/dirent_h.m4
m4/dirfd.m4
m4/dirname.m4
m4/double-slash-root.m4
m4/eealloc.m4
m4/errno_h.m4
@ -502,6 +540,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/locale-zh.m4
m4/longlong.m4
m4/lstat.m4
m4/malloc.m4
m4/malloca.m4
m4/math_h.m4
m4/mbrtowc.m4
@ -516,11 +555,14 @@ AC_DEFUN([gl_FILE_LIST], [
m4/off_t.m4
m4/pathmax.m4
m4/readlink.m4
m4/rename.m4
m4/rmdir.m4
m4/ssize_t.m4
m4/stat.m4
m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
m4/stdio_h.m4
m4/stdlib_h.m4
m4/string_h.m4
m4/strstr.m4

View File

@ -0,0 +1,98 @@
# malloc.m4 serial 14
dnl Copyright (C) 2007, 2009-2012 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.
m4_version_prereq([2.70], [] ,[
# This is taken from the following Autoconf patch:
# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
AC_DEFUN([_AC_FUNC_MALLOC_IF],
[
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
AC_CHECK_HEADERS([stdlib.h])
AC_CACHE_CHECK([for GNU libc compatible malloc],
[ac_cv_func_malloc_0_nonnull],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
# include <stdlib.h>
#else
char *malloc ();
#endif
]],
[[return ! malloc (0);]])
],
[ac_cv_func_malloc_0_nonnull=yes],
[ac_cv_func_malloc_0_nonnull=no],
[case "$host_os" in
# Guess yes on platforms where we know the result.
*-gnu* | freebsd* | netbsd* | openbsd* \
| hpux* | solaris* | cygwin* | mingw*)
ac_cv_func_malloc_0_nonnull=yes ;;
# If we don't know, assume the worst.
*) ac_cv_func_malloc_0_nonnull=no ;;
esac
])
])
AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
])# _AC_FUNC_MALLOC_IF
])
# gl_FUNC_MALLOC_GNU
# ------------------
# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
# it is not.
AC_DEFUN([gl_FUNC_MALLOC_GNU],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
dnl _AC_FUNC_MALLOC_IF is defined in Autoconf.
_AC_FUNC_MALLOC_IF(
[AC_DEFINE([HAVE_MALLOC_GNU], [1],
[Define to 1 if your system has a GNU libc compatible 'malloc'
function, and to 0 otherwise.])],
[AC_DEFINE([HAVE_MALLOC_GNU], [0])
REPLACE_MALLOC=1
])
])
# gl_FUNC_MALLOC_POSIX
# --------------------
# Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
# fails), and replace malloc if it is not.
AC_DEFUN([gl_FUNC_MALLOC_POSIX],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
if test $gl_cv_func_malloc_posix = yes; then
AC_DEFINE([HAVE_MALLOC_POSIX], [1],
[Define if the 'malloc' function is POSIX compliant.])
else
REPLACE_MALLOC=1
fi
])
# Test whether malloc, realloc, calloc are POSIX compliant,
# Set gl_cv_func_malloc_posix to yes or no accordingly.
AC_DEFUN([gl_CHECK_MALLOC_POSIX],
[
AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant],
[gl_cv_func_malloc_posix],
[
dnl It is too dangerous to try to allocate a large amount of memory:
dnl some systems go to their knees when you do that. So assume that
dnl all Unix implementations of the function are POSIX compliant.
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
choke me
#endif
]])],
[gl_cv_func_malloc_posix=yes],
[gl_cv_func_malloc_posix=no])
])
])

View File

@ -0,0 +1,225 @@
# serial 26
# Copyright (C) 2001, 2003, 2005-2006, 2009-2012 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
dnl From Volker Borchert.
dnl Determine whether rename works for source file names with a trailing slash.
dnl The rename from SunOS 4.1.1_U1 doesn't.
dnl
dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
dnl to compile the wrapper function.
dnl
AC_DEFUN([gl_FUNC_RENAME],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([lstat])
dnl Solaris 10, AIX 7.1 mistakenly allow rename("file","name/").
dnl NetBSD 1.6 mistakenly forbids rename("dir","name/").
dnl FreeBSD 7.2 mistakenly allows rename("file","link-to-file/").
dnl The Solaris bug can be worked around without stripping
dnl trailing slash, while the NetBSD bug requires stripping;
dnl the two conditions can be distinguished by whether hard
dnl links are also broken.
AC_CACHE_CHECK([whether rename honors trailing slash on destination],
[gl_cv_func_rename_slash_dst_works],
[rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
AC_MSG_ERROR([cannot create temporary files])
# Assume that if we have lstat, we can also check symlinks.
if test $ac_cv_func_lstat = yes; then
ln -s conftest.f conftest.lnk
fi
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
# include <stdio.h>
# include <stdlib.h>
]],
[[int result = 0;
if (rename ("conftest.f1", "conftest.f2/") == 0)
result |= 1;
if (rename ("conftest.d1", "conftest.d2/") != 0)
result |= 2;
#if HAVE_LSTAT
if (rename ("conftest.f", "conftest.lnk/") == 0)
result |= 4;
#endif
return result;
]])],
[gl_cv_func_rename_slash_dst_works=yes],
[gl_cv_func_rename_slash_dst_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
esac
])
rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
])
case "$gl_cv_func_rename_slash_dst_works" in
*yes) ;;
*)
REPLACE_RENAME=1
AC_DEFINE([RENAME_TRAILING_SLASH_DEST_BUG], [1],
[Define if rename does not correctly handle slashes on the destination
argument, such as on Solaris 10 or NetBSD 1.6.])
;;
esac
dnl SunOS 4.1.1_U1 mistakenly forbids rename("dir/","name").
dnl Solaris 9 mistakenly allows rename("file/","name").
dnl FreeBSD 7.2 mistakenly allows rename("link-to-file/","name").
dnl These bugs require stripping trailing slash to avoid corrupting
dnl symlinks with a trailing slash.
AC_CACHE_CHECK([whether rename honors trailing slash on source],
[gl_cv_func_rename_slash_src_works],
[rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
AC_MSG_ERROR([cannot create temporary files])
# Assume that if we have lstat, we can also check symlinks.
if test $ac_cv_func_lstat = yes; then
ln -s conftest.f conftest.lnk
fi
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
# include <stdio.h>
# include <stdlib.h>
]],
[[int result = 0;
if (rename ("conftest.f1/", "conftest.d3") == 0)
result |= 1;
if (rename ("conftest.d1/", "conftest.d2") != 0)
result |= 2;
#if HAVE_LSTAT
if (rename ("conftest.lnk/", "conftest.f") == 0)
result |= 4;
#endif
return result;
]])],
[gl_cv_func_rename_slash_src_works=yes],
[gl_cv_func_rename_slash_src_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_rename_slash_src_works="guessing no" ;;
esac
])
rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
])
case "$gl_cv_func_rename_slash_src_works" in
*yes) ;;
*)
REPLACE_RENAME=1
AC_DEFINE([RENAME_TRAILING_SLASH_SOURCE_BUG], [1],
[Define if rename does not correctly handle slashes on the source
argument, such as on Solaris 9 or cygwin 1.5.])
;;
esac
dnl NetBSD 1.6 and cygwin 1.5.x mistakenly reduce hard link count
dnl on rename("h1","h2").
dnl This bug requires stat'ting targets prior to attempting rename.
AC_CHECK_FUNCS_ONCE([link])
AC_CACHE_CHECK([whether rename manages hard links correctly],
[gl_cv_func_rename_link_works],
[if test $ac_cv_func_link = yes; then
rm -rf conftest.f conftest.f1
if touch conftest.f && ln conftest.f conftest.f1 &&
set x `ls -i conftest.f conftest.f1` && test "$2" = "$4"; then
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
]],
[[int result = 0;
if (rename ("conftest.f", "conftest.f1"))
result |= 1;
if (unlink ("conftest.f1"))
result |= 2;
if (rename ("conftest.f", "conftest.f"))
result |= 4;
if (rename ("conftest.f1", "conftest.f1") == 0)
result |= 8;
return result;
]])],
[gl_cv_func_rename_link_works=yes],
[gl_cv_func_rename_link_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_rename_link_works="guessing no" ;;
esac
])
else
gl_cv_func_rename_link_works="guessing no"
fi
rm -rf conftest.f conftest.f1
else
gl_cv_func_rename_link_works=yes
fi
])
case "$gl_cv_func_rename_link_works" in
*yes) ;;
*)
REPLACE_RENAME=1
AC_DEFINE([RENAME_HARD_LINK_BUG], [1],
[Define if rename fails to leave hard links alone, as on NetBSD 1.6
or Cygwin 1.5.])
;;
esac
dnl Cygwin 1.5.x mistakenly allows rename("dir","file").
dnl mingw mistakenly forbids rename("dir1","dir2").
dnl These bugs require stripping trailing slash to avoid corrupting
dnl symlinks with a trailing slash.
AC_CACHE_CHECK([whether rename manages existing destinations correctly],
[gl_cv_func_rename_dest_works],
[rm -rf conftest.f conftest.d1 conftest.d2
touch conftest.f && mkdir conftest.d1 conftest.d2 ||
AC_MSG_ERROR([cannot create temporary files])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
# include <stdio.h>
# include <stdlib.h>
]],
[[int result = 0;
if (rename ("conftest.d1", "conftest.d2") != 0)
result |= 1;
if (rename ("conftest.d2", "conftest.f") == 0)
result |= 2;
return result;
]])],
[gl_cv_func_rename_dest_works=yes],
[gl_cv_func_rename_dest_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_rename_dest_works="guessing no" ;;
esac
])
rm -rf conftest.f conftest.d1 conftest.d2
])
case "$gl_cv_func_rename_dest_works" in
*yes) ;;
*)
REPLACE_RENAME=1
AC_DEFINE([RENAME_DEST_EXISTS_BUG], [1],
[Define if rename does not work when the destination file exists,
as on Cygwin 1.5 or Windows.])
;;
esac
])

View File

@ -0,0 +1,49 @@
# rmdir.m4 serial 13
dnl Copyright (C) 2002, 2005, 2009-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_RMDIR],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl Detect cygwin 1.5.x bug.
AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
[mkdir conftest.dir
touch conftest.file
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdio.h>
#include <errno.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else /* on Windows with MSVC */
# include <direct.h>
#endif
]], [[int result = 0;
if (!rmdir ("conftest.file/"))
result |= 1;
else if (errno != ENOTDIR)
result |= 2;
if (!rmdir ("conftest.dir/./"))
result |= 4;
return result;
]])],
[gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
# If we don't know, assume the worst.
*) gl_cv_func_rmdir_works="guessing no" ;;
esac
])
rm -rf conftest.dir conftest.file])
case "$gl_cv_func_rmdir_works" in
*yes) ;;
*)
REPLACE_RMDIR=1
;;
esac
])

View File

@ -0,0 +1,194 @@
# stdio_h.m4 serial 43
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_STDIO_H],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
gl_NEXT_HEADERS([stdio.h])
dnl No need to create extra modules for these functions. Everyone who uses
dnl <stdio.h> likely needs them.
GNULIB_FSCANF=1
gl_MODULE_INDICATOR([fscanf])
GNULIB_SCANF=1
gl_MODULE_INDICATOR([scanf])
GNULIB_FGETC=1
GNULIB_GETC=1
GNULIB_GETCHAR=1
GNULIB_FGETS=1
GNULIB_FREAD=1
dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
dnl "expected source file, required through AC_LIBSOURCES, not found". It is
dnl also an optimization, to avoid performing a configure check whose result
dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
dnl or GNULIB_NONBLOCKING redundant.
m4_ifdef([gl_NONBLOCKING_IO], [
gl_NONBLOCKING_IO
if test $gl_cv_have_nonblocking != yes; then
REPLACE_STDIO_READ_FUNCS=1
AC_LIBOBJ([stdio-read])
fi
])
dnl No need to create extra modules for these functions. Everyone who uses
dnl <stdio.h> likely needs them.
GNULIB_FPRINTF=1
GNULIB_PRINTF=1
GNULIB_VFPRINTF=1
GNULIB_VPRINTF=1
GNULIB_FPUTC=1
GNULIB_PUTC=1
GNULIB_PUTCHAR=1
GNULIB_FPUTS=1
GNULIB_PUTS=1
GNULIB_FWRITE=1
dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
dnl "expected source file, required through AC_LIBSOURCES, not found". It is
dnl also an optimization, to avoid performing a configure check whose result
dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or
dnl GNULIB_SIGPIPE redundant.
m4_ifdef([gl_SIGNAL_SIGPIPE], [
gl_SIGNAL_SIGPIPE
if test $gl_cv_header_signal_h_SIGPIPE != yes; then
REPLACE_STDIO_WRITE_FUNCS=1
AC_LIBOBJ([stdio-write])
fi
])
dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
dnl "expected source file, required through AC_LIBSOURCES, not found". It is
dnl also an optimization, to avoid performing a configure check whose result
dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
dnl or GNULIB_NONBLOCKING redundant.
m4_ifdef([gl_NONBLOCKING_IO], [
gl_NONBLOCKING_IO
if test $gl_cv_have_nonblocking != yes; then
REPLACE_STDIO_WRITE_FUNCS=1
AC_LIBOBJ([stdio-write])
fi
])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
dnl guaranteed by both C89 and C11.
gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
renameat snprintf tmpfile vdprintf vsnprintf])
])
AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR_FOR_TESTS([$1])
])
AC_DEFUN([gl_STDIO_H_DEFAULTS],
[
GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF])
GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE])
GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN])
GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC])
GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS])
GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE])
GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD])
GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF])
GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
GNULIB_GETC=0; AC_SUBST([GNULIB_GETC])
GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR])
GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE])
GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN])
GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC])
GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR])
GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS])
GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE])
GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME])
GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT])
GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF])
GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING])
GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE])
GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF])
GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF])
GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF])
GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF])
GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE])
HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO])
HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE])
HAVE_POPEN=1; AC_SUBST([HAVE_POPEN])
HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT])
HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF])
REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF])
REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE])
REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN])
REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE])
REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
REPLACE_GETDELIM=0; AC_SUBST([REPLACE_GETDELIM])
REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF])
REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
REPLACE_POPEN=0; AC_SUBST([REPLACE_POPEN])
REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
REPLACE_REMOVE=0; AC_SUBST([REPLACE_REMOVE])
REPLACE_RENAME=0; AC_SUBST([REPLACE_RENAME])
REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT])
REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS])
REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE])
REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF])
REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
])

View File

@ -0,0 +1,56 @@
/* malloc() function that is glibc compatible.
Copyright (C) 1997-1998, 2006-2007, 2009-2012 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 published by
the Free Software Foundation; either version 3, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* written by Jim Meyering and Bruno Haible */
#define _GL_USE_STDLIB_ALLOC 1
#include <config.h>
/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */
#ifdef malloc
# define NEED_MALLOC_GNU 1
# undef malloc
/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU. */
#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
# define NEED_MALLOC_GNU 1
#endif
#include <stdlib.h>
#include <errno.h>
/* Allocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */
void *
rpl_malloc (size_t n)
{
void *result;
#if NEED_MALLOC_GNU
if (n == 0)
n = 1;
#endif
result = malloc (n);
#if !HAVE_MALLOC_POSIX
if (result == NULL)
errno = ENOMEM;
#endif
return result;
}

473
gdb/gnulib/import/rename.c Normal file
View File

@ -0,0 +1,473 @@
/* Work around rename bugs in some systems.
Copyright (C) 2001-2003, 2005-2006, 2009-2012 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 published by
the Free Software Foundation; either version 3 of the License, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Volker Borchert, Eric Blake. */
#include <config.h>
#include <stdio.h>
#undef rename
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* The mingw rename has problems with trailing slashes; it also
requires use of native Windows calls to allow atomic renames over
existing files. */
# include <errno.h>
# include <stdbool.h>
# include <stdlib.h>
# include <sys/stat.h>
# include <unistd.h>
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include "dirname.h"
/* Rename the file SRC to DST. This replacement is necessary on
Windows, on which the system rename function will not replace
an existing DST. */
int
rpl_rename (char const *src, char const *dst)
{
int error;
size_t src_len = strlen (src);
size_t dst_len = strlen (dst);
char *src_base = last_component (src);
char *dst_base = last_component (dst);
bool src_slash;
bool dst_slash;
bool dst_exists;
struct stat src_st;
struct stat dst_st;
/* Filter out dot as last component. */
if (!src_len || !dst_len)
{
errno = ENOENT;
return -1;
}
if (*src_base == '.')
{
size_t len = base_len (src_base);
if (len == 1 || (len == 2 && src_base[1] == '.'))
{
errno = EINVAL;
return -1;
}
}
if (*dst_base == '.')
{
size_t len = base_len (dst_base);
if (len == 1 || (len == 2 && dst_base[1] == '.'))
{
errno = EINVAL;
return -1;
}
}
/* Presence of a trailing slash requires directory semantics. If
the source does not exist, or if the destination cannot be turned
into a directory, give up now. Otherwise, strip trailing slashes
before calling rename. There are no symlinks on mingw, so stat
works instead of lstat. */
src_slash = ISSLASH (src[src_len - 1]);
dst_slash = ISSLASH (dst[dst_len - 1]);
if (stat (src, &src_st))
return -1;
if (stat (dst, &dst_st))
{
if (errno != ENOENT || (!S_ISDIR (src_st.st_mode) && dst_slash))
return -1;
dst_exists = false;
}
else
{
if (S_ISDIR (dst_st.st_mode) != S_ISDIR (src_st.st_mode))
{
errno = S_ISDIR (dst_st.st_mode) ? EISDIR : ENOTDIR;
return -1;
}
dst_exists = true;
}
/* There are no symlinks, so if a file existed with a trailing
slash, it must be a directory, and we don't have to worry about
stripping strip trailing slash. However, mingw refuses to
replace an existing empty directory, so we have to help it out.
And canonicalize_file_name is not yet ported to mingw; however,
for directories, getcwd works as a viable alternative. Ensure
that we can get back to where we started before using it; later
attempts to return are fatal. Note that we can end up losing a
directory if rename then fails, but it was empty, so not much
damage was done. */
if (dst_exists && S_ISDIR (dst_st.st_mode))
{
char *cwd = getcwd (NULL, 0);
char *src_temp;
char *dst_temp;
if (!cwd || chdir (cwd))
return -1;
if (IS_ABSOLUTE_FILE_NAME (src))
{
dst_temp = chdir (dst) ? NULL : getcwd (NULL, 0);
src_temp = chdir (src) ? NULL : getcwd (NULL, 0);
}
else
{
src_temp = chdir (src) ? NULL : getcwd (NULL, 0);
if (!IS_ABSOLUTE_FILE_NAME (dst) && chdir (cwd))
abort ();
dst_temp = chdir (dst) ? NULL : getcwd (NULL, 0);
}
if (chdir (cwd))
abort ();
free (cwd);
if (!src_temp || !dst_temp)
{
free (src_temp);
free (dst_temp);
errno = ENOMEM;
return -1;
}
src_len = strlen (src_temp);
if (strncmp (src_temp, dst_temp, src_len) == 0
&& (ISSLASH (dst_temp[src_len]) || dst_temp[src_len] == '\0'))
{
error = dst_temp[src_len];
free (src_temp);
free (dst_temp);
if (error)
{
errno = EINVAL;
return -1;
}
return 0;
}
if (rmdir (dst))
{
error = errno;
free (src_temp);
free (dst_temp);
errno = error;
return -1;
}
free (src_temp);
free (dst_temp);
}
/* MoveFileEx works if SRC is a directory without any flags, but
fails with MOVEFILE_REPLACE_EXISTING, so try without flags first.
Thankfully, MoveFileEx handles hard links correctly, even though
rename() does not. */
if (MoveFileEx (src, dst, 0))
return 0;
/* Retry with MOVEFILE_REPLACE_EXISTING if the move failed
due to the destination already existing. */
error = GetLastError ();
if (error == ERROR_FILE_EXISTS || error == ERROR_ALREADY_EXISTS)
{
if (MoveFileEx (src, dst, MOVEFILE_REPLACE_EXISTING))
return 0;
error = GetLastError ();
}
switch (error)
{
case ERROR_FILE_NOT_FOUND:
case ERROR_PATH_NOT_FOUND:
case ERROR_BAD_PATHNAME:
case ERROR_DIRECTORY:
errno = ENOENT;
break;
case ERROR_ACCESS_DENIED:
case ERROR_SHARING_VIOLATION:
errno = EACCES;
break;
case ERROR_OUTOFMEMORY:
errno = ENOMEM;
break;
case ERROR_CURRENT_DIRECTORY:
errno = EBUSY;
break;
case ERROR_NOT_SAME_DEVICE:
errno = EXDEV;
break;
case ERROR_WRITE_PROTECT:
errno = EROFS;
break;
case ERROR_WRITE_FAULT:
case ERROR_READ_FAULT:
case ERROR_GEN_FAILURE:
errno = EIO;
break;
case ERROR_HANDLE_DISK_FULL:
case ERROR_DISK_FULL:
case ERROR_DISK_TOO_FRAGMENTED:
errno = ENOSPC;
break;
case ERROR_FILE_EXISTS:
case ERROR_ALREADY_EXISTS:
errno = EEXIST;
break;
case ERROR_BUFFER_OVERFLOW:
case ERROR_FILENAME_EXCED_RANGE:
errno = ENAMETOOLONG;
break;
case ERROR_INVALID_NAME:
case ERROR_DELETE_PENDING:
errno = EPERM; /* ? */
break;
# ifndef ERROR_FILE_TOO_LARGE
/* This value is documented but not defined in all versions of windows.h. */
# define ERROR_FILE_TOO_LARGE 223
# endif
case ERROR_FILE_TOO_LARGE:
errno = EFBIG;
break;
default:
errno = EINVAL;
break;
}
return -1;
}
#else /* ! W32 platform */
# include <errno.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <sys/stat.h>
# include <unistd.h>
# include "dirname.h"
# include "same-inode.h"
/* Rename the file SRC to DST, fixing any trailing slash bugs. */
int
rpl_rename (char const *src, char const *dst)
{
size_t src_len = strlen (src);
size_t dst_len = strlen (dst);
char *src_temp = (char *) src;
char *dst_temp = (char *) dst;
bool src_slash;
bool dst_slash;
bool dst_exists;
int ret_val = -1;
int rename_errno = ENOTDIR;
struct stat src_st;
struct stat dst_st;
if (!src_len || !dst_len)
return rename (src, dst); /* Let strace see the ENOENT failure. */
# if RENAME_DEST_EXISTS_BUG
{
char *src_base = last_component (src);
char *dst_base = last_component (dst);
if (*src_base == '.')
{
size_t len = base_len (src_base);
if (len == 1 || (len == 2 && src_base[1] == '.'))
{
errno = EINVAL;
return -1;
}
}
if (*dst_base == '.')
{
size_t len = base_len (dst_base);
if (len == 1 || (len == 2 && dst_base[1] == '.'))
{
errno = EINVAL;
return -1;
}
}
}
# endif /* RENAME_DEST_EXISTS_BUG */
src_slash = src[src_len - 1] == '/';
dst_slash = dst[dst_len - 1] == '/';
# if !RENAME_HARD_LINK_BUG && !RENAME_DEST_EXISTS_BUG
/* If there are no trailing slashes, then trust the native
implementation unless we also suspect issues with hard link
detection or file/directory conflicts. */
if (!src_slash && !dst_slash)
return rename (src, dst);
# endif /* !RENAME_HARD_LINK_BUG && !RENAME_DEST_EXISTS_BUG */
/* Presence of a trailing slash requires directory semantics. If
the source does not exist, or if the destination cannot be turned
into a directory, give up now. Otherwise, strip trailing slashes
before calling rename. */
if (lstat (src, &src_st))
return -1;
if (lstat (dst, &dst_st))
{
if (errno != ENOENT || (!S_ISDIR (src_st.st_mode) && dst_slash))
return -1;
dst_exists = false;
}
else
{
if (S_ISDIR (dst_st.st_mode) != S_ISDIR (src_st.st_mode))
{
errno = S_ISDIR (dst_st.st_mode) ? EISDIR : ENOTDIR;
return -1;
}
# if RENAME_HARD_LINK_BUG
if (SAME_INODE (src_st, dst_st))
return 0;
# endif /* RENAME_HARD_LINK_BUG */
dst_exists = true;
}
# if (RENAME_TRAILING_SLASH_SOURCE_BUG || RENAME_DEST_EXISTS_BUG \
|| RENAME_HARD_LINK_BUG)
/* If the only bug was that a trailing slash was allowed on a
non-existing file destination, as in Solaris 10, then we've
already covered that situation. But if there is any problem with
a trailing slash on an existing source or destination, as in
Solaris 9, or if a directory can overwrite a symlink, as on
Cygwin 1.5, or if directories cannot be created with trailing
slash, as on NetBSD 1.6, then we must strip the offending slash
and check that we have not encountered a symlink instead of a
directory.
Stripping a trailing slash interferes with POSIX semantics, where
rename behavior on a symlink with a trailing slash operates on
the corresponding target directory. We prefer the GNU semantics
of rejecting any use of a symlink with trailing slash, but do not
enforce them, since Solaris 10 is able to obey POSIX semantics
and there might be clients expecting it, as counter-intuitive as
those semantics are.
Technically, we could also follow the POSIX behavior by chasing a
readlink trail, but that is harder to implement. */
if (src_slash)
{
src_temp = strdup (src);
if (!src_temp)
{
/* Rather than rely on strdup-posix, we set errno ourselves. */
rename_errno = ENOMEM;
goto out;
}
strip_trailing_slashes (src_temp);
if (lstat (src_temp, &src_st))
{
rename_errno = errno;
goto out;
}
if (S_ISLNK (src_st.st_mode))
goto out;
}
if (dst_slash)
{
dst_temp = strdup (dst);
if (!dst_temp)
{
rename_errno = ENOMEM;
goto out;
}
strip_trailing_slashes (dst_temp);
if (lstat (dst_temp, &dst_st))
{
if (errno != ENOENT)
{
rename_errno = errno;
goto out;
}
}
else if (S_ISLNK (dst_st.st_mode))
goto out;
}
# endif /* RENAME_TRAILING_SLASH_SOURCE_BUG || RENAME_DEST_EXISTS_BUG
|| RENAME_HARD_LINK_BUG */
# if RENAME_DEST_EXISTS_BUG
/* Cygwin 1.5 sometimes behaves oddly when moving a non-empty
directory on top of an empty one (the old directory name can
reappear if the new directory tree is removed). Work around this
by removing the target first, but don't remove the target if it
is a subdirectory of the source. Note that we can end up losing
a directory if rename then fails, but it was empty, so not much
damage was done. */
if (dst_exists && S_ISDIR (dst_st.st_mode))
{
if (src_st.st_dev != dst_st.st_dev)
{
rename_errno = EXDEV;
goto out;
}
if (src_temp != src)
free (src_temp);
src_temp = canonicalize_file_name (src);
if (dst_temp != dst)
free (dst_temp);
dst_temp = canonicalize_file_name (dst);
if (!src_temp || !dst_temp)
{
rename_errno = ENOMEM;
goto out;
}
src_len = strlen (src_temp);
if (strncmp (src_temp, dst_temp, src_len) == 0
&& dst_temp[src_len] == '/')
{
rename_errno = EINVAL;
goto out;
}
if (rmdir (dst))
{
rename_errno = errno;
goto out;
}
}
# endif /* RENAME_DEST_EXISTS_BUG */
ret_val = rename (src_temp, dst_temp);
rename_errno = errno;
out:
if (src_temp != src)
free (src_temp);
if (dst_temp != dst)
free (dst_temp);
errno = rename_errno;
return ret_val;
}
#endif /* ! W32 platform */

53
gdb/gnulib/import/rmdir.c Normal file
View File

@ -0,0 +1,53 @@
/* Work around rmdir bugs.
Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2012 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 published by
the Free Software Foundation; either version 3 of the License, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include "dosname.h"
#undef rmdir
/* Remove directory DIR.
Return 0 if successful, -1 if not. */
int
rpl_rmdir (char const *dir)
{
/* Work around cygwin 1.5.x bug where rmdir("dir/./") succeeds. */
size_t len = strlen (dir);
int result;
while (len && ISSLASH (dir[len - 1]))
len--;
if (len && dir[len - 1] == '.' && (1 == len || ISSLASH (dir[len - 2])))
{
errno = EINVAL;
return -1;
}
result = rmdir (dir);
/* Work around mingw bug, where rmdir("file/") fails with EINVAL
instead of ENOTDIR. We've already filtered out trailing ., the
only reason allowed by POSIX for EINVAL. */
if (result == -1 && errno == EINVAL)
errno = ENOTDIR;
return result;
}

View File

@ -0,0 +1,33 @@
/* Determine whether two stat buffers refer to the same file.
Copyright (C) 2006, 2009-2012 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 published by
the Free Software Foundation; either version 3 of the License, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SAME_INODE_H
# define SAME_INODE_H 1
# ifdef __VMS
# define SAME_INODE(a, b) \
((a).st_ino[0] == (b).st_ino[0] \
&& (a).st_ino[1] == (b).st_ino[1] \
&& (a).st_ino[2] == (b).st_ino[2] \
&& (a).st_dev == (b).st_dev)
# else
# define SAME_INODE(a, b) \
((a).st_ino == (b).st_ino \
&& (a).st_dev == (b).st_dev)
# endif
#endif

View File

@ -0,0 +1,3 @@
#include <config.h>
#define _GL_STDIO_INLINE _GL_EXTERN_INLINE
#include "stdio.h"

1345
gdb/gnulib/import/stdio.in.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
/* stripslash.c -- remove redundant trailing slashes from a file name
Copyright (C) 1990, 2001, 2003-2006, 2009-2012 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 published by
the Free Software Foundation; either version 3 of the License, 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include "dirname.h"
/* Remove trailing slashes from FILE. Return true if a trailing slash
was removed. This is useful when using file name completion from a
shell that adds a "/" after directory names (such as tcsh and
bash), because on symlinks to directories, several system calls
have different semantics according to whether a trailing slash is
present. */
bool
strip_trailing_slashes (char *file)
{
char *base = last_component (file);
char *base_lim;
bool had_slash;
/* last_component returns "" for file system roots, but we need to turn
"///" into "/". */
if (! *base)
base = file;
base_lim = base + base_len (base);
had_slash = (*base_lim != '\0');
*base_lim = '\0';
return had_slash;
}

View File

@ -43,6 +43,7 @@ IMPORTED_GNULIB_MODULES="\
memmem \
pathmax \
readlink \
rename \
strstr \
sys_stat \
unistd \