diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-08-09 23:42:26 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-08-09 23:42:26 +0000 |
commit | 93f90065f31c35780e2dc3d6b7c987677d9bc14e (patch) | |
tree | ba198c539d289ba716e4de9f420e58a61e214a84 /m4 | |
parent | d24265f9659d21c8e89f1f21cf3b774c7c120afe (diff) | |
download | coreutils-93f90065f31c35780e2dc3d6b7c987677d9bc14e.tar.xz |
Sync from gnulib.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ChangeLog | 10 | ||||
-rw-r--r-- | m4/getline.m4 | 17 | ||||
-rw-r--r-- | m4/gettext.m4 | 196 | ||||
-rw-r--r-- | m4/inttypes-pri.m4 | 8 | ||||
-rw-r--r-- | m4/lib-link.m4 | 80 | ||||
-rw-r--r-- | m4/localcharset.m4 | 3 | ||||
-rw-r--r-- | m4/mbchar.m4 | 6 | ||||
-rw-r--r-- | m4/nls.m4 | 24 | ||||
-rw-r--r-- | m4/po.m4 | 83 | ||||
-rw-r--r-- | m4/prereq.m4 | 5 | ||||
-rw-r--r-- | m4/stdarg.m4 | 40 | ||||
-rw-r--r-- | m4/stdint.m4 | 27 | ||||
-rw-r--r-- | m4/stdio-safer.m4 | 12 | ||||
-rw-r--r-- | m4/unistd-safer.m4 | 5 | ||||
-rw-r--r-- | m4/wcwidth.m4 | 6 |
15 files changed, 375 insertions, 147 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog index 6f51015a3..18939a551 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,13 @@ +2006-08-09 Paul Eggert <eggert@cs.ucla.edu> + + * inttypes-h.m4, stdarg.m4: New files, from gnulib. + * prereq.m4 (gl_PREREQ): Require gl_STDARG_H. + Require gl_FOPEN_SAFER rather than gl_STDIO_SAFER (due to renaming). + * getline.m4, gettext.m4, inttypes-pri.m4, lib-link.m4, localcharset.m4: + * mbchar.m4, nls.m4, po.m4, stdint.m4, stdio-safer.m4, unistd-safer.m4: + * wcwidth.m4: + Update from gnulib. + 2006-08-08 Paul Eggert <eggert@cs.ucla.edu> * memxfrm.m4, randint.m4, randperm.m4, randread.m4: New files. diff --git a/m4/getline.m4 b/m4/getline.m4 index ff255a366..f49c50eed 100644 --- a/m4/getline.m4 +++ b/m4/getline.m4 @@ -1,6 +1,6 @@ -# getline.m4 serial 13 +# getline.m4 serial 14 -dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software +dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software dnl Foundation, Inc. dnl dnl This file is free software; the Free Software Foundation @@ -47,7 +47,18 @@ AC_DEFUN([gl_FUNC_GETLINE], } ], am_cv_func_working_getline=yes dnl The library version works. , am_cv_func_working_getline=no dnl The library version does NOT work. - , am_cv_func_working_getline=no dnl We're cross compiling. + , dnl We're cross compiling. Assume it works on glibc2 systems. + [AC_EGREP_CPP([Lucky GNU user], + [ +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ >= 2) + Lucky GNU user + #endif +#endif + ], + [am_cv_func_working_getline=yes], + [am_cv_func_working_getline=no])] )]) fi diff --git a/m4/gettext.m4 b/m4/gettext.m4 index 624a80785..dae3d81e7 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -1,5 +1,5 @@ -# gettext.m4 serial 37 (gettext-0.14.4) -dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. +# gettext.m4 serial 53 (gettext-0.15) +dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -15,7 +15,7 @@ dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. -dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. +dnl Bruno Haible <haible@clisp.cons.org>, 2000-2005. dnl Macro to add for using GNU gettext. @@ -94,7 +94,7 @@ AC_DEFUN([AM_GNU_GETTEXT], gt_INTL_MACOSX dnl Set USE_NLS. - AM_NLS + AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no @@ -130,13 +130,11 @@ AC_DEFUN([AM_GNU_GETTEXT], AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include <libintl.h> ]ifelse([$2], [need-formatstring-macros], -[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif -changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -changequote([,])dnl -], [])[extern int _nl_msg_cat_cntr; +]], [])[extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], @@ -162,13 +160,11 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include <libintl.h> ]ifelse([$2], [need-formatstring-macros], -[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif -changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -changequote([,])dnl -], [])[extern int _nl_msg_cat_cntr; +]], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" @@ -183,13 +179,11 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include <libintl.h> ]ifelse([$2], [need-formatstring-macros], -[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +[[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif -changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -changequote([,])dnl -], [])[extern int _nl_msg_cat_cntr; +]], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" @@ -234,8 +228,8 @@ return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes - LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" - LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi @@ -359,33 +353,22 @@ dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([gt_GLIBC2])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl - AC_REQUIRE([AC_ISC_POSIX])dnl - AC_REQUIRE([AC_HEADER_STDC])dnl - AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([gl_VISIBILITY])dnl + AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl AC_REQUIRE([bh_C_SIGNED])dnl - AC_REQUIRE([AC_C_INLINE])dnl - AC_REQUIRE([AC_TYPE_OFF_T])dnl - AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl AC_REQUIRE([gt_TYPE_WCHAR_T])dnl AC_REQUIRE([gt_TYPE_WINT_T])dnl AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) - AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([gt_TYPE_INTMAX_T]) AC_REQUIRE([gt_PRINTF_POSIX]) - AC_REQUIRE([AC_FUNC_ALLOCA])dnl - AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([gl_GLIBC21])dnl - AC_REQUIRE([gt_INTDIV0])dnl - AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl - AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl - AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gl_XSIZE])dnl AC_REQUIRE([gt_INTL_MACOSX])dnl @@ -393,12 +376,8 @@ AC_DEFUN([AM_INTL_SUBDIR], [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) - AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ -stdlib.h string.h unistd.h sys/param.h]) - AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ -mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ -strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ -__fsetlocking]) + AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) + AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). @@ -410,8 +389,6 @@ __fsetlocking]) dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. - gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>]) - gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>]) gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>]) case $gt_cv_func_printf_posix in @@ -438,14 +415,125 @@ __fsetlocking]) fi AC_SUBST([HAVE_WPRINTF]) - AM_ICONV AM_LANGINFO_CODESET - if test $ac_cv_header_locale_h = yes; then - gt_LC_MESSAGES + gt_LC_MESSAGES + + dnl Compilation on mingw and Cygwin needs special Makefile rules, because + dnl 1. when we install a shared library, we must arrange to export + dnl auxiliary pointer variables for every exported variable, + dnl 2. when we install a shared library and a static library simultaneously, + dnl the include file specifies __declspec(dllimport) and therefore we + dnl must arrange to define the auxiliary pointer variables for the + dnl exported variables _also_ in the static library. + if test "$enable_shared" = yes; then + case "$host_os" in + cygwin*) is_woe32dll=yes ;; + *) is_woe32dll=no ;; + esac + else + is_woe32dll=no fi + WOE32DLL=$is_woe32dll + AC_SUBST([WOE32DLL]) + + dnl Rename some macros and functions used for locking. + AH_BOTTOM([ +#define __libc_lock_t gl_lock_t +#define __libc_lock_define gl_lock_define +#define __libc_lock_define_initialized gl_lock_define_initialized +#define __libc_lock_init gl_lock_init +#define __libc_lock_lock gl_lock_lock +#define __libc_lock_unlock gl_lock_unlock +#define __libc_lock_recursive_t gl_recursive_lock_t +#define __libc_lock_define_recursive gl_recursive_lock_define +#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized +#define __libc_lock_init_recursive gl_recursive_lock_init +#define __libc_lock_lock_recursive gl_recursive_lock_lock +#define __libc_lock_unlock_recursive gl_recursive_lock_unlock +#define glthread_in_use libintl_thread_in_use +#define glthread_lock_init libintl_lock_init +#define glthread_lock_lock libintl_lock_lock +#define glthread_lock_unlock libintl_lock_unlock +#define glthread_lock_destroy libintl_lock_destroy +#define glthread_rwlock_init libintl_rwlock_init +#define glthread_rwlock_rdlock libintl_rwlock_rdlock +#define glthread_rwlock_wrlock libintl_rwlock_wrlock +#define glthread_rwlock_unlock libintl_rwlock_unlock +#define glthread_rwlock_destroy libintl_rwlock_destroy +#define glthread_recursive_lock_init libintl_recursive_lock_init +#define glthread_recursive_lock_lock libintl_recursive_lock_lock +#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock +#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy +#define glthread_once libintl_once +#define glthread_once_call libintl_once_call +#define glthread_once_singlethreaded libintl_once_singlethreaded +]) +]) + + +dnl Checks for the core files of the intl subdirectory: +dnl dcigettext.c +dnl eval-plural.h +dnl explodename.c +dnl finddomain.c +dnl gettextP.h +dnl gmo.h +dnl hash-string.h hash-string.c +dnl l10nflist.c +dnl libgnuintl.h.in (except the *printf stuff) +dnl loadinfo.h +dnl loadmsgcat.c +dnl localealias.c +dnl log.c +dnl plural-exp.h plural-exp.c +dnl plural.y +dnl Used by libglocale. +AC_DEFUN([gt_INTL_SUBDIR_CORE], +[ + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([gt_INTDIV0])dnl + AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl + AC_REQUIRE([gl_HEADER_INTTYPES_H])dnl + AC_REQUIRE([gt_INTTYPES_PRI])dnl + AC_REQUIRE([gl_LOCK])dnl + + AC_TRY_LINK( + [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }], + [], + [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1, + [Define to 1 if the compiler understands __builtin_expect.])]) - if test -n "$INTL_MACOSX_LIBS"; then - CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" + AC_CHECK_HEADERS([argz.h limits.h unistd.h sys/param.h]) + AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \ + stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \ + argz_next __fsetlocking]) + + dnl Use the *_unlocked functions only if they are declared. + dnl (because some of them were defined without being declared in Solaris + dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built + dnl on Solaris 2.5.1 to run on Solaris 2.6). + dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. + gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>]) + gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>]) + + AM_ICONV + + dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined, + dnl and a _NL_LOCALE_NAME macro always. + AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name, + [AC_TRY_LINK([#include <langinfo.h> +#include <locale.h>], + [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));], + gt_cv_nl_locale_name=yes, + gt_cv_nl_locale_name=no) + ]) + if test $gt_cv_nl_locale_name = yes; then + AC_DEFINE(HAVE_NL_LOCALE_NAME, 1, + [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.]) fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, @@ -488,15 +576,12 @@ AC_DEFUN([gt_INTL_MACOSX], dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], gt_cv_func_CFPreferencesCopyAppValue, - [gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" - gt_save_LIBS="$LIBS" - LIBS="$LIBS -framework CoreFoundation" - AC_TRY_LINK([#include <CFPreferences.h>], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) - CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, @@ -504,14 +589,11 @@ AC_DEFUN([gt_INTL_MACOSX], fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, - [gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" - gt_save_LIBS="$LIBS" - LIBS="$LIBS -framework CoreFoundation" - AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();], + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) - CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 index 4d56a9ad3..ef00da742 100644 --- a/m4/inttypes-pri.m4 +++ b/m4/inttypes-pri.m4 @@ -1,5 +1,5 @@ -# inttypes-pri.m4 serial 1 (gettext-0.11.4) -dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. +# inttypes-pri.m4 serial 2 (gettext-0.15) +dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,8 +11,8 @@ dnl From Bruno Haible. AC_DEFUN([gt_INTTYPES_PRI], [ - AC_REQUIRE([gt_HEADER_INTTYPES_H]) - if test $gt_cv_header_inttypes_h = yes; then + AC_REQUIRE([gl_HEADER_INTTYPES_H]) + if test $gl_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 index 244a77911..92929193f 100644 --- a/m4/lib-link.m4 +++ b/m4/lib-link.m4 @@ -1,5 +1,5 @@ -# lib-link.m4 serial 7 (gettext-0.15) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. +# lib-link.m4 serial 8 (gettext-0.15) +dnl Copyright (C) 2001-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -552,3 +552,79 @@ AC_DEFUN([AC_LIB_APPENDTOVAR], fi done ]) + +dnl For those cases where a variable contains several -L and -l options +dnl referring to unknown libraries and directories, this macro determines the +dnl necessary additional linker options for the runtime path. +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) +dnl sets LDADDVAR to linker options needed together with LIBSVALUE. +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, +dnl otherwise linking without libtool is assumed. +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], +[ + AC_REQUIRE([AC_LIB_RPATH]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + $1= + if test "$enable_rpath" != no; then + if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode directories into the resulting + dnl binary. + rpathdirs= + next= + for opt in $2; do + if test -n "$next"; then + dir="$next" + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""$3""; then + dnl libtool is used for linking. Use -R options. + for dir in $rpathdirs; do + $1="${$1}${$1:+ }-R$dir" + done + else + dnl The linker is used for linking directly. + if test -n "$hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user + dnl must pass all path elements in one option. + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="$flag" + else + dnl The -rpath options are cumulative. + for dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$dir" + eval flag=\"$hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + $1="${$1}${$1:+ }$flag" + done + fi + fi + fi + fi + fi + AC_SUBST([$1]) +]) diff --git a/m4/localcharset.m4 b/m4/localcharset.m4 index 6863d3225..c0396356c 100644 --- a/m4/localcharset.m4 +++ b/m4/localcharset.m4 @@ -1,4 +1,4 @@ -# localcharset.m4 serial 3 +# localcharset.m4 serial 4 dnl Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_LOCALCHARSET], [ dnl Prerequisites of lib/localcharset.c. - AC_CHECK_HEADERS_ONCE(stddef.h stdlib.h string.h) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CHECK_DECLS_ONCE(getc_unlocked) AC_CHECK_FUNCS_ONCE(setlocale) diff --git a/m4/mbchar.m4 b/m4/mbchar.m4 index df351a6eb..ec4cbab11 100644 --- a/m4/mbchar.m4 +++ b/m4/mbchar.m4 @@ -1,5 +1,5 @@ -# mbchar.m4 serial 2 -dnl Copyright (C) 2005 Free Software Foundation, Inc. +# mbchar.m4 serial 3 +dnl Copyright (C) 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -16,5 +16,7 @@ AC_DEFUN([gl_MBCHAR], dnl Compile mbchar.c only if HAVE_WCHAR_H && HAVE_WCTYPE_H. if test $ac_cv_header_wchar_h = yes && test $ac_cv_header_wctype_h = yes; then AC_LIBOBJ([mbchar]) + dnl Prerequisites of mbchar.h and mbchar.c. + AC_CHECK_FUNCS([iswcntrl]) fi ]) @@ -1,5 +1,5 @@ -# nls.m4 serial 2 (gettext-0.14.3) -dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc. +# nls.m4 serial 3 (gettext-0.15) +dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -29,23 +29,3 @@ AC_DEFUN([AM_NLS], AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) - -AC_DEFUN([AM_MKINSTALLDIRS], -[ - dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing. - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])]) - dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly - dnl find the mkinstalldirs script in another subdir but $(top_srcdir). - dnl Try to locate it. - MKINSTALLDIRS= - if test -n "$ac_aux_dir"; then - case "$ac_aux_dir" in - /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; - *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; - esac - fi - if test -z "$MKINSTALLDIRS"; then - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" - fi - AC_SUBST(MKINSTALLDIRS) -]) @@ -1,5 +1,5 @@ -# po.m4 serial 7 (gettext-0.14.3) -dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. +# po.m4 serial 13 (gettext-0.15) +dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -24,7 +24,7 @@ AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_MKINSTALLDIRS])dnl + AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Perform the following tests also if --disable-nls has been given, @@ -39,6 +39,22 @@ AC_DEFUN([AM_PO_SUBDIRS], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + dnl Test whether it is GNU msgfmt >= 0.15. +changequote(,)dnl + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([MSGFMT_015]) +changequote(,)dnl + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([GMSGFMT_015]) + dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. @@ -49,44 +65,26 @@ AC_DEFUN([AM_PO_SUBDIRS], dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po + dnl Test whether it is GNU xgettext >= 0.15. +changequote(,)dnl + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac +changequote([,])dnl + AC_SUBST([XGETTEXT_015]) + dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) - dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. - dnl Test whether we really found GNU msgfmt. - if test "$GMSGFMT" != ":"; then - dnl If it is no GNU msgfmt we define it as : so that the - dnl Makefiles still can work. - if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && - (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - : ; - else - GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` - AC_MSG_RESULT( - [found $GMSGFMT program is not GNU msgfmt; ignore it]) - GMSGFMT=":" - fi - fi - - dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. - dnl Test whether we really found GNU xgettext. - if test "$XGETTEXT" != ":"; then - dnl If it is no GNU xgettext we define it as : so that the - dnl Makefiles still can work. - if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && - (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - : ; - else - AC_MSG_RESULT( - [found xgettext program is not GNU xgettext; ignore it]) - XGETTEXT=":" - fi - dnl Remove leftover from FreeBSD xgettext call. - rm -f messages.po - fi + dnl Installation directories. + dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we + dnl have to define it here, so that it can be used in po/Makefile. + test -n "$localedir" || localedir='${datadir}/locale' + AC_SUBST([localedir]) - AC_OUTPUT_COMMANDS([ + AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in @@ -123,11 +121,12 @@ AC_DEFUN([AM_PO_SUBDIRS], test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake. + # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. + # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES @@ -197,10 +196,10 @@ AC_DEFUN([AM_PO_SUBDIRS], fi ;; esac - done], + done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake. + # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" @@ -286,7 +285,7 @@ x changequote([,])dnl # Set POTFILES to the value of the Makefile variable POTFILES. - sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`" + sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'` POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"` # Compute POTFILES_DEPS as # $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) @@ -305,10 +304,10 @@ changequote([,])dnl POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. - sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`" + sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` fi - # Hide the ALL_LINGUAS assigment from automake. + # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) diff --git a/m4/prereq.m4 b/m4/prereq.m4 index 9d445e690..816f1fe42 100644 --- a/m4/prereq.m4 +++ b/m4/prereq.m4 @@ -1,4 +1,4 @@ -#serial 69 +#serial 71 dnl We use gl_ for non Autoconf macros. m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl @@ -53,6 +53,7 @@ AC_DEFUN([gl_PREREQ], AC_REQUIRE([gl_FILE_NAME_CONCAT]) AC_REQUIRE([gl_FILE_TYPE]) AC_REQUIRE([gl_FSUSAGE]) + AC_REQUIRE([gl_FOPEN_SAFER]) AC_REQUIRE([gl_FUNC_ALLOCA]) AC_REQUIRE([gl_FUNC_ATEXIT]) AC_REQUIRE([gl_FUNC_DUP2]) @@ -147,8 +148,8 @@ AC_DEFUN([gl_PREREQ], AC_REQUIRE([gl_SHA512]) AC_REQUIRE([gl_STAT_MACROS]) AC_REQUIRE([gl_STAT_TIME]) + AC_REQUIRE([gl_STDARG_H]) AC_REQUIRE([gl_STDINT_H]) - AC_REQUIRE([gl_STDIO_SAFER]) AC_REQUIRE([gl_STDLIB_SAFER]) AC_REQUIRE([gl_STRCASE]) AC_REQUIRE([gl_STRINTCMP]) diff --git a/m4/stdarg.m4 b/m4/stdarg.m4 new file mode 100644 index 000000000..e8e680a5c --- /dev/null +++ b/m4/stdarg.m4 @@ -0,0 +1,40 @@ +# stdarg.m4 serial 1 +dnl Copyright (C) 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Provide a working va_copy in combination with <stdarg.h>. + +AC_DEFUN([gl_STDARG_H], +[ + AC_MSG_CHECKING([for va_copy]) + AC_CACHE_VAL([gl_cv_func_va_copy], [ + AC_TRY_COMPILE([#include <stdarg.h>], [ +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif +], + [gl_cv_func_va_copy=yes], [gl_cv_func_va_copy=no])]) + AC_MSG_RESULT([$gl_cv_func_va_copy]) + if test $gl_cv_func_va_copy = no; then + # Provide a substitute, either __va_copy or as a simple assignment. + AC_CACHE_VAL([gl_cv_func___va_copy], [ + AC_TRY_COMPILE([#include <stdarg.h>], [ +#ifndef __va_copy +error, bail out +#endif +], + [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])]) + if test $gl_cv_func___va_copy = yes; then + AC_DEFINE([va_copy], [__va_copy], + [Define as a macro for copying va_list variables.]) + else + AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */ +#define gl_va_copy(a,b) ((a) = (b))]) + AC_DEFINE([va_copy], [gl_va_copy], + [Define as a macro for copying va_list variables.]) + fi + fi +]) diff --git a/m4/stdint.m4 b/m4/stdint.m4 index fa073cd19..48748c613 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 15 +# stdint.m4 serial 18 dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -71,18 +71,23 @@ AC_DEFUN([gl_STDINT_H], AC_LANG_PROGRAM([[ #include <stddef.h> #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */ #include ABSOLUTE_STDINT_H #ifdef INT8_MAX int8_t a1 = INT8_MAX; +int8_t a1min = INT8_MIN; #endif #ifdef INT16_MAX int16_t a2 = INT16_MAX; +int16_t a2min = INT16_MIN; #endif #ifdef INT32_MAX int32_t a3 = INT32_MAX; +int32_t a3min = INT32_MIN; #endif #ifdef INT64_MAX int64_t a4 = INT64_MAX; +int64_t a4min = INT64_MIN; #endif #ifdef UINT8_MAX uint8_t b1 = UINT8_MAX; @@ -99,23 +104,40 @@ uint32_t b3 = UINT32_MAX; uint64_t b4 = UINT64_MAX; #endif int_least8_t c1 = INT8_C (0x7f); +int_least8_t c1max = INT_LEAST8_MAX; +int_least8_t c1min = INT_LEAST8_MIN; int_least16_t c2 = INT16_C (0x7fff); +int_least16_t c2max = INT_LEAST16_MAX; +int_least16_t c2min = INT_LEAST16_MIN; int_least32_t c3 = INT32_C (0x7fffffff); +int_least32_t c3max = INT_LEAST32_MAX; +int_least32_t c3min = INT_LEAST32_MIN; int_least64_t c4 = INT64_C (0x7fffffffffffffff); +int_least64_t c4max = INT_LEAST64_MAX; +int_least64_t c4min = INT_LEAST64_MIN; uint_least8_t d1 = UINT8_C (0xff); +uint_least8_t d1max = UINT_LEAST8_MAX; uint_least16_t d2 = UINT16_C (0xffff); +uint_least16_t d2max = UINT_LEAST16_MAX; uint_least32_t d3 = UINT32_C (0xffffffff); +uint_least32_t d3max = UINT_LEAST32_MAX; uint_least64_t d4 = UINT64_C (0xffffffffffffffff); +uint_least64_t d4max = UINT_LEAST64_MAX; int_fast8_t e1 = INT_FAST8_MAX; +int_fast8_t e1min = INT_FAST8_MIN; int_fast16_t e2 = INT_FAST16_MAX; +int_fast16_t e2min = INT_FAST16_MIN; int_fast32_t e3 = INT_FAST32_MAX; +int_fast32_t e3min = INT_FAST32_MIN; int_fast64_t e4 = INT_FAST64_MAX; +int_fast64_t e4min = INT_FAST64_MIN; uint_fast8_t f1 = UINT_FAST8_MAX; uint_fast16_t f2 = UINT_FAST16_MAX; uint_fast32_t f3 = UINT_FAST32_MAX; uint_fast64_t f4 = UINT_FAST64_MAX; #ifdef INTPTR_MAX intptr_t g = INTPTR_MAX; +intptr_t gmin = INTPTR_MIN; #endif #ifdef UINTPTR_MAX uintptr_t h = UINTPTR_MAX; @@ -296,7 +318,8 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], extern $gltype foo; extern $gltype1 foo;])], [eval gl_cv_type_${gltype}_suffix=\$glsuf]) - eval test \"\$gl_cv_type_${gltype}_suffix\" != no && break + eval result=\$gl_cv_type_${gltype}_suffix + test "$result" != no && break done]) GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix diff --git a/m4/stdio-safer.m4 b/m4/stdio-safer.m4 index cb60acb1e..40be1ad47 100644 --- a/m4/stdio-safer.m4 +++ b/m4/stdio-safer.m4 @@ -1,11 +1,17 @@ -#serial 5 -dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc. +#serial 7 +dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_STDIO_SAFER], +AC_DEFUN([gl_FOPEN_SAFER], [ AC_LIBSOURCES([fopen-safer.c, stdio-safer.h, stdio--.h]) AC_LIBOBJ([fopen-safer]) ]) + +AC_DEFUN([gl_TMPFILE_SAFER], +[ + AC_LIBSOURCES([tmpfile-safer.c, stdio-safer.h, stdio--.h]) + AC_LIBOBJ([tmpfile-safer]) +]) diff --git a/m4/unistd-safer.m4 b/m4/unistd-safer.m4 index 6fbe4c6fb..30526405d 100644 --- a/m4/unistd-safer.m4 +++ b/m4/unistd-safer.m4 @@ -1,11 +1,12 @@ -#serial 7 -dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc. +#serial 8 +dnl Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_UNISTD_SAFER], [ + AC_CHECK_FUNCS_ONCE([pipe]) AC_LIBSOURCES([dup-safer.c, fd-safer.c, pipe-safer.c, unistd-safer.h, unistd--.h]) AC_LIBOBJ([dup-safer]) AC_LIBOBJ([fd-safer]) diff --git a/m4/wcwidth.m4 b/m4/wcwidth.m4 index 09cf55a0e..06a12a1b2 100644 --- a/m4/wcwidth.m4 +++ b/m4/wcwidth.m4 @@ -1,4 +1,4 @@ -# wcwidth.m4 serial 3 +# wcwidth.m4 serial 4 dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -17,9 +17,7 @@ AC_DEFUN([gl_FUNC_WCWIDTH], AC_CHECK_DECLS([wcwidth], [], [], [ /* AIX 3.2.5 declares wcwidth in <string.h>. */ -#if HAVE_STRING_H -# include <string.h> -#endif +#include <string.h> #if HAVE_WCHAR_H # include <wchar.h> #endif |