AC_CHECK_FUNCS(setreuid setregid)
AM_FUNC_GETLINE
- if test $am_cv_func_working_getline != yes; then
- AC_CHECK_FUNCS(getdelim)
- fi
+ gl_GETNDELIM2
AC_FUNC_OBSTACK
AC_FUNC_STRTOD
AC_REQUIRE([AC_TYPE_UID_T])
AC_CHECK_TYPE(ino_t, unsigned long)
+ gt_TYPE_SSIZE_T
+
dnl This relies on the fact that autoconf 2.14a's implementation of
dnl AC_CHECK_TYPE checks includes unistd.h.
- AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(major_t, unsigned int)
AC_CHECK_TYPE(minor_t, unsigned int)
]
)
-#serial 15
+#serial 17
dnl Initially derived from code in GNU grep.
dnl Mostly written by Jim Meyering.
+AC_DEFUN([gl_REGEX],
+[
+ jm_INCLUDED_REGEX([lib/regex.c])
+])
+
dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
dnl
AC_DEFUN([jm_INCLUDED_REGEX],
/* The following example is derived from a problem report
against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
memset (®ex, 0, sizeof (regex));
- s = re_compile_pattern ("[[anรน]]*n", 7, ®ex);
+ s = re_compile_pattern ("[[an\371]]*n", 7, ®ex);
if (s)
exit (1);
dnl Persuade glibc <string.h> to declare mempcpy().
AC_REQUIRE([AC_GNU_SOURCE])
- AC_REQUIRE([ACX_C_RESTRICT])
+ AC_REQUIRE([gl_C_RESTRICT])
AC_REQUIRE([AC_FUNC_ALLOCA])
AC_REQUIRE([AC_HEADER_STDC])
AC_CHECK_HEADERS_ONCE(limits.h string.h wchar.h wctype.h)
AC_CHECK_FUNCS(btowc)
])
-#serial 1001
-dnl based on acx_restrict.m4, from the GNU Autoconf Macro Archive at:
-dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_restrict.html
+#serial 1002
+# This macro can be removed once we can rely on Autoconf 2.57a or later,
+# since we can then use its AC_C_RESTRICT.
+# gl_C_RESTRICT
+# --------------
# Determine whether the C/C++ compiler supports the "restrict" keyword
# introduced in ANSI C99, or an equivalent. Do nothing if the compiler
-# accepts it. Otherwise, if the compiler supports an equivalent (like
-# gcc's __restrict__) define "restrict" to be that. Otherwise, define
-# "restrict" to be empty.
-
-AC_DEFUN([ACX_C_RESTRICT],
-[AC_CACHE_CHECK([for C/C++ restrict keyword], acx_cv_c_restrict,
- [acx_cv_c_restrict=no
- # Try the official restrict keyword, then gcc's __restrict__.
- for acx_kw in restrict __restrict__; do
+# accepts it. Otherwise, if the compiler supports an equivalent,
+# define "restrict" to be that. Here are some variants:
+# - GCC supports both __restrict and __restrict__
+# - older DEC Alpha C compilers support only __restrict
+# - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C
+# Otherwise, define "restrict" to be empty.
+AC_DEFUN([gl_C_RESTRICT],
+[AC_CACHE_CHECK([for C/C++ restrict keyword], gl_cv_c_restrict,
+ [gl_cv_c_restrict=no
+ # Try the official restrict keyword, then gcc's __restrict, and
+ # the less common variants.
+ for ac_kw in restrict __restrict __restrict__ _Restrict; do
AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [float * $acx_kw x;])],
- [acx_cv_c_restrict=$acx_kw; break])
+ [float * $ac_kw x;])],
+ [gl_cv_c_restrict=$ac_kw; break])
done
])
- case $acx_cv_c_restrict in
+ case $gl_cv_c_restrict in
restrict) ;;
no) AC_DEFINE(restrict,,
[Define to equivalent of C99 restrict keyword, or to nothing if this
is not supported. Do not define if restrict is supported directly.]) ;;
- *) AC_DEFINE_UNQUOTED(restrict, $acx_cv_c_restrict) ;;
+ *) AC_DEFINE_UNQUOTED(restrict, $gl_cv_c_restrict) ;;
esac
])
fi
])
-#serial 5
+# getline.m4 serial 9
+
+dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+dnl 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_PREREQ(2.52)
dnl See if there's a working, system-supplied version of the getline function.
dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
dnl have a function by that name in -linet that doesn't have anything
dnl to do with the function we need.
AC_DEFUN([AM_FUNC_GETLINE],
-[dnl
+[
+ dnl Persuade glibc <stdio.h> to declare getline() and getdelim().
+ AC_REQUIRE([AC_GNU_SOURCE])
+
am_getline_needs_run_time_check=no
AC_CHECK_FUNC(getline,
dnl Found it in some library. Verify that it works.
[echo fooN |tr -d '\012'|tr N '\012' > conftest.data
AC_TRY_RUN([
# include <stdio.h>
-# include <sys/types.h>
+# include <stdlib.h>
# include <string.h>
int main ()
{ /* Based on a test program from Karl Heuer. */
fi
if test $am_cv_func_working_getline = no; then
+ dnl We must choose a different name for our function, since on ELF systems
+ dnl a broken getline() in libc.so would override our getline() in
+ dnl libgettextlib.so.
+ AC_DEFINE([getline], [gnu_getline],
+ [Define to a replacement function name for getline().])
AC_LIBOBJ(getline)
+ gl_PREREQ_GETLINE
+ gl_PREREQ_GETNDELIM2
+ fi
+])
+
+# Prerequisites of lib/getline.c.
+AC_DEFUN([gl_PREREQ_GETLINE],
+[
+ AC_CHECK_FUNCS(getdelim)
+])
+
+# getndelim2.m4 serial 1
+dnl Copyright (C) 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_GETNDELIM2],
+[
+ gl_PREREQ_GETNDELIM2
+])
+
+# Prerequisites of lib/getndelim2.h and lib/getndelim2.c.
+AC_DEFUN([gl_PREREQ_GETNDELIM2],
+[
+ dnl Prerequisites of lib/getndelim2.h.
+ AC_REQUIRE([gt_TYPE_SSIZE_T])
+ dnl Prerequisites of lib/getndelim2.c.
+ AC_REQUIRE([AC_HEADER_STDC])
+])
+
+# ssize_t.m4 serial 3 (gettext-0.12.2)
+dnl Copyright (C) 2001-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.
+
+dnl From Bruno Haible.
+dnl Test whether ssize_t is defined.
+
+AC_DEFUN([gt_TYPE_SSIZE_T],
+[
+ AC_CACHE_CHECK([for ssize_t], gt_cv_ssize_t,
+ [AC_TRY_COMPILE([#include <sys/types.h>],
+ [int x = sizeof (ssize_t *) + sizeof (ssize_t);],
+ gt_cv_ssize_t=yes, gt_cv_ssize_t=no)])
+ if test $gt_cv_ssize_t = no; then
+ AC_DEFINE(ssize_t, int,
+ [Define as a signed type of the same size as size_t.])
fi
])
ftw_.h \
full-read.c full-read.h \
full-write.c full-write.h \
- getdelim2.c getdelim2.h \
+ getndelim2.c getndelim2.h \
getline.h \
getpagesize.h \
gettime.c \
dirname.$(OBJEXT) dup-safer.$(OBJEXT) exclude.$(OBJEXT) \
exitfail.$(OBJEXT) filemode.$(OBJEXT) file-type.$(OBJEXT) \
fopen-safer.$(OBJEXT) full-read.$(OBJEXT) full-write.$(OBJEXT) \
- getdelim2.$(OBJEXT) gettime.$(OBJEXT) getugroups.$(OBJEXT) \
+ getndelim2.$(OBJEXT) gettime.$(OBJEXT) getugroups.$(OBJEXT) \
hard-locale.$(OBJEXT) human.$(OBJEXT) idcache.$(OBJEXT) \
isdir.$(OBJEXT) imaxtostr.$(OBJEXT) linebuffer.$(OBJEXT) \
localcharset.$(OBJEXT) long-options.$(OBJEXT) \
@AMDEP_TRUE@ ./$(DEPDIR)/file-type.Po ./$(DEPDIR)/filemode.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/fopen-safer.Po ./$(DEPDIR)/full-read.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/full-write.Po ./$(DEPDIR)/getdate.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/getdelim2.Po ./$(DEPDIR)/getopt.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/getndelim2.Po ./$(DEPDIR)/getopt.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/gettime.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/getugroups.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/hard-locale.Po ./$(DEPDIR)/hash-pjw.Po \
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full-read.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full-write.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdate.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdelim2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getndelim2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettime.Po@am__quote@