summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/backupfile.m43
-rw-r--r--m4/bison.m415
-rw-r--r--m4/calloc.m45
-rw-r--r--m4/canonicalize.m45
-rw-r--r--m4/chown.m43
-rw-r--r--m4/cloexec.m45
-rw-r--r--m4/dup2.m410
-rw-r--r--m4/fileblocks.m46
-rw-r--r--m4/free.m41
-rw-r--r--m4/ftruncate.m45
-rw-r--r--m4/fts.m42
-rw-r--r--m4/getcwd.m41
-rw-r--r--m4/getopt.m474
-rw-r--r--m4/getpagesize.m44
-rw-r--r--m4/getpass.m44
-rw-r--r--m4/getugroups.m43
-rw-r--r--m4/group-member.m43
-rw-r--r--m4/idcache.m45
-rw-r--r--m4/lib-link.m415
-rw-r--r--m4/lib-prefix.m440
-rw-r--r--m4/link-follow.m47
-rw-r--r--m4/mkdir-p.m43
-rw-r--r--m4/mkstemp.m44
-rw-r--r--m4/mktime.m411
-rw-r--r--m4/mountlist.m43
-rw-r--r--m4/nanosleep.m43
-rw-r--r--m4/onceonly_2_57.m44
-rw-r--r--m4/pathmax.m44
-rw-r--r--m4/physmem.m43
-rw-r--r--m4/posixver.m43
-rw-r--r--m4/putenv.m410
-rw-r--r--m4/safe-read.m43
-rw-r--r--m4/same.m43
-rw-r--r--m4/save-cwd.m43
-rw-r--r--m4/stdio-safer.m45
-rw-r--r--m4/strndup.m46
-rw-r--r--m4/strnlen.m410
-rw-r--r--m4/unistd-safer.m415
-rw-r--r--m4/unlinkdir.m44
-rw-r--r--m4/userspec.m44
-rw-r--r--m4/xreadlink.m43
-rw-r--r--m4/xstrtod.m42
42 files changed, 157 insertions, 165 deletions
diff --git a/m4/backupfile.m4 b/m4/backupfile.m4
index 6aa3cc38b..3c3f41b5e 100644
--- a/m4/backupfile.m4
+++ b/m4/backupfile.m4
@@ -1,4 +1,4 @@
-# backupfile.m4 serial 8
+# backupfile.m4 serial 9
dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -14,6 +14,5 @@ AC_DEFUN([gl_BACKUPFILE],
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO])
AC_REQUIRE([gl_AC_DOS])
AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
- AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CHECK_FUNCS_ONCE([pathconf])
])
diff --git a/m4/bison.m4 b/m4/bison.m4
index 273b641ed..91039b1ce 100644
--- a/m4/bison.m4
+++ b/m4/bison.m4
@@ -1,6 +1,6 @@
#serial 4
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2005 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.
@@ -9,5 +9,16 @@ AC_DEFUN([gl_BISON],
[
# getdate.y works with bison only.
: ${YACC='bison -y'}
- AC_SUBST(YACC)
+dnl
+dnl Declaring YACC & YFLAGS precious will not be necessary after GNULIB
+dnl requires an Autoconf greater than 2.59c, but it will probably still be
+dnl useful to override the description of YACC in the --help output, re
+dnl getdate.y assuming `bison -y'.
+ AC_ARG_VAR(YACC,
+[The `Yet Another C Compiler' implementation to use. Defaults to `bison -y'.
+Values other than `bison -y' will most likely break on most systems.])dnl
+ AC_ARG_VAR(YFLAGS,
+[YFLAGS contains the list arguments that will be passed by default to Bison.
+This script will default YFLAGS to the empty string to avoid a default value of
+`-d' given by some make applications.])dnl
])
diff --git a/m4/calloc.m4 b/m4/calloc.m4
index d4d92f3c8..796c71fed 100644
--- a/m4/calloc.m4
+++ b/m4/calloc.m4
@@ -1,6 +1,6 @@
-# calloc.m4 serial 4
+# calloc.m4 serial 5
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005 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.
@@ -18,7 +18,6 @@
AC_DEFUN([_AC_FUNC_CALLOC_IF],
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
-AC_CHECK_HEADERS(stdlib.h)
AC_CACHE_CHECK([for GNU libc compatible calloc], ac_cv_func_calloc_0_nonnull,
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[exit (!calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8));])],
diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4
index 42c688a31..0ed92e1f1 100644
--- a/m4/canonicalize.m4
+++ b/m4/canonicalize.m4
@@ -1,4 +1,4 @@
-#serial 8
+#serial 9
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -12,7 +12,6 @@ AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME],
AC_LIBSOURCES([canonicalize.c, canonicalize.h])
AC_LIBOBJ([canonicalize])
- AC_REQUIRE([AC_HEADER_STDC])
- AC_CHECK_HEADERS(string.h sys/param.h)
+ AC_CHECK_HEADERS(sys/param.h)
AC_CHECK_FUNCS(resolvepath canonicalize_file_name)
])
diff --git a/m4/chown.m4 b/m4/chown.m4
index 389f0f97e..d1a7147e5 100644
--- a/m4/chown.m4
+++ b/m4/chown.m4
@@ -1,4 +1,4 @@
-#serial 15
+#serial 16
# Determine whether we need the chown wrapper.
dnl Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free
@@ -79,6 +79,5 @@ AC_DEFUN([gl_FUNC_CHOWN_FOLLOWS_SYMLINK],
# Prerequisites of lib/chown.c.
AC_DEFUN([gl_PREREQ_CHOWN],
[
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
])
diff --git a/m4/cloexec.m4 b/m4/cloexec.m4
index ab2d358a4..7e0f801e9 100644
--- a/m4/cloexec.m4
+++ b/m4/cloexec.m4
@@ -1,4 +1,4 @@
-# serial 4
+#serial 5
dnl Copyright (C) 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,7 +8,4 @@ AC_DEFUN([gl_CLOEXEC],
[
AC_LIBSOURCES([cloexec.c, cloexec.h])
AC_LIBOBJ([cloexec])
-
- dnl Prerequisites of lib/cloexec.c.
- AC_CHECK_HEADERS_ONCE(unistd.h)
])
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index 31af8044d..bf8524e14 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,4 +1,4 @@
-#serial 3
+#serial 4
dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -7,12 +7,4 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_DUP2],
[
AC_REPLACE_FUNCS(dup2)
- if test $ac_cv_func_dup2 = no; then
- gl_PREREQ_DUP2
- fi
-])
-
-# Prerequisites of lib/dup2.c.
-AC_DEFUN([gl_PREREQ_DUP2], [
- AC_CHECK_HEADERS_ONCE(unistd.h)
])
diff --git a/m4/fileblocks.m4 b/m4/fileblocks.m4
index 2b7bbd9f3..6bd971d4b 100644
--- a/m4/fileblocks.m4
+++ b/m4/fileblocks.m4
@@ -1,5 +1,5 @@
-# fileblocks.m4 serial 2
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# fileblocks.m4 serial 3
+dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -15,5 +15,5 @@ AC_DEFUN([gl_FILEBLOCKS],
# Prerequisites of lib/fileblocks.c.
AC_DEFUN([gl_PREREQ_FILEBLOCKS], [
- AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
+ AC_CHECK_HEADERS_ONCE(sys/param.h)
])
diff --git a/m4/free.m4 b/m4/free.m4
index cb7b1c666..566734b77 100644
--- a/m4/free.m4
+++ b/m4/free.m4
@@ -16,7 +16,6 @@
AC_DEFUN([gl_FUNC_FREE],
[
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CACHE_CHECK([whether free (NULL) is known to work],
[gl_cv_func_free],
[AC_COMPILE_IFELSE(
diff --git a/m4/ftruncate.m4 b/m4/ftruncate.m4
index d25c17ef6..c225e48a3 100644
--- a/m4/ftruncate.m4
+++ b/m4/ftruncate.m4
@@ -1,8 +1,8 @@
-#serial 7
+#serial 8
# See if we need to emulate a missing ftruncate function using fcntl or chsize.
-# Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2003, 2004, 2005 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.
@@ -18,6 +18,5 @@ AC_DEFUN([gl_FUNC_FTRUNCATE],
# Prerequisites of lib/ftruncate.c.
AC_DEFUN([gl_PREREQ_FTRUNCATE],
[
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CHECK_FUNCS(chsize)
])
diff --git a/m4/fts.m4 b/m4/fts.m4
index 7eccac8b5..61457e3ce 100644
--- a/m4/fts.m4
+++ b/m4/fts.m4
@@ -1,4 +1,4 @@
-#serial 5
+#serial 6
dnl Copyright (C) 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/getcwd.m4 b/m4/getcwd.m4
index 93b3091b6..35d0b53bd 100644
--- a/m4/getcwd.m4
+++ b/m4/getcwd.m4
@@ -11,7 +11,6 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
AC_LIBSOURCES([getcwd.c, getcwd.h])
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
[gl_cv_func_getcwd_null],
[AC_TRY_RUN(
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index 79c699162..6b98782c4 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 9
+# getopt.m4 serial 11
dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,63 +10,71 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_GETOPT_SUBSTITUTE],
[
- GETOPT_H=getopt.h
AC_LIBOBJ([getopt])
AC_LIBOBJ([getopt1])
+ gl_GETOPT_SUBSTITUTE_HEADER
+ gl_PREREQ_GETOPT
+])
+
+AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
+[
+ GETOPT_H=getopt.h
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
[Define to rpl_ if the getopt replacement functions and variables
should be used.])
AC_SUBST([GETOPT_H])
])
-AC_DEFUN([gl_GETOPT],
+AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
[
- gl_PREREQ_GETOPT
-
if test -z "$GETOPT_H"; then
- GETOPT_H=
AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h])
- if test -z "$GETOPT_H"; then
- AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
- fi
+ fi
- dnl BSD getopt_long uses an incompatible method to reset option processing,
- dnl and (as of 2004-10-15) mishandles optional option-arguments.
- if test -z "$GETOPT_H"; then
- AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
- fi
+ if test -z "$GETOPT_H"; then
+ AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h])
+ fi
+
+ dnl BSD getopt_long uses an incompatible method to reset option processing,
+ dnl and (as of 2004-10-15) mishandles optional option-arguments.
+ if test -z "$GETOPT_H"; then
+ AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include <getopt.h>])
+ fi
- dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
- dnl option string (as of 2005-05-05).
- if test -z "$GETOPT_H"; then
- AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
+ dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
+ dnl option string (as of 2005-05-05).
+ if test -z "$GETOPT_H"; then
+ AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt],
[AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([#include <getopt.h>],
+ [AC_LANG_PROGRAM([#include <getopt.h>],
[[
char *myargv[3];
myargv[0] = "conftest";
myargv[1] = "-+";
myargv[2] = 0;
return getopt (2, myargv, "+a") != '?';
- ]])],
- [gl_cv_func_gnu_getopt=yes],
- [gl_cv_func_gnu_getopt=no],
- [dnl cross compiling - pessimistically guess based on decls
- dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
- dnl option string (as of 2005-05-05).
- AC_CHECK_DECL([getopt_clip],
+ ]])],
+ [gl_cv_func_gnu_getopt=yes],
+ [gl_cv_func_gnu_getopt=no],
+ [dnl cross compiling - pessimistically guess based on decls
+ dnl Solaris 10 getopt doesn't handle `+' as a leading character in an
+ dnl option string (as of 2005-05-05).
+ AC_CHECK_DECL([getopt_clip],
[gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes],
[#include <getopt.h>])])])
- if test "$gl_cv_func_gnu_getopt" = "no"; then
- GETOPT_H=getopt.h
- fi
- fi
-
- if test -n "$GETOPT_H"; then
- gl_GETOPT_SUBSTITUTE
+ if test "$gl_cv_func_gnu_getopt" = "no"; then
+ GETOPT_H=getopt.h
fi
fi
])
+AC_DEFUN([gl_GETOPT_IFELSE],
+[
+ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
+ AS_IF([test -n "$GETOPT_H"], [$1], [$2])
+])
+
+AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
+
# Prerequisites of lib/getopt*.
AC_DEFUN([gl_PREREQ_GETOPT], [:])
diff --git a/m4/getpagesize.m4 b/m4/getpagesize.m4
index 12d688905..6d84890e7 100644
--- a/m4/getpagesize.m4
+++ b/m4/getpagesize.m4
@@ -1,4 +1,4 @@
-# getpagesize.m4 serial 4
+# getpagesize.m4 serial 5
dnl Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,7 @@ AC_DEFUN([gl_GETPAGESIZE],
AC_LIBSOURCES([getpagesize.h])
dnl Prerequisites of lib/getpagesize.h.
- AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
+ AC_CHECK_HEADERS_ONCE(sys/param.h)
AC_CHECK_HEADERS(OS.h)
AC_CHECK_FUNCS(getpagesize)
])
diff --git a/m4/getpass.m4 b/m4/getpass.m4
index 3816253fd..3d7d33bbb 100644
--- a/m4/getpass.m4
+++ b/m4/getpass.m4
@@ -35,7 +35,7 @@ AC_DEFUN([gl_FUNC_GETPASS_GNU],
# Prerequisites of lib/getpass.c.
AC_DEFUN([gl_PREREQ_GETPASS], [
- AC_CHECK_HEADERS_ONCE(stdio_ext.h)
+ AC_CHECK_HEADERS_ONCE(stdio_ext.h termios.h)
+ AC_CHECK_FUNCS_ONCE(__fsetlocking tcgetattr tcsetattr)
AC_CHECK_DECLS_ONCE([fflush_unlocked flockfile fputs_unlocked funlockfile putc_unlocked])
- :
])
diff --git a/m4/getugroups.m4 b/m4/getugroups.m4
index be865303d..0369b07b3 100644
--- a/m4/getugroups.m4
+++ b/m4/getugroups.m4
@@ -1,4 +1,4 @@
-# getugroups.m4 serial 4
+# getugroups.m4 serial 5
dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,5 @@ AC_DEFUN([gl_GETUGROUPS],
AC_LIBOBJ([getugroups])
dnl Prerequisites of lib/getugroups.c.
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_TYPE_GETGROUPS
])
diff --git a/m4/group-member.m4 b/m4/group-member.m4
index d5e96c874..ab4a920ed 100644
--- a/m4/group-member.m4
+++ b/m4/group-member.m4
@@ -1,4 +1,4 @@
-#serial 8
+#serial 9
# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -25,6 +25,5 @@ AC_DEFUN([gl_FUNC_GROUP_MEMBER],
# Prerequisites of lib/group-member.c.
AC_DEFUN([gl_PREREQ_GROUP_MEMBER],
[
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_REQUIRE([AC_FUNC_GETGROUPS])
])
diff --git a/m4/idcache.m4 b/m4/idcache.m4
index d0ae832ea..804ce42a1 100644
--- a/m4/idcache.m4
+++ b/m4/idcache.m4
@@ -1,4 +1,4 @@
-# idcache.m4 serial 4
+# idcache.m4 serial 5
dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,7 +8,4 @@ AC_DEFUN([gl_IDCACHE],
[
AC_LIBSOURCES([idcache.c])
AC_LIBOBJ([idcache])
-
- dnl Prerequisites of lib/idcache.c.
- AC_CHECK_HEADERS_ONCE(unistd.h)
])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index ea0b0c4ea..244a77911 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 6 (gettext-0.14.3)
+# lib-link.m4 serial 7 (gettext-0.15)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -126,6 +126,7 @@ dnl the libraries corresponding to explicit and implicit dependencies.
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
[
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
dnl By default, look in $includedir and $libdir.
@@ -148,7 +149,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
])
else
additional_includedir="$withval/include"
- additional_libdir="$withval/lib"
+ additional_libdir="$withval/$acl_libdirstem"
fi
fi
])
@@ -248,7 +249,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl Linking with a shared library. We attempt to hardcode its
dnl directory into the executable's runpath, unless it's the
dnl standard /usr/lib.
- if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
@@ -334,8 +335,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl Assume the include files are nearby.
additional_includedir=
case "$found_dir" in
- */lib | */lib/)
- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
additional_includedir="$basedir/include"
;;
esac
@@ -396,9 +397,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl 3. if it's already present in $LDFLAGS or the already
dnl constructed $LIBNAME,
dnl 4. if it doesn't exist as a directory.
- if test "X$additional_libdir" != "X/usr/lib"; then
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
haveit=
- if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index 0d895ca63..a8684e17e 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,4 +1,4 @@
-# lib-prefix.m4 serial 4 (gettext-0.14.2)
+# lib-prefix.m4 serial 5 (gettext-0.15)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -24,6 +24,7 @@ AC_DEFUN([AC_LIB_PREFIX],
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl By default, look in $includedir and $libdir.
use_additional=yes
@@ -45,7 +46,7 @@ AC_DEFUN([AC_LIB_PREFIX],
])
else
additional_includedir="$withval/include"
- additional_libdir="$withval/lib"
+ additional_libdir="$withval/$acl_libdirstem"
fi
fi
])
@@ -87,7 +88,7 @@ AC_DEFUN([AC_LIB_PREFIX],
dnl 2. if it's already present in $LDFLAGS,
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
- if test "X$additional_libdir" != "X/usr/lib"; then
+ if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
haveit=
for x in $LDFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
@@ -97,7 +98,7 @@ AC_DEFUN([AC_LIB_PREFIX],
fi
done
if test -z "$haveit"; then
- if test "X$additional_libdir" = "X/usr/local/lib"; then
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
@@ -151,3 +152,34 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
exec_prefix="$acl_save_exec_prefix"
prefix="$acl_save_prefix"
])
+
+dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
+dnl the basename of the libdir, either "lib" or "lib64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+ dnl There is no formal standard regarding lib and lib64. The current
+ dnl practice is that on a system supporting 32-bit and 64-bit instruction
+ dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
+ dnl libraries go under $prefix/lib. We determine the compiler's default
+ dnl mode by looking at the compiler's library search path. If at least
+ dnl of its elements ends in /lib64 or points to a directory whose absolute
+ dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
+ dnl default, namely "lib".
+ acl_libdirstem=lib
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+])
diff --git a/m4/link-follow.m4 b/m4/link-follow.m4
index f67b48d54..735dad09f 100644
--- a/m4/link-follow.m4
+++ b/m4/link-follow.m4
@@ -1,4 +1,4 @@
-#serial 6
+#serial 7
dnl Run a program to determine whether whether link(2) follows symlinks.
dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
@@ -13,11 +13,6 @@ AC_DEFUN([gl_AC_FUNC_LINK_FOLLOWS_SYMLINK],
[whether link(2) dereferences a symlink specified with a trailing slash],
jm_ac_cv_func_link_follows_symlink,
[
- dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
- dnl the appropriate framework.
- test -z "$ac_cv_header_unistd_h" \
- && AC_CHECK_HEADERS(unistd.h)
-
# Create a regular file.
echo > conftest.file
AC_TRY_RUN(
diff --git a/m4/mkdir-p.m4 b/m4/mkdir-p.m4
index a92e66a38..2b72c4944 100644
--- a/m4/mkdir-p.m4
+++ b/m4/mkdir-p.m4
@@ -1,4 +1,4 @@
-# mkdir-p.m4 serial 8
+# mkdir-p.m4 serial 9
dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,6 +11,5 @@ AC_DEFUN([gl_MKDIR_PARENTS],
dnl Prerequisites of lib/mkdir-p.c.
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_REQUIRE([gl_AFS])
])
diff --git a/m4/mkstemp.m4 b/m4/mkstemp.m4
index fb6cfcdf7..091978884 100644
--- a/m4/mkstemp.m4
+++ b/m4/mkstemp.m4
@@ -1,4 +1,4 @@
-#serial 11
+#serial 12
# Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -65,7 +65,7 @@ AC_DEFUN([gl_PREREQ_MKSTEMP],
# Prerequisites of lib/tempname.c.
AC_DEFUN([gl_PREREQ_TEMPNAME],
[
- AC_CHECK_HEADERS_ONCE(sys/time.h stdint.h unistd.h)
+ AC_CHECK_HEADERS_ONCE(sys/time.h)
AC_CHECK_FUNCS(__secure_getenv gettimeofday)
AC_CHECK_DECLS_ONCE(getenv)
AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index 554ad25c9..07be5ccc0 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
-#serial 6
+#serial 7
dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -14,8 +14,8 @@ dnl From Jim Meyering.
# --------------
AC_DEFUN([AC_FUNC_MKTIME],
[AC_REQUIRE([AC_HEADER_TIME])dnl
-AC_CHECK_HEADERS(stdlib.h sys/time.h unistd.h)
-AC_CHECK_FUNCS(alarm)
+AC_CHECK_HEADERS_ONCE(sys/time.h)
+AC_CHECK_FUNCS_ONCE(alarm)
AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
[AC_RUN_IFELSE([AC_LANG_SOURCE(
[[/* Test program from Paul Eggert and Tony Leneis. */
@@ -30,10 +30,7 @@ AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
# endif
#endif
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
+#include <stdlib.h>
#include <unistd.h>
#if !HAVE_ALARM
diff --git a/m4/mountlist.m4 b/m4/mountlist.m4
index db06f8f18..b2a2e12f8 100644
--- a/m4/mountlist.m4
+++ b/m4/mountlist.m4
@@ -1,4 +1,4 @@
-#serial 7
+#serial 8
dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,6 @@ AC_DEFUN([gl_MOUNTLIST],
AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA],
[
dnl Note gl_LIST_MOUNTED_FILE_SYSTEMS checks for mntent.h, not sys/mntent.h.
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CHECK_HEADERS(sys/mntent.h)
gl_FSTYPENAME
])
diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4
index 3d64ca906..2d6c90b47 100644
--- a/m4/nanosleep.m4
+++ b/m4/nanosleep.m4
@@ -1,4 +1,4 @@
-#serial 13
+#serial 14
dnl From Jim Meyering.
dnl Check for the nanosleep function.
@@ -67,6 +67,5 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
# Prerequisites of lib/nanosleep.c.
AC_DEFUN([gl_PREREQ_NANOSLEEP],
[
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CHECK_FUNCS_ONCE(siginterrupt)
])
diff --git a/m4/onceonly_2_57.m4 b/m4/onceonly_2_57.m4
index 9fc510e06..14d3c0b2a 100644
--- a/m4/onceonly_2_57.m4
+++ b/m4/onceonly_2_57.m4
@@ -1,5 +1,5 @@
# onceonly_2_57.m4 serial 3
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2005 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
@@ -27,7 +27,7 @@ dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The
dnl size reduction is ca. 9%.
dnl Autoconf version 2.57 or newer is recommended.
-AC_PREREQ(2.54)
+AC_PREREQ(2.57)
# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
index ccf4a77c2..26c165935 100644
--- a/m4/pathmax.m4
+++ b/m4/pathmax.m4
@@ -1,4 +1,4 @@
-# pathmax.m4 serial 4
+# pathmax.m4 serial 5
dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,5 +9,5 @@ AC_DEFUN([gl_PATHMAX],
AC_LIBSOURCES([pathmax.h])
dnl Prerequisites of lib/pathmax.h.
- AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
+ AC_CHECK_HEADERS_ONCE(sys/param.h)
])
diff --git a/m4/physmem.m4 b/m4/physmem.m4
index 900b29b2b..18250ddec 100644
--- a/m4/physmem.m4
+++ b/m4/physmem.m4
@@ -1,4 +1,4 @@
-# physmem.m4 serial 4
+# physmem.m4 serial 5
dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -30,7 +30,6 @@ AC_DEFUN([gl_PHYSMEM],
AC_LIBOBJ([physmem])
# Prerequisites of lib/physmem.c.
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CHECK_HEADERS([sys/pstat.h sys/sysmp.h sys/sysinfo.h \
machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
sys/systemcfg.h],,, [AC_INCLUDES_DEFAULT])
diff --git a/m4/posixver.m4 b/m4/posixver.m4
index 369ba3fd6..838441a49 100644
--- a/m4/posixver.m4
+++ b/m4/posixver.m4
@@ -1,4 +1,4 @@
-# posixver.m4 serial 6
+# posixver.m4 serial 7
dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,6 @@ AC_DEFUN([gl_POSIXVER],
AC_LIBSOURCES([posixver.c, posixver.h])
AC_LIBOBJ([posixver])
- AC_CHECK_HEADERS_ONCE(unistd.h)
AC_REQUIRE([gl_DEFAULT_POSIX2_VERSION])
])
diff --git a/m4/putenv.m4 b/m4/putenv.m4
index 90ec17064..c913e27e6 100644
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -1,5 +1,5 @@
-# putenv.m4 serial 9
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# putenv.m4 serial 10
+dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -39,11 +39,5 @@ AC_DEFUN([gl_FUNC_PUTENV],
AC_LIBOBJ(putenv)
AC_DEFINE(putenv, rpl_putenv,
[Define to rpl_putenv if the replacement function should be used.])
- gl_PREREQ_PUTENV
fi
])
-
-# Prerequisites of lib/putenv.c.
-AC_DEFUN([gl_PREREQ_PUTENV], [
- AC_CHECK_HEADERS_ONCE(unistd.h)
-])
diff --git a/m4/safe-read.m4 b/m4/safe-read.m4
index ac8ecafac..e1f306417 100644
--- a/m4/safe-read.m4
+++ b/m4/safe-read.m4
@@ -1,4 +1,4 @@
-# safe-read.m4 serial 3
+# safe-read.m4 serial 4
dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -16,5 +16,4 @@ AC_DEFUN([gl_SAFE_READ],
AC_DEFUN([gl_PREREQ_SAFE_READ],
[
AC_REQUIRE([gt_TYPE_SSIZE_T])
- AC_CHECK_HEADERS_ONCE(unistd.h)
])
diff --git a/m4/same.m4 b/m4/same.m4
index 30cdfd2ff..cd7c16174 100644
--- a/m4/same.m4
+++ b/m4/same.m4
@@ -1,4 +1,4 @@
-# same.m4 serial 5
+# same.m4 serial 6
dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,6 +11,5 @@ AC_DEFUN([gl_SAME],
dnl Prerequisites of lib/same.c.
AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
- AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CHECK_FUNCS_ONCE([pathconf])
])
diff --git a/m4/save-cwd.m4 b/m4/save-cwd.m4
index 7acdfeb85..eec27890f 100644
--- a/m4/save-cwd.m4
+++ b/m4/save-cwd.m4
@@ -1,4 +1,4 @@
-#serial 6
+#serial 7
dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,5 +10,4 @@ AC_DEFUN([gl_SAVE_CWD],
AC_LIBOBJ([save-cwd])
dnl Prerequisites for lib/save-cwd.c.
AC_CHECK_FUNCS_ONCE(fchdir)
- AC_CHECK_HEADERS_ONCE(unistd.h)
])
diff --git a/m4/stdio-safer.m4 b/m4/stdio-safer.m4
index a24e1e430..cb60acb1e 100644
--- a/m4/stdio-safer.m4
+++ b/m4/stdio-safer.m4
@@ -1,4 +1,4 @@
-#serial 4
+#serial 5
dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,7 +8,4 @@ AC_DEFUN([gl_STDIO_SAFER],
[
AC_LIBSOURCES([fopen-safer.c, stdio-safer.h, stdio--.h])
AC_LIBOBJ([fopen-safer])
-
- dnl Prerequisites of lib/fopen-safer.c.
- AC_CHECK_HEADERS_ONCE(unistd.h)
])
diff --git a/m4/strndup.m4 b/m4/strndup.m4
index 579450456..66cedb433 100644
--- a/m4/strndup.m4
+++ b/m4/strndup.m4
@@ -1,4 +1,4 @@
-# strndup.m4 serial 4
+# strndup.m4 serial 5
dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -18,6 +18,4 @@ AC_DEFUN([gl_FUNC_STRNDUP],
])
# Prerequisites of lib/strndup.c.
-AC_DEFUN([gl_PREREQ_STRNDUP], [
- AC_CHECK_DECLS(strnlen)
-])
+AC_DEFUN([gl_PREREQ_STRNDUP], [:])
diff --git a/m4/strnlen.m4 b/m4/strnlen.m4
index e6af315cb..67964c8d7 100644
--- a/m4/strnlen.m4
+++ b/m4/strnlen.m4
@@ -1,11 +1,13 @@
-# strnlen.m4 serial 4
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# strnlen.m4 serial 5
+dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRNLEN],
[
+ AC_LIBSOURCES([strnlen.c, strnlen.h])
+
dnl Persuade glibc <string.h> to declare strnlen().
AC_REQUIRE([AC_GNU_SOURCE])
@@ -22,4 +24,6 @@ AC_DEFUN([gl_FUNC_STRNLEN],
])
# Prerequisites of lib/strnlen.c.
-AC_DEFUN([gl_PREREQ_STRNLEN], [:])
+AC_DEFUN([gl_PREREQ_STRNLEN], [
+ AC_CHECK_DECLS_ONCE(strnlen)
+])
diff --git a/m4/unistd-safer.m4 b/m4/unistd-safer.m4
index c819c92eb..6fbe4c6fb 100644
--- a/m4/unistd-safer.m4
+++ b/m4/unistd-safer.m4
@@ -1,4 +1,4 @@
-#serial 6
+#serial 7
dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,17 +10,4 @@ AC_DEFUN([gl_UNISTD_SAFER],
AC_LIBOBJ([dup-safer])
AC_LIBOBJ([fd-safer])
AC_LIBOBJ([pipe-safer])
-
- gl_PREREQ_DUP_SAFER
- gl_PREREQ_FD_SAFER
-])
-
-# Prerequisites of lib/dup-safer.c.
-AC_DEFUN([gl_PREREQ_DUP_SAFER], [
- AC_CHECK_HEADERS_ONCE(unistd.h)
-])
-
-# Prerequisites of lib/fd-safer.c.
-AC_DEFUN([gl_PREREQ_FD_SAFER], [
- AC_CHECK_HEADERS_ONCE(unistd.h)
])
diff --git a/m4/unlinkdir.m4 b/m4/unlinkdir.m4
index 5e22e5dc5..fd5ee7c9d 100644
--- a/m4/unlinkdir.m4
+++ b/m4/unlinkdir.m4
@@ -1,4 +1,4 @@
-#serial 2
+#serial 3
# Copyright (C) 2005 Free Software Foundation, Inc.
#
@@ -11,7 +11,7 @@
AC_DEFUN([gl_UNLINKDIR],
[
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CHECK_HEADERS_ONCE(priv.h unistd.h)
+ AC_CHECK_HEADERS_ONCE(priv.h)
AC_LIBSOURCES([unlinkdir.c, unlinkdir.h])
AC_LIBOBJ([unlinkdir])
diff --git a/m4/userspec.m4 b/m4/userspec.m4
index 00ec209f5..92a22d605 100644
--- a/m4/userspec.m4
+++ b/m4/userspec.m4
@@ -1,4 +1,4 @@
-#serial 7
+#serial 8
dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,5 +10,5 @@ AC_DEFUN([gl_USERSPEC],
AC_LIBOBJ([userspec])
dnl Prerequisites of lib/userspec.c.
- AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
+ AC_CHECK_HEADERS_ONCE(sys/param.h)
])
diff --git a/m4/xreadlink.m4 b/m4/xreadlink.m4
index 9e32786e1..c59b4a734 100644
--- a/m4/xreadlink.m4
+++ b/m4/xreadlink.m4
@@ -1,4 +1,4 @@
-#serial 6
+#serial 7
dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,5 +11,4 @@ AC_DEFUN([gl_XREADLINK],
dnl Prerequisites of lib/xreadlink.c.
AC_REQUIRE([gt_TYPE_SSIZE_T])
- AC_CHECK_HEADERS_ONCE(unistd.h)
])
diff --git a/m4/xstrtod.m4 b/m4/xstrtod.m4
index 7b2c7b0d6..9307bd391 100644
--- a/m4/xstrtod.m4
+++ b/m4/xstrtod.m4
@@ -1,5 +1,5 @@
#serial 4
-dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.