+2003-01-12 Bruno Haible <bruno@clisp.org>
+
+ * configure.in: Invoke gl_FUNC_ALLOCA instead of AC_FUNC_ALLOCA.
+
2003-01-12 Bruno Haible <bruno@clisp.org>
* Makefile.am: Make use of += for variables.
AC_TYPE_PID_T
dnl Checks for library functions.
-AC_FUNC_ALLOCA
+gl_FUNC_ALLOCA
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([getcwd mblen memcpy posix_spawn putc_unlocked raise select \
strerror strtoul uname utime utimes])
+2003-01-12 Bruno Haible <bruno@clisp.org>
+
+ * alloca_.h: New file, from gnulib.
+ * liballoca.h: Remove file.
+ * Makefile.am: Add snippet from gnulib module alloca.
+ (LIBADD_SOURCE): Remove liballoca.h.
+ * javacomp.c: Include alloca.h instead of liballoca.h.
+ * javaexec.c: Likewise.
+ * setenv.c: Likewise.
+
2003-01-12 Bruno Haible <bruno@clisp.org>
* Makefile.am: Make use of += for variables.
# Sources that are compiled only on platforms that lack the functions.
LIBADD_SOURCE = \
- liballoca.h alloca.c \
+ alloca.c \
getline.h getline.c \
memset.c \
mkdtemp.h mkdtemp.c \
# <<< gnulib module stdbool.
+# >>> gnulib module alloca.
+EXTRA_DIST += alloca_.h
+
+# The following is needed in order to create an <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+all-local $(libgettextlib_la_OBJECTS): @ALLOCA_H@
+alloca.h: alloca_.h
+ cp $(srcdir)/alloca_.h alloca.h
+MOSTLYCLEANFILES += alloca.h
+# <<< gnulib module alloca.
+
+
# >>> gnulib module localcharset.
libgettextlib_la_SOURCES += localcharset.c
EXTRA_DIST += config.charset ref-add.sin ref-del.sin
/* Memory allocation on the stack.
- Copyright (C) 1995, 1999, 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1999, 2001-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
declarations. Thanks to AIX. Therefore we include it right after
"config.h", not later. */
-#ifndef _LIBALLOCA_H
-#define _LIBALLOCA_H
+#ifndef _ALLOCA_H
+#define _ALLOCA_H
+
+/* alloca(N) returns a pointer (void* or char*) to N bytes of memory
+ allocated on the stack, and which will last until the function returns.
+ Use of alloca should be avoided:
+ - inside arguments of function calls - undefined behaviour,
+ - in inline functions - the allocation may actually last until the
+ calling function returns,
+ - for huge N (say, N >= 65536) - you never know how large (or small)
+ the stack is, and when the stack cannot fulfill the memory allocation
+ request, the program just crashes.
+ */
#ifdef __GNUC__
# ifndef alloca
# ifdef __cplusplus
extern "C" void *alloca (unsigned int);
# else /* not __cplusplus */
-void *alloca ();
+extern void *alloca ();
# endif /* not __cplusplus */
# else /* not __hpux */
# ifndef alloca
-char *alloca ();
+extern char *alloca ();
# endif
# endif /* __hpux */
# endif
# endif
#endif
-#endif /* _LIBALLOCA_H */
+#endif /* _ALLOCA_H */
/* Compile a Java program.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "javacomp.h"
/* Execute a Java program.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "javaexec.h"
-/* Copyright (C) 1992,1995-1999,2000-2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-1999,2000-2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#if HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
#include <errno.h>
#if !_LIBC
+2003-01-12 Bruno Haible <bruno@clisp.org>
+
+ * configure.in: Invoke gl_FUNC_ALLOCA instead of AC_FUNC_ALLOCA.
+ * alloca_.h: New file, from gnulib.
+ * liballoca.h: Remove file.
+ * Makefile.am: Add snippet from gnulib module alloca.
+ (lib_asprintf_EXTRASOURCES): Remove liballoca.h.
+ * vasnprintf.c: Include alloca.h instead of liballoca.h.
+
2003-01-12 Bruno Haible <bruno@clisp.org>
* Makefile.am: Make use of += for variables.
printf-args.h printf-args.c \
printf-parse.h printf-parse.c \
vasnprintf.h vasnprintf.c asnprintf.c \
- vasprintf.h vasprintf.c asprintf.c \
- liballoca.h
+ vasprintf.h vasprintf.c asprintf.c
lib-asprintf.lo: $(lib_asprintf_EXTRASOURCES)
EXTRA_DIST += $(lib_asprintf_EXTRASOURCES)
+# >>> gnulib module alloca.
+EXTRA_DIST += alloca_.h
+
+# The following is needed in order to create an <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+all-local $(lib_OBJECTS): @ALLOCA_H@
+alloca.h: alloca_.h
+ cp $(srcdir)/alloca_.h alloca.h
+MOSTLYCLEANFILES += alloca.h
+# <<< gnulib module alloca.
+
+
# Documentation.
docdir = $(prefix)/doc/@PACKAGE@
/* Memory allocation on the stack.
- Copyright (C) 1995, 1999, 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1999, 2001-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
declarations. Thanks to AIX. Therefore we include it right after
"config.h", not later. */
-#ifndef _LIBALLOCA_H
-#define _LIBALLOCA_H
+#ifndef _ALLOCA_H
+#define _ALLOCA_H
+
+/* alloca(N) returns a pointer (void* or char*) to N bytes of memory
+ allocated on the stack, and which will last until the function returns.
+ Use of alloca should be avoided:
+ - inside arguments of function calls - undefined behaviour,
+ - in inline functions - the allocation may actually last until the
+ calling function returns,
+ - for huge N (say, N >= 65536) - you never know how large (or small)
+ the stack is, and when the stack cannot fulfill the memory allocation
+ request, the program just crashes.
+ */
#ifdef __GNUC__
# ifndef alloca
# ifdef __cplusplus
extern "C" void *alloca (unsigned int);
# else /* not __cplusplus */
-void *alloca ();
+extern void *alloca ();
# endif /* not __cplusplus */
# else /* not __hpux */
# ifndef alloca
-char *alloca ();
+extern char *alloca ();
# endif
# endif /* __hpux */
# endif
# endif
#endif
-#endif /* _LIBALLOCA_H */
+#endif /* _ALLOCA_H */
gt_TYPE_INTMAX_T
dnl Checks for library functions.
-AC_FUNC_ALLOCA
+gl_FUNC_ALLOCA
AC_CHECK_FUNCS([snprintf vasprintf])
dnl Check for tools needed for formatting the documentation.
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "vasnprintf.h"
+2003-01-12 Bruno Haible <bruno@clisp.org>
+
+ * onceonly.m4: New file, from gnulib.
+ * alloca.m4: New file, from gnulib.
+ * Makefile.am (EXTRA_DIST): Add them.
+
2003-01-12 Bruno Haible <bruno@clisp.org>
* wint_t.m4: New file.
aclocal_DATA = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 lcmessage.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4
# Generate this list with
-# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
-# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
+# find . -type f -name '*.m4' -printf '%f\n' | sort | tr '\012' @ | sed 's/@$/%/;s/@/ \\@/g' | tr @% '\012\012'
EXTRA_DIST = README \
-backupfile.m4 codeset.m4 error.m4 fixautomake.m4 flex.m4 fnmatch.m4 gcj.m4 \
-getline.m4 gettext.m4 glibc21.m4 hostname.m4 iconv.m4 intdiv0.m4 intmax.m4 \
-inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 javacomp.m4 \
-javaexec.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 libtool.m4 \
-longdouble.m4 longlong.m4 mbrtowc.m4 mbstate_t.m4 mbswidth.m4 mkdtemp.m4 \
-progtest.m4 setenv.m4 setlocale.m4 siginfo.m4 signalblocking.m4 signed.m4 \
-ssize_t.m4 stdbool.m4 stdint_h.m4 tmpdir.m4 uintmax_t.m4 ulonglong.m4 \
-unionwait.m4 wchar_t.m4 wint_t.m4
+alloca.m4 \
+backupfile.m4 \
+codeset.m4 \
+error.m4 \
+fixautomake.m4 \
+flex.m4 \
+fnmatch.m4 \
+gcj.m4 \
+getline.m4 \
+gettext.m4 \
+glibc21.m4 \
+hostname.m4 \
+iconv.m4 \
+intdiv0.m4 \
+intmax.m4 \
+inttypes.m4 \
+inttypes_h.m4 \
+inttypes-pri.m4 \
+isc-posix.m4 \
+javacomp.m4 \
+javaexec.m4 \
+lcmessage.m4 \
+lib-ld.m4 \
+lib-link.m4 \
+lib-prefix.m4 \
+libtool.m4 \
+longdouble.m4 \
+longlong.m4 \
+mbrtowc.m4 \
+mbstate_t.m4 \
+mbswidth.m4 \
+mkdtemp.m4 \
+onceonly.m4 \
+progtest.m4 \
+setenv.m4 \
+setlocale.m4 \
+siginfo.m4 \
+signalblocking.m4 \
+signed.m4 \
+ssize_t.m4 \
+stdbool.m4 \
+stdint_h.m4 \
+tmpdir.m4 \
+uintmax_t.m4 \
+ulonglong.m4 \
+unionwait.m4 \
+wchar_t.m4 \
+wint_t.m4
--- /dev/null
+# alloca.m4 serial 2
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([gl_FUNC_ALLOCA],
+[
+ dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
+ AC_REQUIRE([AC_PROG_CPP])
+ AC_REQUIRE([AC_PROG_EGREP])
+
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ if test $ac_cv_func_alloca_works = no; then
+ gl_PREREQ_ALLOCA
+ fi
+
+ # Define an additional variable used in the Makefile substitution.
+
+ AC_EGREP_CPP([Need own alloca], [
+#if defined __GNUC__ || defined _MSC_VER || !HAVE_ALLOCA_H
+ Need own alloca
+#endif
+ ],
+ ALLOCA_H=alloca.h,
+ ALLOCA_H=)
+ AC_SUBST([ALLOCA_H])
+])
+
+# Prerequisites of lib/alloca.c.
+# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
+AC_DEFUN([gl_PREREQ_ALLOCA], [
+ AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
+])
+2003-01-12 Bruno Haible <bruno@clisp.org>
+
+ * format-java.c: Include alloca.h instead of liballoca.h.
+ * msggrep.c: Likewise.
+ * msginit.c: Likewise.
+ * msgl-cat.c: Likewise.
+ * msgl-charset.c: Likewise.
+ * msgl-iconv.c: Likewise.
+ * msgmerge.c: Likewise.
+ * po-charset.c: Likewise.
+ * read-tcl.c: Likewise.
+ * write-java.c: Likewise.
+ * write-mo.c: Likewise.
+ * write-po.c: Likewise.
+ * write-tcl.c: Likewise.
+
2003-01-12 Bruno Haible <bruno@clisp.org>
* Makefile.am: Make use of += for variables.
/* Java format strings.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
#include <stdbool.h>
#include <stdlib.h>
/* Extract some translations of a translation catalog.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "liballoca.h"
+#include <alloca.h>
#include <errno.h>
#include <getopt.h>
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"),
- "2001-2002");
+ "2001-2003");
printf (_("Written by %s.\n"), "Bruno Haible");
exit (EXIT_SUCCESS);
}
/* Initializes a new PO file.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "liballoca.h"
+#include <alloca.h>
#include <errno.h>
#include <getopt.h>
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"),
- "2001-2002");
+ "2001-2003");
printf (_("Written by %s.\n"), "Bruno Haible");
exit (EXIT_SUCCESS);
}
/* Message list concatenation and duplicate handling.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "msgl-cat.h"
/* Message list charset and locale charset handling.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "msgl-charset.h"
/* Message list charset and locale charset handling.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "msgl-iconv.h"
size_t length;
char *result;
- /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
+ /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
# if defined _LIBICONV_VERSION \
|| !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
/* Set to the initial state. */
if (length == 0)
return 0;
- /* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
+ /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug. */
# if defined _LIBICONV_VERSION \
|| !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
/* Return to the initial state. */
/* GNU gettext - internationalization aids
- Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
#include <getopt.h>
#include <limits.h>
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"),
- "1995-1998, 2000-2002");
+ "1995-1998, 2000-2003");
printf (_("Written by %s.\n"), "Peter Miller");
exit (EXIT_SUCCESS);
}
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "po-charset.h"
/* Reading tcl/msgcat .msg files.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "read-tcl.h"
/* Writing Java ResourceBundles.
- Copyright (C) 2001-2002 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "write-java.h"
/* Writing binary .mo files.
- Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "write-mo.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "write-po.h"
/* Writing tcl/msgcat .msg files.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002-2003 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This program is free software; you can redistribute it and/or modify
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
-#include "liballoca.h"
+#include <alloca.h>
/* Specification. */
#include "write-tcl.h"