From 22e0b84f86ca7f9e0e426fd23066ec6d6666e716 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 17 Aug 2003 17:58:01 +0000 Subject: New file, from gnulib. --- m4/atexit.m4 | 20 +++++++++ m4/backupfile.m4 | 23 ++++++++++ m4/canon-host.m4 | 22 ++++++++++ m4/clock_time.m4 | 24 ++++++++++ m4/closeout.m4 | 13 ++++++ m4/dirname.m4 | 25 +++++++++++ m4/dup2.m4 | 21 +++++++++ m4/euidaccess.m4 | 26 +++++++++++ m4/exclude.m4 | 16 +++++++ m4/exitfail.m4 | 13 ++++++ m4/file-type.m4 | 13 ++++++ m4/fileblocks.m4 | 21 +++++++++ m4/filemode.m4 | 13 ++++++ m4/getdate.m4 | 23 ++++++++++ m4/gethostname.m4 | 21 +++++++++ m4/getloadavg.m4 | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++ m4/getopt.m4 | 13 ++++++ m4/getpagesize.m4 | 15 +++++++ m4/getpass.m4 | 36 +++++++++++++++ m4/gettextext.m4 | 30 +++++++++++++ m4/getusershell.m4 | 23 ++++++++++ m4/hard-locale.m4 | 14 ++++++ m4/hash.m4 | 15 +++++++ m4/malloc.m4 | 25 +++++++++++ m4/memchr.m4 | 21 +++++++++ m4/memcpy.m4 | 20 +++++++++ m4/memmove.m4 | 20 +++++++++ m4/memrchr.m4 | 23 ++++++++++ m4/memset.m4 | 20 +++++++++ m4/modechange.m4 | 13 ++++++ m4/mountlist.m4 | 27 ++++++++++++ m4/obstack.m4 | 24 ++++++++++ m4/path-concat.m4 | 17 ++++++++ m4/pathmax.m4 | 13 ++++++ m4/physmem.m4 | 39 +++++++++++++++++ m4/posixtm.m4 | 14 ++++++ m4/posixver.m4 | 13 ++++++ m4/quote.m4 | 13 ++++++ m4/quotearg.m4 | 16 +++++++ m4/readlink.m4 | 22 ++++++++++ m4/readutmp.m4 | 63 +++++++++++++++++++++++++++ m4/realloc.m4 | 25 +++++++++++ m4/rmdir.m4 | 22 ++++++++++ m4/rpmatch.m4 | 22 ++++++++++ m4/safe-read.m4 | 19 ++++++++ m4/safe-write.m4 | 18 ++++++++ m4/same.m4 | 14 ++++++ m4/save-cwd.m4 | 15 +++++++ m4/savedir.m4 | 15 +++++++ m4/settime.m4 | 14 ++++++ m4/sha.m4 | 14 ++++++ m4/sig2str.m4 | 21 +++++++++ m4/stdio-safer.m4 | 13 ++++++ m4/stpcpy.m4 | 24 ++++++++++ m4/strcase.m4 | 39 +++++++++++++++++ m4/strcspn.m4 | 20 +++++++++ m4/strdup.m4 | 22 ++++++++++ m4/strndup.m4 | 25 +++++++++++ m4/strnlen.m4 | 32 ++++++++++++++ m4/strpbrk.m4 | 20 +++++++++ m4/strstr.m4 | 20 +++++++++ m4/strtod.m4 | 25 +++++++++++ m4/strtoimax.m4 | 39 +++++++++++++++++ m4/strtol.m4 | 22 ++++++++++ m4/strtoll.m4 | 26 +++++++++++ m4/strtoul.m4 | 20 +++++++++ m4/strtoull.m4 | 26 +++++++++++ m4/strtoumax.m4 | 39 +++++++++++++++++ m4/strverscmp.m4 | 24 ++++++++++ m4/ulonglong.m4 | 25 +++++++++++ m4/unicodeio.m4 | 13 ++++++ m4/unistd-safer.m4 | 17 ++++++++ m4/userspec.m4 | 15 +++++++ m4/xalloc.m4 | 26 +++++++++++ m4/xgetcwd.m4 | 15 +++++++ m4/xreadlink.m4 | 14 ++++++ m4/xstrtod.m4 | 13 ++++++ m4/xstrtol.m4 | 37 ++++++++++++++++ m4/yesno.m4 | 13 ++++++ 79 files changed, 1791 insertions(+) create mode 100644 m4/atexit.m4 create mode 100644 m4/backupfile.m4 create mode 100644 m4/canon-host.m4 create mode 100644 m4/clock_time.m4 create mode 100644 m4/closeout.m4 create mode 100644 m4/dirname.m4 create mode 100644 m4/dup2.m4 create mode 100644 m4/euidaccess.m4 create mode 100644 m4/exclude.m4 create mode 100644 m4/exitfail.m4 create mode 100644 m4/file-type.m4 create mode 100644 m4/fileblocks.m4 create mode 100644 m4/filemode.m4 create mode 100644 m4/getdate.m4 create mode 100644 m4/gethostname.m4 create mode 100644 m4/getloadavg.m4 create mode 100644 m4/getopt.m4 create mode 100644 m4/getpagesize.m4 create mode 100644 m4/getpass.m4 create mode 100644 m4/gettextext.m4 create mode 100644 m4/getusershell.m4 create mode 100644 m4/hard-locale.m4 create mode 100644 m4/hash.m4 create mode 100644 m4/malloc.m4 create mode 100644 m4/memchr.m4 create mode 100644 m4/memcpy.m4 create mode 100644 m4/memmove.m4 create mode 100644 m4/memrchr.m4 create mode 100644 m4/memset.m4 create mode 100644 m4/modechange.m4 create mode 100644 m4/mountlist.m4 create mode 100644 m4/obstack.m4 create mode 100644 m4/path-concat.m4 create mode 100644 m4/pathmax.m4 create mode 100644 m4/physmem.m4 create mode 100644 m4/posixtm.m4 create mode 100644 m4/posixver.m4 create mode 100644 m4/quote.m4 create mode 100644 m4/quotearg.m4 create mode 100644 m4/readlink.m4 create mode 100644 m4/readutmp.m4 create mode 100644 m4/realloc.m4 create mode 100644 m4/rmdir.m4 create mode 100644 m4/rpmatch.m4 create mode 100644 m4/safe-read.m4 create mode 100644 m4/safe-write.m4 create mode 100644 m4/same.m4 create mode 100644 m4/save-cwd.m4 create mode 100644 m4/savedir.m4 create mode 100644 m4/settime.m4 create mode 100644 m4/sha.m4 create mode 100644 m4/sig2str.m4 create mode 100644 m4/stdio-safer.m4 create mode 100644 m4/stpcpy.m4 create mode 100644 m4/strcase.m4 create mode 100644 m4/strcspn.m4 create mode 100644 m4/strdup.m4 create mode 100644 m4/strndup.m4 create mode 100644 m4/strnlen.m4 create mode 100644 m4/strpbrk.m4 create mode 100644 m4/strstr.m4 create mode 100644 m4/strtod.m4 create mode 100644 m4/strtoimax.m4 create mode 100644 m4/strtol.m4 create mode 100644 m4/strtoll.m4 create mode 100644 m4/strtoul.m4 create mode 100644 m4/strtoull.m4 create mode 100644 m4/strtoumax.m4 create mode 100644 m4/strverscmp.m4 create mode 100644 m4/ulonglong.m4 create mode 100644 m4/unicodeio.m4 create mode 100644 m4/unistd-safer.m4 create mode 100644 m4/userspec.m4 create mode 100644 m4/xalloc.m4 create mode 100644 m4/xgetcwd.m4 create mode 100644 m4/xreadlink.m4 create mode 100644 m4/xstrtod.m4 create mode 100644 m4/xstrtol.m4 create mode 100644 m4/yesno.m4 diff --git a/m4/atexit.m4 b/m4/atexit.m4 new file mode 100644 index 000000000..dddc40e68 --- /dev/null +++ b/m4/atexit.m4 @@ -0,0 +1,20 @@ +# atexit.m4 serial 1 +dnl Copyright (C) 2002 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_ATEXIT], +[ + AC_REPLACE_FUNCS(atexit) + if test $ac_cv_func_atexit = no; then + gl_PREREQ_ATEXIT + fi +]) + +# Prerequisites of lib/atexit.c. +AC_DEFUN([gl_PREREQ_ATEXIT], [ + : +]) diff --git a/m4/backupfile.m4 b/m4/backupfile.m4 new file mode 100644 index 000000000..1326bb2ab --- /dev/null +++ b/m4/backupfile.m4 @@ -0,0 +1,23 @@ +# backupfile.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_BACKUPFILE], +[ + dnl Prerequisites of lib/backupfile.c. + AC_REQUIRE([AC_HEADER_DIRENT]) + AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID]) + AC_CHECK_HEADERS_ONCE(stdlib.h string.h) + AC_CHECK_DECLS_ONCE(getenv malloc) + jm_CHECK_TYPE_STRUCT_DIRENT_D_INO + + dnl Prerequisites of lib/addext.c. + AC_REQUIRE([jm_AC_DOS]) + AC_SYS_LONG_FILE_NAMES + AC_CHECK_HEADERS_ONCE(string.h unistd.h) + AC_CHECK_FUNCS(pathconf) +]) diff --git a/m4/canon-host.m4 b/m4/canon-host.m4 new file mode 100644 index 000000000..61f66a51f --- /dev/null +++ b/m4/canon-host.m4 @@ -0,0 +1,22 @@ +# canon-host.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_CANON_HOST], +[ + dnl Prerequisites of lib/canon-host.c. + AC_CHECK_HEADERS_ONCE(stdlib.h string.h 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(gethostbyname gethostbyaddr inet_ntoa) +]) diff --git a/m4/clock_time.m4 b/m4/clock_time.m4 new file mode 100644 index 000000000..e7e4e29ac --- /dev/null +++ b/m4/clock_time.m4 @@ -0,0 +1,24 @@ +# clock_time.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. + +# Check for clock_gettime and clock_settime, and sets LIB_CLOCK_GETTIME. +AC_DEFUN([gl_CLOCK_TIME], +[ + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. + # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. + + # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* + # programs in the package would end up linked with that potentially-shared + # library, inducing unnecessary run-time overhead. + fetish_saved_libs=$LIBS + AC_SEARCH_LIBS(clock_gettime, [rt posix4], + [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) + AC_SUBST(LIB_CLOCK_GETTIME) + AC_CHECK_FUNCS(clock_gettime clock_settime) + LIBS=$fetish_saved_libs +]) diff --git a/m4/closeout.m4 b/m4/closeout.m4 new file mode 100644 index 000000000..a06fd6da2 --- /dev/null +++ b/m4/closeout.m4 @@ -0,0 +1,13 @@ +# closeout.m4 serial 1 +dnl Copyright (C) 2002 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_CLOSEOUT], +[ + dnl Prerequisites of lib/closeout.c. + AC_CHECK_HEADERS_ONCE(stdlib.h) +]) diff --git a/m4/dirname.m4 b/m4/dirname.m4 new file mode 100644 index 000000000..8b04bcabd --- /dev/null +++ b/m4/dirname.m4 @@ -0,0 +1,25 @@ +# dirname.m4 serial 1 +dnl Copyright (C) 2002 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_DIRNAME], +[ + dnl Prerequisites of lib/dirname.h. + AC_REQUIRE([jm_AC_DOS]) + + dnl Prerequisites of lib/dirname.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) + + dnl Prerequisites of lib/basename.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) + + dnl Prerequisites of lib/stripslash.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/dup2.m4 b/m4/dup2.m4 new file mode 100644 index 000000000..727366946 --- /dev/null +++ b/m4/dup2.m4 @@ -0,0 +1,21 @@ +# dup2.m4 serial 1 +dnl Copyright (C) 2002 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_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(fcntl.h unistd.h) +]) + diff --git a/m4/euidaccess.m4 b/m4/euidaccess.m4 new file mode 100644 index 000000000..18ce475b1 --- /dev/null +++ b/m4/euidaccess.m4 @@ -0,0 +1,26 @@ +# euidaccess.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_EUIDACCESS], +[ + dnl Persuade glibc to declare euidaccess(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_CHECK_DECLS([euidaccess]) + AC_REPLACE_FUNCS(euidaccess) + if test $ac_cv_func_euidaccess = no; then + gl_PREREQ_EUIDACCESS + fi +]) + +# Prerequisites of lib/euidaccess.c. +AC_DEFUN([gl_PREREQ_EUIDACCESS], [ + AC_CHECK_HEADERS_ONCE(unistd.h) + AC_REQUIRE([AC_FUNC_GETGROUPS]) +]) + diff --git a/m4/exclude.m4 b/m4/exclude.m4 new file mode 100644 index 000000000..88d2874fa --- /dev/null +++ b/m4/exclude.m4 @@ -0,0 +1,16 @@ +# exclude.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_EXCLUDE], +[ + dnl Prerequisites of lib/exclude.c. + AC_REQUIRE([AC_C_INLINE]) + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(stdlib.h string.h strings.h) + AC_CHECK_FUNCS_ONCE(isascii) +]) diff --git a/m4/exitfail.m4 b/m4/exitfail.m4 new file mode 100644 index 000000000..3551c4167 --- /dev/null +++ b/m4/exitfail.m4 @@ -0,0 +1,13 @@ +# exitfail.m4 serial 1 +dnl Copyright (C) 2002 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_EXITFAIL], +[ + dnl Prerequisites of lib/exitfail.c. + AC_CHECK_HEADERS_ONCE(stdlib.h) +]) diff --git a/m4/file-type.m4 b/m4/file-type.m4 new file mode 100644 index 000000000..34a94408c --- /dev/null +++ b/m4/file-type.m4 @@ -0,0 +1,13 @@ +# file-type.m4 serial 1 +dnl Copyright (C) 2002 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_FILE_TYPE], +[ + dnl Prerequisites of lib/file-type.h. + AC_REQUIRE([AC_HEADER_STAT]) +]) diff --git a/m4/fileblocks.m4 b/m4/fileblocks.m4 new file mode 100644 index 000000000..07e2b70eb --- /dev/null +++ b/m4/fileblocks.m4 @@ -0,0 +1,21 @@ +# fileblocks.m4 serial 1 +dnl Copyright (C) 2002 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_FILEBLOCKS], +[ + AC_STRUCT_ST_BLOCKS + dnl Note: AC_STRUCT_ST_BLOCKS does AC_LIBOBJ(fileblocks). + if test $ac_cv_member_struct_stat_st_blocks = no; then + gl_PREREQ_FILEBLOCKS + fi +]) + +# Prerequisites of lib/fileblocks.c. +AC_DEFUN([gl_PREREQ_FILEBLOCKS], [ + AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h) +]) diff --git a/m4/filemode.m4 b/m4/filemode.m4 new file mode 100644 index 000000000..cc08698aa --- /dev/null +++ b/m4/filemode.m4 @@ -0,0 +1,13 @@ +# filemode.m4 serial 1 +dnl Copyright (C) 2002 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_FILEMODE], +[ + dnl Prerequisites of lib/filemode.c. + AC_REQUIRE([AC_HEADER_STAT]) +]) diff --git a/m4/getdate.m4 b/m4/getdate.m4 new file mode 100644 index 000000000..e3c517b39 --- /dev/null +++ b/m4/getdate.m4 @@ -0,0 +1,23 @@ +# getdate.m4 serial 1 +dnl Copyright (C) 2002 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_GETDATE], +[ + dnl Prerequisites of lib/getdate.h. + AC_HEADER_TIME + AC_CHECK_HEADERS_ONCE(sys/time.h) + + dnl Prerequisites of lib/getdate.y. + AC_REQUIRE([jm_BISON]) + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(stdlib.h string.h) + AC_CHECK_FUNCS_ONCE(isascii) + AC_STRUCT_TIMEZONE + AC_REQUIRE([gl_TM_GMTOFF]) +]) diff --git a/m4/gethostname.m4 b/m4/gethostname.m4 new file mode 100644 index 000000000..f9da4b197 --- /dev/null +++ b/m4/gethostname.m4 @@ -0,0 +1,21 @@ +# gethostname.m4 serial 1 +dnl Copyright (C) 2002 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_GETHOSTNAME], +[ + AC_REPLACE_FUNCS(gethostname) + if test $ac_cv_func_gethostname = no; then + gl_PREREQ_GETHOSTNAME + fi +]) + +# Prerequisites of lib/gethostname.c. +AC_DEFUN([gl_PREREQ_GETHOSTNAME], [ + AC_CHECK_FUNCS(uname) +]) + diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 new file mode 100644 index 000000000..08ec0149b --- /dev/null +++ b/m4/getloadavg.m4 @@ -0,0 +1,125 @@ +#serial 10 + +# A replacement for autoconf's macro by the same name. This version +# accepts an optional argument specifying the name of the $srcdir-relative +# directory in which the file getloadavg.c may be found. It is unusual +# (but justified, imho) that this file is required at ./configure time. + +undefine([AC_FUNC_GETLOADAVG]) + +# AC_FUNC_GETLOADAVG +# ------------------ +AC_DEFUN([AC_FUNC_GETLOADAVG], +[ac_have_func=no # yes means we've found a way to get the load average. + +AC_CHECK_HEADERS_ONCE(fcntl.h locale.h unistd.h) +AC_CHECK_HEADERS(mach/mach.h) +AC_CHECK_FUNCS(setlocale) + +# By default, expect to find getloadavg.c in $srcdir/. +ac_lib_dir_getloadavg=$srcdir +# But if there's an argument, DIR, expect to find getloadavg.c in $srcdir/DIR. +m4_ifval([$1], [ac_lib_dir_getloadavg=$srcdir/$1]) +# Make sure getloadavg.c is where it belongs, at ./configure-time. +test -f $ac_lib_dir_getloadavg/getloadavg.c \ + || AC_MSG_ERROR([getloadavg.c is not in $ac_lib_dir_getloadavg]) +# FIXME: Add an autoconf-time test, too? + +ac_save_LIBS=$LIBS + +# Check for getloadavg, but be sure not to touch the cache variable. +(AC_CHECK_FUNC(getloadavg, exit 0, exit 1)) && ac_have_func=yes + +# On HPUX9, an unprivileged user can get load averages through this function. +AC_CHECK_FUNCS(pstat_getdynamic) + +# Solaris has libkstat which does not require root. +AC_CHECK_LIB(kstat, kstat_open) +test $ac_cv_lib_kstat_kstat_open = yes && ac_have_func=yes + +# Some systems with -lutil have (and need) -lkvm as well, some do not. +# On Solaris, -lkvm requires nlist from -lelf, so check that first +# to get the right answer into the cache. +# For kstat on solaris, we need libelf to force the definition of SVR4 below. +if test $ac_have_func = no; then + AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS") +fi +if test $ac_have_func = no; then + AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS") + # Check for the 4.4BSD definition of getloadavg. + AC_CHECK_LIB(util, getloadavg, + [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes]) +fi + +if test $ac_have_func = no; then + # There is a commonly available library for RS/6000 AIX. + # Since it is not a standard part of AIX, it might be installed locally. + ac_getloadavg_LIBS=$LIBS + LIBS="-L/usr/local/lib $LIBS" + AC_CHECK_LIB(getloadavg, getloadavg, + [LIBS="-lgetloadavg $LIBS"], [LIBS=$ac_getloadavg_LIBS]) +fi + +# Make sure it is really in the library, if we think we found it, +# otherwise set up the replacement function. +AC_CHECK_FUNCS(getloadavg, [], + [_AC_LIBOBJ_GETLOADAVG]) + +# Some definitions of getloadavg require that the program be installed setgid. +AC_CACHE_CHECK(whether getloadavg requires setgid, + ac_cv_func_getloadavg_setgid, +[AC_EGREP_CPP([Yowza Am I SETGID yet], +[#include "$ac_lib_dir_getloadavg/getloadavg.c" +#ifdef LDAV_PRIVILEGED +Yowza Am I SETGID yet +@%:@endif], + ac_cv_func_getloadavg_setgid=yes, + ac_cv_func_getloadavg_setgid=no)]) +if test $ac_cv_func_getloadavg_setgid = yes; then + NEED_SETGID=true + AC_DEFINE(GETLOADAVG_PRIVILEGED, 1, + [Define if the `getloadavg' function needs to be run setuid + or setgid.]) +else + NEED_SETGID=false +fi +AC_SUBST(NEED_SETGID)dnl + +if test $ac_cv_func_getloadavg_setgid = yes; then + AC_CACHE_CHECK(group of /dev/kmem, ac_cv_group_kmem, +[ # On Solaris, /dev/kmem is a symlink. Get info on the real file. + ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null` + # If we got an error (system does not support symlinks), try without -L. + test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem` + ac_cv_group_kmem=`echo $ac_ls_output \ + | sed -ne ['s/[ ][ ]*/ /g; + s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/; + / /s/.* //;p;']` +]) + AC_SUBST(KMEM_GROUP, $ac_cv_group_kmem)dnl +fi +if test "x$ac_save_LIBS" = x; then + GETLOADAVG_LIBS=$LIBS +else + GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$ac_save_LIBS!!"` +fi +LIBS=$ac_save_LIBS + +AC_SUBST(GETLOADAVG_LIBS)dnl +])# AC_FUNC_GETLOADAVG + + +AC_DEFUN([gl_FUNC_GETLOADAVG], +[ + AC_FUNC_GETLOADAVG([lib]) + dnl Note AC_FUNC_GETLOADAVG does AC_LIBOBJ(getloadavg). + if test $ac_cv_func_getloadavg = no; then + gl_PREREQ_GETLOADAVG + fi +]) + +# Prerequisites of lib/getloadavg.c not done by autoconf's AC_FUNC_GETLOADAVG. +AC_DEFUN([gl_PREREQ_GETLOADAVG], +[ + AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h) +]) diff --git a/m4/getopt.m4 b/m4/getopt.m4 new file mode 100644 index 000000000..558558de4 --- /dev/null +++ b/m4/getopt.m4 @@ -0,0 +1,13 @@ +# getopt.m4 serial 1 +dnl Copyright (C) 2002 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_GETOPT], +[ + dnl Prerequisites of lib/getopt.c. + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/getpagesize.m4 b/m4/getpagesize.m4 new file mode 100644 index 000000000..f1f4c42d4 --- /dev/null +++ b/m4/getpagesize.m4 @@ -0,0 +1,15 @@ +# getpagesize.m4 serial 1 +dnl Copyright (C) 2002 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_GETPAGESIZE], +[ + dnl Prerequisites of lib/getpagesize.h. + AC_CHECK_HEADERS_ONCE(unistd.h) + AC_CHECK_HEADERS(OS.h) + AC_CHECK_FUNCS(getpagesize) +]) diff --git a/m4/getpass.m4 b/m4/getpass.m4 new file mode 100644 index 000000000..0a7b81742 --- /dev/null +++ b/m4/getpass.m4 @@ -0,0 +1,36 @@ +# getpass.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. + +# Provide a getpass() function if the system doesn't have it. +AC_DEFUN([gl_FUNC_GETPASS], +[ + AC_REPLACE_FUNCS(getpass) + if test $ac_cv_func_getpass = no; then + gl_PREREQ_GETPASS + fi +]) + +# Provide the GNU getpass() implementation. It supports passwords of +# arbitrary length (not just 8 bytes as on HP-UX). +AC_DEFUN([gl_FUNC_GETPASS_GNU], +[ + dnl TODO: Detect when GNU getpass() is already found in glibc. + AC_LIBOBJ(getpass) + gl_PREREQ_GETPASS + dnl We must choose a different name for our function, since on ELF systems + dnl an unusable getpass() in libc.so would override our getpass() if it is + dnl compiled into a shared library. + AC_DEFINE([getpass], [gnu_getpass], + [Define to a replacement function name for getpass().]) +]) + +# Prerequisites of lib/getpass.c. +AC_DEFUN([gl_PREREQ_GETPASS], [ + : +]) + diff --git a/m4/gettextext.m4 b/m4/gettextext.m4 new file mode 100644 index 000000000..9f08fcd64 --- /dev/null +++ b/m4/gettextext.m4 @@ -0,0 +1,30 @@ +# Assume AM_GNU_GETTEXT([external]) and Autoconf 2.54 or later, for coreutils. + +# 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. + +dnl From Paul Eggert + +dnl Automake doesn't understand that AM_GNU_GETTEXT([external]) +dnl never invokes the following macros, because of the [external]. +dnl Insert empty macros to pacify Automake. + +AC_DEFUN([AM_LC_MESSAGES]) +AC_DEFUN([AM_MKINSTALLDIRS]) +AC_DEFUN([AM_NLS]) +AC_DEFUN([AM_PO_SUBDIRS]) +AC_DEFUN([gt_INTDIV0]) + +dnl A simpler substitute for gt_INTTYPES_PRI that assumes Autoconf 2.54 +dnl or later. + +AC_DEFUN([gt_HEADER_INTTYPES_H], [ + AC_REQUIRE([AC_HEADER_STDC]) + gt_cv_header_inttypes_h=$ac_cv_header_inttypes_h +]) diff --git a/m4/getusershell.m4 b/m4/getusershell.m4 new file mode 100644 index 000000000..642124bd4 --- /dev/null +++ b/m4/getusershell.m4 @@ -0,0 +1,23 @@ +# getusershell.m4 serial 1 +dnl Copyright (C) 2002 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_GETUSERSHELL], +[ + AC_REPLACE_FUNCS(getusershell) + if test $ac_cv_func_getusershell = no; then + gl_PREREQ_GETUSERSHELL + fi +]) + +# Prerequisites of lib/getusershell.c. +AC_DEFUN([gl_PREREQ_GETUSERSHELL], [ + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(stdlib.h) + AC_CHECK_FUNCS_ONCE(isascii) +]) + diff --git a/m4/hard-locale.m4 b/m4/hard-locale.m4 new file mode 100644 index 000000000..79f24d28d --- /dev/null +++ b/m4/hard-locale.m4 @@ -0,0 +1,14 @@ +# hard-locale.m4 serial 1 +dnl Copyright (C) 2002 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_HARD_LOCALE], +[ + dnl Prerequisites of lib/hard-locale.c. + AC_CHECK_HEADERS_ONCE(locale.h stdlib.h string.h) + AC_CHECK_FUNCS_ONCE(setlocale) +]) diff --git a/m4/hash.m4 b/m4/hash.m4 new file mode 100644 index 000000000..ab48a1d23 --- /dev/null +++ b/m4/hash.m4 @@ -0,0 +1,15 @@ +# hash.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_HASH], +[ + dnl Prerequisites of lib/hash.c. + AC_REQUIRE([AM_STDBOOL_H]) + AC_CHECK_HEADERS_ONCE(stdlib.h) + AC_CHECK_DECLS_ONCE(free malloc) +]) diff --git a/m4/malloc.m4 b/m4/malloc.m4 new file mode 100644 index 000000000..2452acf0b --- /dev/null +++ b/m4/malloc.m4 @@ -0,0 +1,25 @@ +# malloc.m4 serial 7 +dnl Copyright (C) 2002 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 Jim Meyering. +dnl Determine whether malloc accepts 0 as its argument. +dnl If it doesn't, arrange to use the replacement function. + +AC_DEFUN([jm_FUNC_MALLOC], +[ + AC_REQUIRE([AC_FUNC_MALLOC]) + dnl autoconf < 2.57 used the symbol ac_cv_func_malloc_works. + if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then + gl_PREREQ_MALLOC + fi +]) + +# Prerequisites of lib/malloc.c. +AC_DEFUN([gl_PREREQ_MALLOC], [ + : +]) diff --git a/m4/memchr.m4 b/m4/memchr.m4 new file mode 100644 index 000000000..7b6cfc43d --- /dev/null +++ b/m4/memchr.m4 @@ -0,0 +1,21 @@ +# memchr.m4 serial 1 +dnl Copyright (C) 2002 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_MEMCHR], +[ + AC_REPLACE_FUNCS(memchr) + if test $ac_cv_func_memchr = no; then + jm_PREREQ_MEMCHR + fi +]) + +# Prerequisites of lib/memchr.c. +AC_DEFUN([jm_PREREQ_MEMCHR], [ + AC_CHECK_HEADERS_ONCE(limits.h stdlib.h) + AC_CHECK_HEADERS(bp-sym.h) +]) diff --git a/m4/memcpy.m4 b/m4/memcpy.m4 new file mode 100644 index 000000000..db94905fa --- /dev/null +++ b/m4/memcpy.m4 @@ -0,0 +1,20 @@ +# memcpy.m4 serial 1 +dnl Copyright (C) 2002 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_MEMCPY], +[ + AC_REPLACE_FUNCS(memcpy) + if test $ac_cv_func_memcpy = no; then + gl_PREREQ_MEMCPY + fi +]) + +# Prerequisites of lib/memcpy.c. +AC_DEFUN([gl_PREREQ_MEMCPY], [ + : +]) diff --git a/m4/memmove.m4 b/m4/memmove.m4 new file mode 100644 index 000000000..6f9530aa9 --- /dev/null +++ b/m4/memmove.m4 @@ -0,0 +1,20 @@ +# memmove.m4 serial 1 +dnl Copyright (C) 2002 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_MEMMOVE], +[ + AC_REPLACE_FUNCS(memmove) + if test $ac_cv_func_memmove = no; then + gl_PREREQ_MEMMOVE + fi +]) + +# Prerequisites of lib/memmove.c. +AC_DEFUN([gl_PREREQ_MEMMOVE], [ + : +]) diff --git a/m4/memrchr.m4 b/m4/memrchr.m4 new file mode 100644 index 000000000..c489ec3d3 --- /dev/null +++ b/m4/memrchr.m4 @@ -0,0 +1,23 @@ +# memrchr.m4 serial 1 +dnl Copyright (C) 2002 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_MEMRCHR], +[ + dnl Persuade glibc to declare memrchr(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REPLACE_FUNCS(memrchr) + if test $ac_cv_func_memrchr = no; then + gl_PREREQ_MEMRCHR + fi +]) + +# Prerequisites of lib/memrchr.c. +AC_DEFUN([gl_PREREQ_MEMRCHR], [ + AC_CHECK_HEADERS_ONCE(limits.h) +]) diff --git a/m4/memset.m4 b/m4/memset.m4 new file mode 100644 index 000000000..138eada07 --- /dev/null +++ b/m4/memset.m4 @@ -0,0 +1,20 @@ +# memset.m4 serial 1 +dnl Copyright (C) 2002 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_MEMSET], +[ + AC_REPLACE_FUNCS(memset) + if test $ac_cv_func_memset = no; then + gl_PREREQ_MEMSET + fi +]) + +# Prerequisites of lib/memset.c. +AC_DEFUN([gl_PREREQ_MEMSET], [ + : +]) diff --git a/m4/modechange.m4 b/m4/modechange.m4 new file mode 100644 index 000000000..d5403e91d --- /dev/null +++ b/m4/modechange.m4 @@ -0,0 +1,13 @@ +# modechange.m4 serial 1 +dnl Copyright (C) 2002 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_MODECHANGE], +[ + AC_REQUIRE([AC_HEADER_STDC]) + AC_REQUIRE([AC_HEADER_STAT]) +]) diff --git a/m4/mountlist.m4 b/m4/mountlist.m4 new file mode 100644 index 000000000..c2af19a91 --- /dev/null +++ b/m4/mountlist.m4 @@ -0,0 +1,27 @@ +# mountlist.m4 serial 1 +dnl Copyright (C) 2002 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_MOUNTLIST], +[ + jm_LIST_MOUNTED_FILESYSTEMS([gl_cv_list_mounted_fs=yes], + [gl_cv_list_mounted_fs=no]) + if test $gl_cv_list_mounted_fs = yes; then + AC_LIBOBJ(mountlist) + gl_PREREQ_MOUNTLIST_EXTRA + fi +]) + +# Prerequisites of lib/mountlist.c not done by jm_LIST_MOUNTED_FILESYSTEMS. +AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA], +[ + AC_REQUIRE([AC_HEADER_STDC]) + dnl Note jm_LIST_MOUNTED_FILESYSTEMS checks for mntent.h, not sys/mntent.h. + AC_CHECK_HEADERS_ONCE(fcntl.h string.h unistd.h) + AC_CHECK_HEADERS(sys/mntent.h) + jm_FSTYPENAME +]) diff --git a/m4/obstack.m4 b/m4/obstack.m4 new file mode 100644 index 000000000..cd962729e --- /dev/null +++ b/m4/obstack.m4 @@ -0,0 +1,24 @@ +# obstack.m4 serial 1 +dnl Copyright (C) 2002 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_OBSTACK], +[ + dnl Prerequisites of lib/obstack.h. + AC_CHECK_HEADERS_ONCE(stddef.h string.h) + + AC_FUNC_OBSTACK + dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]). + if test $ac_cv_func_obstack = no; then + gl_PREREQ_OBSTACK + fi +]) + +# Prerequisites of lib/obstack.c. +AC_DEFUN([gl_PREREQ_OBSTACK], [ + AC_CHECK_HEADERS_ONCE(stdlib.h) +]) diff --git a/m4/path-concat.m4 b/m4/path-concat.m4 new file mode 100644 index 000000000..975774752 --- /dev/null +++ b/m4/path-concat.m4 @@ -0,0 +1,17 @@ +# path-concat.m4 serial 1 +dnl Copyright (C) 2002 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_PATH_CONCAT], +[ + dnl Prerequisites of lib/path-concat.c. + AC_REQUIRE([jm_AC_DOS]) + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(memory.h stdlib.h string.h strings.h unistd.h) + AC_CHECK_FUNCS_ONCE(mempcpy) + AC_CHECK_DECLS_ONCE(malloc) +]) diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 new file mode 100644 index 000000000..95ab044d8 --- /dev/null +++ b/m4/pathmax.m4 @@ -0,0 +1,13 @@ +# pathmax.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_PATHMAX], +[ + dnl Prerequisites of lib/pathmax.h. + AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h) +]) diff --git a/m4/physmem.m4 b/m4/physmem.m4 new file mode 100644 index 000000000..824db10fa --- /dev/null +++ b/m4/physmem.m4 @@ -0,0 +1,39 @@ +# physmem.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. + +# Check for the external symbol, _system_configuration, +# a struct with member `physmem'. +AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION], + [AC_CACHE_CHECK(for external symbol _system_configuration, + gl_cv_var__system_configuration, + [AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[#include + ]], + [double x = _system_configuration.physmem;])], + [gl_cv_var__system_configuration=yes], + [gl_cv_var__system_configuration=no])]) + + if test $gl_cv_var__system_configuration = yes; then + AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, + [Define to 1 if you have the external variable, + _system_configuration with a member named physmem.]) + fi + ] +) + +AC_DEFUN([gl_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]) + + AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table) + AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION]) +]) diff --git a/m4/posixtm.m4 b/m4/posixtm.m4 new file mode 100644 index 000000000..45635bc41 --- /dev/null +++ b/m4/posixtm.m4 @@ -0,0 +1,14 @@ +# posixtm.m4 serial 1 +dnl Copyright (C) 2002 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_POSIXTM], +[ + dnl Prerequisites of lib/posixtm.c. + AC_STRUCT_TM + AC_CHECK_HEADERS_ONCE(stdlib.h string.h) +]) diff --git a/m4/posixver.m4 b/m4/posixver.m4 new file mode 100644 index 000000000..17eb7c14b --- /dev/null +++ b/m4/posixver.m4 @@ -0,0 +1,13 @@ +# posixver.m4 serial 1 +dnl Copyright (C) 2002 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_POSIXVER], +[ + AC_CHECK_HEADERS_ONCE(unistd.h) + AC_CHECK_DECLS_ONCE(getenv) +]) diff --git a/m4/quote.m4 b/m4/quote.m4 new file mode 100644 index 000000000..14ce1b619 --- /dev/null +++ b/m4/quote.m4 @@ -0,0 +1,13 @@ +# quote.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_QUOTE], +[ + dnl Prerequisites of lib/quote.c. + dnl (none) +]) diff --git a/m4/quotearg.m4 b/m4/quotearg.m4 new file mode 100644 index 000000000..2fba109f1 --- /dev/null +++ b/m4/quotearg.m4 @@ -0,0 +1,16 @@ +# quotearg.m4 serial 1 +dnl Copyright (C) 2002 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_QUOTEARG], +[ + dnl Prerequisites of lib/quotearg.c. + AC_CHECK_HEADERS_ONCE(wchar.h wctype.h) + AC_CHECK_FUNCS_ONCE(iswprint mbsinit) + AC_TYPE_MBSTATE_T + jm_FUNC_MBRTOWC +]) diff --git a/m4/readlink.m4 b/m4/readlink.m4 new file mode 100644 index 000000000..ec53e14db --- /dev/null +++ b/m4/readlink.m4 @@ -0,0 +1,22 @@ +# readlink.m4 serial 2 +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_FUNC_READLINK], +[ + AC_CHECK_FUNCS(readlink) + if test $ac_cv_func_readlink = no; then + AC_LIBOBJ(readlink) + gl_PREREQ_READLINK + fi +]) + +# Prerequisites of lib/readlink.c. +AC_DEFUN([gl_PREREQ_READLINK], +[ + : +]) diff --git a/m4/readutmp.m4 b/m4/readutmp.m4 new file mode 100644 index 000000000..d6732d577 --- /dev/null +++ b/m4/readutmp.m4 @@ -0,0 +1,63 @@ +# readutmp.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_READUTMP], +[ + dnl Prerequisites of lib/readutmp.h. + AC_CHECK_HEADERS_ONCE(sys/param.h) + AC_CHECK_HEADERS(utmp.h utmpx.h) + AC_CHECK_FUNCS(utmpname utmpxname) + AC_CHECK_DECLS(getutent,,,[ +#ifdef HAVE_UTMP_H +# include +#endif +]) + if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then + utmp_includes="\ +$ac_includes_default +#ifdef HAVE_UTMPX_H +# include +#endif +#ifdef HAVE_UTMP_H +# include +#endif +" + AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmpx.ut_exit],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_exit],,,[$utmp_includes]) + + AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes]) + + AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes]) + AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes]) + + AC_LIBOBJ(readutmp) + gl_PREREQ_READUTMP + fi +]) + +# Prerequisites of lib/readutmp.c. +AC_DEFUN([gl_PREREQ_READUTMP], +[ + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/realloc.m4 b/m4/realloc.m4 new file mode 100644 index 000000000..9f746f190 --- /dev/null +++ b/m4/realloc.m4 @@ -0,0 +1,25 @@ +# realloc.m4 serial 7 +dnl Copyright (C) 2002 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 Jim Meyering. +dnl Determine whether realloc works when both arguments are 0. +dnl If it doesn't, arrange to use the replacement function. + +AC_DEFUN([jm_FUNC_REALLOC], +[ + AC_REQUIRE([AC_FUNC_REALLOC]) + dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works. + if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then + gl_PREREQ_REALLOC + fi +]) + +# Prerequisites of lib/realloc.c. +AC_DEFUN([gl_PREREQ_REALLOC], [ + : +]) diff --git a/m4/rmdir.m4 b/m4/rmdir.m4 new file mode 100644 index 000000000..a86ff782e --- /dev/null +++ b/m4/rmdir.m4 @@ -0,0 +1,22 @@ +# rmdir.m4 serial 1 +dnl Copyright (C) 2002 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_RMDIR], +[ + AC_REPLACE_FUNCS(rmdir) + if test $ac_cv_func_rmdir = no; then + gl_PREREQ_RMDIR + fi +]) + +# Prerequisites of lib/rmdir.c. +AC_DEFUN([gl_PREREQ_RMDIR], [ + AC_REQUIRE([AC_HEADER_STAT]) + : +]) + diff --git a/m4/rpmatch.m4 b/m4/rpmatch.m4 new file mode 100644 index 000000000..4cce297c3 --- /dev/null +++ b/m4/rpmatch.m4 @@ -0,0 +1,22 @@ +# rpmatch.m4 serial 3 +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_RPMATCH], +[ + AC_REPLACE_FUNCS(rpmatch) + if test $ac_cv_func_rpmatch = no; then + gl_PREREQ_RPMATCH + fi +]) + +# Prerequisites of lib/rpmatch.c. +AC_DEFUN([gl_PREREQ_RPMATCH], [ + AC_REQUIRE([AC_HEADER_STDC]) + : +]) + diff --git a/m4/safe-read.m4 b/m4/safe-read.m4 new file mode 100644 index 000000000..deb01bc96 --- /dev/null +++ b/m4/safe-read.m4 @@ -0,0 +1,19 @@ +# safe-read.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_SAFE_READ], +[ + gl_PREREQ_SAFE_READ +]) + +# Prerequisites of lib/safe-read.c. +AC_DEFUN([gl_PREREQ_SAFE_READ], +[ + AC_REQUIRE([gt_TYPE_SSIZE_T]) + AC_CHECK_HEADERS_ONCE(unistd.h) +]) diff --git a/m4/safe-write.m4 b/m4/safe-write.m4 new file mode 100644 index 000000000..cf3292b2a --- /dev/null +++ b/m4/safe-write.m4 @@ -0,0 +1,18 @@ +# safe-write.m4 serial 1 +dnl Copyright (C) 2002 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_SAFE_WRITE], +[ + gl_PREREQ_SAFE_WRITE +]) + +# Prerequisites of lib/safe-write.c. +AC_DEFUN([gl_PREREQ_SAFE_WRITE], +[ + gl_PREREQ_SAFE_READ +]) diff --git a/m4/same.m4 b/m4/same.m4 new file mode 100644 index 000000000..d15027b80 --- /dev/null +++ b/m4/same.m4 @@ -0,0 +1,14 @@ +# same.m4 serial 1 +dnl Copyright (C) 2002 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_SAME], +[ + dnl Prerequisites of lib/same.c. + AC_CHECK_HEADERS_ONCE(stdlib.h string.h unistd.h) + AC_CHECK_DECLS_ONCE(free) +]) diff --git a/m4/save-cwd.m4 b/m4/save-cwd.m4 new file mode 100644 index 000000000..fcafca913 --- /dev/null +++ b/m4/save-cwd.m4 @@ -0,0 +1,15 @@ +# save-cwd.m4 serial 1 +dnl Copyright (C) 2002 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_SAVE_CWD], +[ + dnl Prerequisites for lib/save-cwd.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h) + AC_CHECK_FUNCS(fchdir) +]) diff --git a/m4/savedir.m4 b/m4/savedir.m4 new file mode 100644 index 000000000..5bbead54d --- /dev/null +++ b/m4/savedir.m4 @@ -0,0 +1,15 @@ +# savedir.m4 serial 1 +dnl Copyright (C) 2002 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_SAVEDIR], +[ + dnl Prerequisites of lib/savedir.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_REQUIRE([AC_HEADER_DIRENT]) + AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID]) +]) diff --git a/m4/settime.m4 b/m4/settime.m4 new file mode 100644 index 000000000..3751af564 --- /dev/null +++ b/m4/settime.m4 @@ -0,0 +1,14 @@ +# settime.m4 serial 1 +dnl Copyright (C) 2002 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_SETTIME], +[ + dnl Prerequisites of lib/settime.c. + # Need clock_settime. + AC_REQUIRE([gl_CLOCK_TIME]) +]) diff --git a/m4/sha.m4 b/m4/sha.m4 new file mode 100644 index 000000000..c218fec2f --- /dev/null +++ b/m4/sha.m4 @@ -0,0 +1,14 @@ +# sha.m4 serial 1 +dnl Copyright (C) 2002 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_SHA], +[ + dnl Prerequisites of lib/sha.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_FUNCS_ONCE(memcpy) +]) diff --git a/m4/sig2str.m4 b/m4/sig2str.m4 new file mode 100644 index 000000000..deef9c56f --- /dev/null +++ b/m4/sig2str.m4 @@ -0,0 +1,21 @@ +# sig2str.m4 serial 1 +dnl Copyright (C) 2002 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_SIG2STR], +[ + AC_REPLACE_FUNCS(sig2str) + if test $ac_cv_func_sig2str = no; then + gl_PREREQ_SIG2STR + fi +]) + +# Prerequisites of lib/sig2str.c. +AC_DEFUN([gl_PREREQ_SIG2STR], [ + : +]) + diff --git a/m4/stdio-safer.m4 b/m4/stdio-safer.m4 new file mode 100644 index 000000000..716c3bcd1 --- /dev/null +++ b/m4/stdio-safer.m4 @@ -0,0 +1,13 @@ +# stdio-safer.m4 serial 1 +dnl Copyright (C) 2002 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_STDIO_SAFER], +[ + dnl Prerequisites of lib/fopen-safer.c. + AC_CHECK_HEADERS_ONCE(unistd.h) +]) diff --git a/m4/stpcpy.m4 b/m4/stpcpy.m4 new file mode 100644 index 000000000..b3282661b --- /dev/null +++ b/m4/stpcpy.m4 @@ -0,0 +1,24 @@ +# stpcpy.m4 serial 1 +dnl Copyright (C) 2002 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_STPCPY], +[ + dnl Persuade glibc to declare stpcpy(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REPLACE_FUNCS(stpcpy) + if test $ac_cv_func_stpcpy = no; then + gl_PREREQ_STPCPY + fi +]) + +# Prerequisites of lib/stpcpy.c. +AC_DEFUN([gl_PREREQ_STPCPY], [ + : +]) + diff --git a/m4/strcase.m4 b/m4/strcase.m4 new file mode 100644 index 000000000..3fd25d0ce --- /dev/null +++ b/m4/strcase.m4 @@ -0,0 +1,39 @@ +# strcase.m4 serial 1 +dnl Copyright (C) 2002 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_STRCASE], +[ + gl_FUNC_STRCASECMP + gl_FUNC_STRNCASECMP +]) + +AC_DEFUN([gl_FUNC_STRCASECMP], +[ + AC_REPLACE_FUNCS(strcasecmp) + if test $ac_cv_func_strcasecmp = no; then + gl_PREREQ_STRCASECMP + fi +]) + +AC_DEFUN([gl_FUNC_STRNCASECMP], +[ + AC_REPLACE_FUNCS(strncasecmp) + if test $ac_cv_func_strncasecmp = no; then + gl_PREREQ_STRNCASECMP + fi +]) + +# Prerequisites of lib/strcasecmp.c. +AC_DEFUN([gl_PREREQ_STRCASECMP], [ + : +]) + +# Prerequisites of lib/strncasecmp.c. +AC_DEFUN([gl_PREREQ_STRNCASECMP], [ + : +]) diff --git a/m4/strcspn.m4 b/m4/strcspn.m4 new file mode 100644 index 000000000..1fb5f14e6 --- /dev/null +++ b/m4/strcspn.m4 @@ -0,0 +1,20 @@ +# strcspn.m4 serial 1 +dnl Copyright (C) 2002 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_STRCSPN], +[ + AC_REPLACE_FUNCS(strcspn) + if test $ac_cv_func_strcspn = no; then + gl_PREREQ_STRCSPN + fi +]) + +# Prerequisites of lib/strcspn.c. +AC_DEFUN([gl_PREREQ_STRCSPN], [ + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/strdup.m4 b/m4/strdup.m4 new file mode 100644 index 000000000..08087063d --- /dev/null +++ b/m4/strdup.m4 @@ -0,0 +1,22 @@ +# strdup.m4 serial 1 +dnl Copyright (C) 2002 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_STRDUP], +[ + AC_REPLACE_FUNCS(strdup) + if test $ac_cv_func_strdup = no; then + gl_PREREQ_STRDUP + fi +]) + +# Prerequisites of lib/strdup.c. +AC_DEFUN([gl_PREREQ_STRDUP], [ + AC_REQUIRE([AC_HEADER_STDC]) + : +]) + diff --git a/m4/strndup.m4 b/m4/strndup.m4 new file mode 100644 index 000000000..f2f5cfea6 --- /dev/null +++ b/m4/strndup.m4 @@ -0,0 +1,25 @@ +# strndup.m4 serial 1 +dnl Copyright (C) 2002 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_STRNDUP], +[ + dnl Persuade glibc to declare strndup(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REPLACE_FUNCS(strndup) + if test $ac_cv_func_strndup = no; then + gl_PREREQ_STRNDUP + fi +]) + +# Prerequisites of lib/strndup.c. +AC_DEFUN([gl_PREREQ_STRNDUP], [ + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_DECLS(strnlen) +]) + diff --git a/m4/strnlen.m4 b/m4/strnlen.m4 new file mode 100644 index 000000000..89cca67ea --- /dev/null +++ b/m4/strnlen.m4 @@ -0,0 +1,32 @@ +# strnlen.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_STRNLEN], +[ + dnl Persuade glibc to declare strnlen(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_FUNC_STRNLEN + if test $ac_cv_func_strnlen_working = no; then + # This is necessary because automake-1.6.1 doens't understand + # that the above use of AC_FUNC_STRNLEN means we may have to use + # lib/strnlen.c. + #AC_LIBOBJ(strnlen) + AC_DEFINE(strnlen, rpl_strnlen, + [Define to rpl_strnlen if the replacement function should be used.]) + gl_PREREQ_STRNLEN + fi +]) + +# Prerequisites of lib/strnlen.c. +AC_DEFUN([gl_PREREQ_STRNLEN], [ + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(memory.h string.h) + AC_CHECK_DECLS(memchr) +]) + diff --git a/m4/strpbrk.m4 b/m4/strpbrk.m4 new file mode 100644 index 000000000..1f5fa01b8 --- /dev/null +++ b/m4/strpbrk.m4 @@ -0,0 +1,20 @@ +# strpbrk.m4 serial 1 +dnl Copyright (C) 2002 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_STRPBRK], +[ + AC_REPLACE_FUNCS(strpbrk) + if test $ac_cv_func_strpbrk = no; then + gl_PREREQ_STRPBRK + fi +]) + +# Prerequisites of lib/strpbrk.c. +AC_DEFUN([gl_PREREQ_STRPBRK], [ + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/strstr.m4 b/m4/strstr.m4 new file mode 100644 index 000000000..25a1801e1 --- /dev/null +++ b/m4/strstr.m4 @@ -0,0 +1,20 @@ +# strstr.m4 serial 1 +dnl Copyright (C) 2002 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_STRSTR], +[ + AC_REPLACE_FUNCS(strstr) + if test $ac_cv_func_strstr = no; then + gl_PREREQ_STRSTR + fi +]) + +# Prerequisites of lib/strstr.c. +AC_DEFUN([gl_PREREQ_STRSTR], [ + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/strtod.m4 b/m4/strtod.m4 new file mode 100644 index 000000000..809a83fa8 --- /dev/null +++ b/m4/strtod.m4 @@ -0,0 +1,25 @@ +# strtod.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_STRTOD], +[ + AC_REQUIRE([AC_FUNC_STRTOD]) + if test $ac_cv_func_strtod = no; then + AC_DEFINE(strtod, rpl_strtod, + [Define to rpl_strtod if the replacement function should be used.]) + gl_PREREQ_STRTOD + fi +]) + +# Prerequisites of lib/strtod.c. +# The need for pow() is already handled by AC_FUNC_STRTOD. +AC_DEFUN([gl_PREREQ_STRTOD], [ + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS(float.h) + AC_CHECK_FUNCS_ONCE(isascii) +]) diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4 new file mode 100644 index 000000000..7a338f2aa --- /dev/null +++ b/m4/strtoimax.m4 @@ -0,0 +1,39 @@ +# strtoimax.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_STRTOIMAX], +[ + dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. + AC_REQUIRE([AC_PROG_CPP]) + AC_REQUIRE([AC_PROG_EGREP]) + + AC_CACHE_CHECK([whether defines strtoimax as a macro], + jm_cv_func_strtoimax_macro, + [AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include +#ifdef strtoimax + inttypes_h_defines_strtoimax +#endif], + jm_cv_func_strtoimax_macro=yes, + jm_cv_func_strtoimax_macro=no)]) + + if test "$jm_cv_func_strtoimax_macro" != yes; then + AC_REPLACE_FUNCS(strtoimax) + if test $ac_cv_func_strtoimax = no; then + gl_PREREQ_STRTOIMAX + fi + fi +]) + +# Prerequisites of lib/strtoimax.c. +AC_DEFUN([gl_PREREQ_STRTOIMAX], [ + jm_AC_TYPE_INTMAX_T + AC_CHECK_HEADERS_ONCE(stdlib.h) + AC_CHECK_DECLS_ONCE(strtol) + AC_CHECK_DECLS(strtoll) + AC_REQUIRE([jm_AC_TYPE_LONG_LONG]) +]) diff --git a/m4/strtol.m4 b/m4/strtol.m4 new file mode 100644 index 000000000..59a74f655 --- /dev/null +++ b/m4/strtol.m4 @@ -0,0 +1,22 @@ +# strtol.m4 serial 1 +dnl Copyright (C) 2002 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_STRTOL], +[ + AC_REPLACE_FUNCS(strtol) + if test $ac_cv_func_strtol = no; then + gl_PREREQ_STRTOL + fi +]) + +# Prerequisites of lib/strtol.c. +AC_DEFUN([gl_PREREQ_STRTOL], [ + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(limits.h) + AC_CHECK_FUNCS_ONCE(isascii) +]) diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 new file mode 100644 index 000000000..73e7251e9 --- /dev/null +++ b/m4/strtoll.m4 @@ -0,0 +1,26 @@ +# strtoll.m4 serial 1 +dnl Copyright (C) 2002 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_STRTOLL], +[ + dnl We don't need (and can't compile) the replacement strtoll + dnl unless the type 'long long' exists. + AC_REQUIRE([jm_AC_TYPE_LONG_LONG]) + if test "$ac_cv_type_long_long" = yes; then + AC_REPLACE_FUNCS(strtoll) + if test $ac_cv_func_strtoll = no; then + gl_PREREQ_STRTOLL + fi + fi +]) + +# Prerequisites of lib/strtoll.c. +AC_DEFUN([gl_PREREQ_STRTOLL], [ + : +]) + diff --git a/m4/strtoul.m4 b/m4/strtoul.m4 new file mode 100644 index 000000000..a76fef6d8 --- /dev/null +++ b/m4/strtoul.m4 @@ -0,0 +1,20 @@ +# strtoul.m4 serial 1 +dnl Copyright (C) 2002 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_STRTOUL], +[ + AC_REPLACE_FUNCS(strtoul) + if test $ac_cv_func_strtoul = no; then + gl_PREREQ_STRTOUL + fi +]) + +# Prerequisites of lib/strtoul.c. +AC_DEFUN([gl_PREREQ_STRTOUL], [ + gl_PREREQ_STRTOL +]) diff --git a/m4/strtoull.m4 b/m4/strtoull.m4 new file mode 100644 index 000000000..68035c47f --- /dev/null +++ b/m4/strtoull.m4 @@ -0,0 +1,26 @@ +# strtoull.m4 serial 1 +dnl Copyright (C) 2002 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_STRTOULL], +[ + dnl We don't need (and can't compile) the replacement strtoull + dnl unless the type 'unsigned long long' exists. + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) + if test "$ac_cv_type_unsigned_long_long" = yes; then + AC_REPLACE_FUNCS(strtoull) + if test $ac_cv_func_strtoull = no; then + gl_PREREQ_STRTOULL + fi + fi +]) + +# Prerequisites of lib/strtoull.c. +AC_DEFUN([gl_PREREQ_STRTOULL], [ + : +]) + diff --git a/m4/strtoumax.m4 b/m4/strtoumax.m4 new file mode 100644 index 000000000..5a2d569a7 --- /dev/null +++ b/m4/strtoumax.m4 @@ -0,0 +1,39 @@ +# strtoumax.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_STRTOUMAX], +[ + dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. + AC_REQUIRE([AC_PROG_CPP]) + AC_REQUIRE([AC_PROG_EGREP]) + + AC_CACHE_CHECK([whether defines strtoumax as a macro], + jm_cv_func_strtoumax_macro, + [AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include +#ifdef strtoumax + inttypes_h_defines_strtoumax +#endif], + jm_cv_func_strtoumax_macro=yes, + jm_cv_func_strtoumax_macro=no)]) + + if test "$jm_cv_func_strtoumax_macro" != yes; then + AC_REPLACE_FUNCS(strtoumax) + if test $ac_cv_func_strtoumax = no; then + gl_PREREQ_STRTOUMAX + fi + fi +]) + +# Prerequisites of lib/strtoumax.c. +AC_DEFUN([gl_PREREQ_STRTOUMAX], [ + jm_AC_TYPE_UINTMAX_T + AC_CHECK_HEADERS_ONCE(stdlib.h) + AC_CHECK_DECLS_ONCE(strtoul) + AC_CHECK_DECLS(strtoull) + AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) +]) diff --git a/m4/strverscmp.m4 b/m4/strverscmp.m4 new file mode 100644 index 000000000..bb82336f5 --- /dev/null +++ b/m4/strverscmp.m4 @@ -0,0 +1,24 @@ +# strverscmp.m4 serial 1 +dnl Copyright (C) 2002 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_STRVERSCMP], +[ + dnl Persuade glibc to declare strverscmp(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REPLACE_FUNCS(strverscmp) + if test $ac_cv_func_strverscmp = no; then + gl_PREREQ_STRVERSCMP + fi +]) + +# Prerequisites of lib/strverscmp.c. +AC_DEFUN([gl_PREREQ_STRVERSCMP], [ + : +]) + diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4 new file mode 100644 index 000000000..1da8b809e --- /dev/null +++ b/m4/ulonglong.m4 @@ -0,0 +1,25 @@ +# ulonglong.m4 serial 3 +dnl Copyright (C) 1999-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 Paul Eggert. + +# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. + +AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], +[ + AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, + [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], + [unsigned long long ullmax = (unsigned long long) -1; + return ull << i | ull >> i | ullmax / ull | ullmax % ull;], + ac_cv_type_unsigned_long_long=yes, + ac_cv_type_unsigned_long_long=no)]) + if test $ac_cv_type_unsigned_long_long = yes; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, + [Define if you have the 'unsigned long long' type.]) + fi +]) diff --git a/m4/unicodeio.m4 b/m4/unicodeio.m4 new file mode 100644 index 000000000..8ff756c51 --- /dev/null +++ b/m4/unicodeio.m4 @@ -0,0 +1,13 @@ +# unicodeio.m4 serial 1 +dnl Copyright (C) 2002 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_UNICODEIO], +[ + dnl Prerequisites of lib/unicodeio.c. + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/unistd-safer.m4 b/m4/unistd-safer.m4 new file mode 100644 index 000000000..894fb7154 --- /dev/null +++ b/m4/unistd-safer.m4 @@ -0,0 +1,17 @@ +# unistd-safer.m4 serial 1 +dnl Copyright (C) 2002 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_UNISTD_SAFER], +[ + gl_PREREQ_DUP_SAFER +]) + +# Prerequisites of lib/dup-safer.c. +AC_DEFUN([gl_PREREQ_DUP_SAFER], [ + AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h) +]) diff --git a/m4/userspec.m4 b/m4/userspec.m4 new file mode 100644 index 000000000..862c87170 --- /dev/null +++ b/m4/userspec.m4 @@ -0,0 +1,15 @@ +# userspec.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_USERSPEC], +[ + dnl Prerequisites of lib/userspec.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_CHECK_HEADERS_ONCE(string.h sys/param.h unistd.h) +]) diff --git a/m4/xalloc.m4 b/m4/xalloc.m4 new file mode 100644 index 000000000..1826bdcc7 --- /dev/null +++ b/m4/xalloc.m4 @@ -0,0 +1,26 @@ +# xalloc.m4 serial 1 +dnl Copyright (C) 2002 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_XALLOC], +[ + gl_PREREQ_XMALLOC + gl_PREREQ_XSTRDUP +]) + +# Prerequisites of lib/xmalloc.c. +AC_DEFUN([gl_PREREQ_XMALLOC], [ + AC_REQUIRE([AC_HEADER_STDC]) + AC_REQUIRE([jm_FUNC_MALLOC]) + AC_REQUIRE([jm_FUNC_REALLOC]) +]) + +# Prerequisites of lib/xstrdup.c. +AC_DEFUN([gl_PREREQ_XSTRDUP], [ + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/xgetcwd.m4 b/m4/xgetcwd.m4 new file mode 100644 index 000000000..efd30af3f --- /dev/null +++ b/m4/xgetcwd.m4 @@ -0,0 +1,15 @@ +# xgetcwd.m4 serial 1 +dnl Copyright (C) 2002 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_XGETCWD], +[ + dnl Prerequisites of lib/xgetcwd.c. + AC_CHECK_HEADERS_ONCE(stdlib.h unistd.h) + AC_CHECK_FUNCS(getcwd) + AC_FUNC_GETCWD_NULL +]) diff --git a/m4/xreadlink.m4 b/m4/xreadlink.m4 new file mode 100644 index 000000000..7062fd198 --- /dev/null +++ b/m4/xreadlink.m4 @@ -0,0 +1,14 @@ +# xreadlink.m4 serial 3 +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_XREADLINK], +[ + dnl Prerequisites of lib/xreadlink.c. + AC_REQUIRE([gt_TYPE_SSIZE_T]) + AC_CHECK_HEADERS_ONCE(stdlib.h unistd.h) +]) diff --git a/m4/xstrtod.m4 b/m4/xstrtod.m4 new file mode 100644 index 000000000..4056d8cf0 --- /dev/null +++ b/m4/xstrtod.m4 @@ -0,0 +1,13 @@ +# xstrtod.m4 serial 1 +dnl Copyright (C) 2002 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. + +# Prerequisites of lib/xstrtod.c. +AC_DEFUN([gl_XSTRTOD], +[ + AC_REQUIRE([AC_HEADER_STDC]) +]) diff --git a/m4/xstrtol.m4 b/m4/xstrtol.m4 new file mode 100644 index 000000000..86d14b68c --- /dev/null +++ b/m4/xstrtol.m4 @@ -0,0 +1,37 @@ +# xstrtol.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_XSTRTOL], +[ + AC_REQUIRE([gl_PREREQ_XSTRTOL]) + AC_REQUIRE([gl_PREREQ_XSTRTOUL]) +]) + +# Prerequisites of lib/xstrtol.h. +AC_DEFUN([gl_PREREQ_XSTRTOL_H], +[ + AC_REQUIRE([jm_AC_TYPE_INTMAX_T]) + AC_REQUIRE([jm_AC_TYPE_UINTMAX_T]) +]) + +# Prerequisites of lib/xstrtol.c. +AC_DEFUN([gl_PREREQ_XSTRTOL], +[ + AC_REQUIRE([gl_PREREQ_XSTRTOL_H]) + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) + AC_CHECK_FUNCS_ONCE(isascii) + AC_CHECK_DECLS_ONCE(strtol strtoul) + AC_CHECK_DECLS([strtoimax, strtoumax]) +]) + +# Prerequisites of lib/xstrtoul.c. +AC_DEFUN([gl_PREREQ_XSTRTOUL], +[ + AC_REQUIRE([gl_PREREQ_XSTRTOL]) +]) diff --git a/m4/yesno.m4 b/m4/yesno.m4 new file mode 100644 index 000000000..fae5f023d --- /dev/null +++ b/m4/yesno.m4 @@ -0,0 +1,13 @@ +# yesno.m4 serial 1 +dnl Copyright (C) 2002 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_YESNO], +[ + dnl Prerequisites of lib/yesno.c. + AC_CHECK_HEADERS_ONCE(stdlib.h) +]) -- cgit v1.2.3-54-g00ecf