summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-09-22 06:44:26 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-09-22 06:44:26 +0000
commiteba2793d1131e5c03d6357d5a727120340836e8f (patch)
tree992c967b6e97d1793e15adfe32bda95b67b9c8f1 /m4
parentda6ced865126d933c839f19ce9dd002b71d1d5a3 (diff)
downloadcoreutils-eba2793d1131e5c03d6357d5a727120340836e8f.tar.xz
Nontrivial sync from gnulib.
Diffstat (limited to 'm4')
-rw-r--r--m4/canon-host.m419
-rw-r--r--m4/getline.m424
-rw-r--r--m4/mbrtowc.m420
-rw-r--r--m4/strcase.m415
-rw-r--r--m4/strstr.m416
5 files changed, 45 insertions, 49 deletions
diff --git a/m4/canon-host.m4 b/m4/canon-host.m4
index 1e1275ab3..b41610471 100644
--- a/m4/canon-host.m4
+++ b/m4/canon-host.m4
@@ -1,4 +1,4 @@
-# canon-host.m4 serial 6
+# canon-host.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,
@@ -6,18 +6,11 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_CANON_HOST],
[
- AC_LIBSOURCES([canon-host.c])
+ AC_LIBSOURCES([canon-host.c, canon-host.h])
AC_LIBOBJ([canon-host])
+ gl_PREREQ_CANON_HOST
+])
- dnl Prerequisites of lib/canon-host.c.
- AC_CHECK_HEADERS_ONCE(unistd.h)
- AC_CHECK_HEADERS(netdb.h sys/socket.h netinet/in.h arpa/inet.h)
-
- dnl Add any libraries as early as possible.
- dnl In particular, inet_ntoa needs -lnsl at least on Solaris 2.5.1,
- dnl so we have to add -lnsl to LIBS before checking for that function.
- AC_SEARCH_LIBS(gethostbyname, [inet nsl])
-
- dnl These come from -lnsl on Solaris 2.5.1.
- AC_CHECK_FUNCS(getaddrinfo gethostbyname gethostbyaddr inet_ntoa)
+AC_DEFUN([gl_PREREQ_CANON_HOST], [
+ AC_REQUIRE([gl_GETADDRINFO])
])
diff --git a/m4/getline.m4 b/m4/getline.m4
index 983f26146..ff255a366 100644
--- a/m4/getline.m4
+++ b/m4/getline.m4
@@ -1,4 +1,4 @@
-# getline.m4 serial 12
+# getline.m4 serial 13
dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software
dnl Foundation, Inc.
@@ -13,19 +13,21 @@ 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],
+AC_DEFUN([gl_FUNC_GETLINE],
[
AC_LIBSOURCES([getline.c, getline.h])
- dnl Persuade glibc <stdio.h> to declare getline() and getdelim().
+ dnl Persuade glibc <stdio.h> to declare getline().
AC_REQUIRE([AC_GNU_SOURCE])
- am_getline_needs_run_time_check=no
+ AC_CHECK_DECLS([getline])
+
+ gl_getline_needs_run_time_check=no
AC_CHECK_FUNC(getline,
dnl Found it in some library. Verify that it works.
- am_getline_needs_run_time_check=yes,
+ gl_getline_needs_run_time_check=yes,
am_cv_func_working_getline=no)
- if test $am_getline_needs_run_time_check = yes; then
+ if test $gl_getline_needs_run_time_check = yes; then
AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
[echo fooN |tr -d '\012'|tr N '\012' > conftest.data
AC_TRY_RUN([
@@ -57,20 +59,12 @@ AC_DEFUN([AM_FUNC_GETLINE],
[Define to a replacement function name for getline().])
AC_LIBOBJ(getline)
- # Avoid multiple inclusions of getndelim2.o into LIBOBJS.
- # This hack won't be needed after gnulib requires Autoconf 2.58 or later.
- case " $LIB@&t@OBJS " in
- *" getndelim2.$ac_objext "* ) ;;
- *) AC_LIBOBJ(getndelim2);;
- esac
-
gl_PREREQ_GETLINE
- gl_PREREQ_GETNDELIM2
fi
])
# Prerequisites of lib/getline.c.
AC_DEFUN([gl_PREREQ_GETLINE],
[
- AC_CHECK_FUNCS(getdelim)
+ gl_FUNC_GETDELIM
])
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index 2eee1a64f..a3bd9114c 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 7
-dnl Copyright (C) 2001-2002, 2004 Free Software Foundation, Inc.
+# mbrtowc.m4 serial 8
+dnl Copyright (C) 2001-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,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,19 +7,25 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert
dnl This file can be removed, and gl_FUNC_MBRTOWC replaced with
-dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
+dnl AC_FUNC_MBRTOWC, when autoconf 2.60 can be assumed everywhere.
AC_DEFUN([gl_FUNC_MBRTOWC],
[
+ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
gl_cv_func_mbrtowc,
- [AC_TRY_LINK(
- [#include <wchar.h>],
- [mbstate_t state; return ! (sizeof state && mbrtowc);],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>]],
+ [[wchar_t wc;
+ char const s[] = "";
+ size_t n = 1;
+ mbstate_t state;
+ return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
gl_cv_func_mbrtowc=yes,
gl_cv_func_mbrtowc=no)])
if test $gl_cv_func_mbrtowc = yes; then
- AC_DEFINE(HAVE_MBRTOWC, 1,
+ AC_DEFINE([HAVE_MBRTOWC], 1,
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
fi
])
diff --git a/m4/strcase.m4 b/m4/strcase.m4
index 40ace46a7..8a8ff3a45 100644
--- a/m4/strcase.m4
+++ b/m4/strcase.m4
@@ -1,5 +1,5 @@
-# strcase.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# strcase.m4 serial 2
+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.
@@ -12,10 +12,11 @@ AC_DEFUN([gl_STRCASE],
AC_DEFUN([gl_FUNC_STRCASECMP],
[
- AC_REPLACE_FUNCS(strcasecmp)
- if test $ac_cv_func_strcasecmp = no; then
- gl_PREREQ_STRCASECMP
- fi
+ dnl No known system has a strcasecmp() function that works correctly in
+ dnl multibyte locales. Therefore we use our version always.
+ AC_LIBOBJ(strcasecmp)
+ AC_DEFINE(strcasecmp, rpl_strcasecmp, [Define to rpl_strcasecmp always.])
+ gl_PREREQ_STRCASECMP
])
AC_DEFUN([gl_FUNC_STRNCASECMP],
@@ -28,7 +29,7 @@ AC_DEFUN([gl_FUNC_STRNCASECMP],
# Prerequisites of lib/strcasecmp.c.
AC_DEFUN([gl_PREREQ_STRCASECMP], [
- :
+ gl_FUNC_MBRTOWC
])
# Prerequisites of lib/strncasecmp.c.
diff --git a/m4/strstr.m4 b/m4/strstr.m4
index 0fe0f73cd..aea809ebd 100644
--- a/m4/strstr.m4
+++ b/m4/strstr.m4
@@ -1,16 +1,18 @@
-# strstr.m4 serial 2
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# strstr.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,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRSTR],
[
- AC_REPLACE_FUNCS(strstr)
- if test $ac_cv_func_strstr = no; then
- gl_PREREQ_STRSTR
- fi
+ dnl No known system has a strstr() function that works correctly in
+ dnl multibyte locales. Therefore we use our version always.
+ AC_LIBOBJ(strstr)
+ gl_PREREQ_STRSTR
])
# Prerequisites of lib/strstr.c.
-AC_DEFUN([gl_PREREQ_STRSTR], [:])
+AC_DEFUN([gl_PREREQ_STRSTR], [
+ gl_FUNC_MBRTOWC
+])