From 96bd9415dc85b2adad94a019b22103d63b94c2e4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 12 Sep 2002 13:15:07 +0000 Subject: . --- aclocal.m4 | 250 ++----------------------------------------------------------- 1 file changed, 5 insertions(+), 245 deletions(-) (limited to 'aclocal.m4') diff --git a/aclocal.m4 b/aclocal.m4 index cb36cdef7..eb8443be4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -799,19 +799,6 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]) fi])]) -# AC_GNU_SOURCE -# -------------- -AC_DEFUN([AC_GNU_SOURCE], -[AH_VERBATIM([_GNU_SOURCE], -[/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif])dnl -AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl -AC_BEFORE([$0], [AC_RUN_IFELSE])dnl -AC_DEFINE([_GNU_SOURCE]) -]) - #serial 4 dnl From Jim Meyering. @@ -854,7 +841,7 @@ WARNING: You don't seem to have perl5.003 or newer installed, or you lack ] ) ]) -#serial 49 -*- autoconf -*- +#serial 50 -*- autoconf -*- dnl Misc type-related macros for fileutils, sh-utils, textutils. @@ -923,7 +910,10 @@ AC_DEFUN([jm_MACROS], AC_REQUIRE([AC_FUNC_FSEEKO]) AC_REQUIRE([AC_FUNC_VPRINTF]) AC_REQUIRE([AC_FUNC_ALLOCA]) - AC_FUNC_GETLOADAVG([lib]) + + AC_CONFIG_LIBOBJ_DIR([lib]) + AC_FUNC_GETLOADAVG + AC_REQUIRE([jm_SYS_PROC_UPTIME]) AC_REQUIRE([jm_FUNC_FTRUNCATE]) AC_REQUIRE([vb_FUNC_RENAME]) @@ -2135,39 +2125,6 @@ AC_DEFUN([jm_FUNC_MBRTOWC], fi ]) -# mbstate_t.m4 serial 9 -dnl Copyright (C) 2000, 2001, 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. - -# From Paul Eggert. - -# BeOS 5 has but does not define mbstate_t, -# so you can't declare an object of that type. -# Check for this incompatibility with Standard C. - -# AC_TYPE_MBSTATE_T -# ----------------- -AC_DEFUN([AC_TYPE_MBSTATE_T], - [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT -# include ], - [mbstate_t x; return sizeof x;])], - [ac_cv_type_mbstate_t=yes], - [ac_cv_type_mbstate_t=no])]) - if test $ac_cv_type_mbstate_t = yes; then - AC_DEFINE([HAVE_MBSTATE_T], 1, - [Define to 1 if declares mbstate_t.]) - else - AC_DEFINE([mbstate_t], int, - [Define to a type if does not define.]) - fi]) - #serial 5 dnl A replacement for autoconf's macro by the same name. This version @@ -2211,94 +2168,6 @@ AC_DEFUN([AC_SEARCH_LIBS], fi ]) -# Check for fnmatch. - -# This is a modified version of autoconf's AC_FUNC_FNMATCH. -# This file should be removed after Autoconf 2.54 is required. - -# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE) -# ------------------------------------------------------------------------- -# If a STANDARD compliant fnmatch is found, run IF-TRUE, otherwise -# IF-FALSE. Use CACHE_VAR. -AC_DEFUN([_AC_FUNC_FNMATCH_IF], -[AC_CACHE_CHECK( - [for working $1 fnmatch], - [$2], - [# Some versions of Solaris, SCO, and the GNU C Library - # have a broken or incompatible fnmatch. - # So we run a test program. If we are cross-compiling, take no chance. - # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test. - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [#include -# define y(a, b, c) (fnmatch (a, b, c) == 0) -# define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) - ], - [exit - (!(y ("a*", "abc", 0) - && n ("d*/*1", "d/s/1", FNM_PATHNAME) - && y ("a\\\\bc", "abc", 0) - && n ("a\\\\bc", "abc", FNM_NOESCAPE) - && y ("*x", ".x", 0) - && n ("*x", ".x", FNM_PERIOD) - && m4_if([$1], [GNU], - [y ("xxXX", "xXxX", FNM_CASEFOLD) - && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH) - && n ("d*/*1", "d/s/1", FNM_FILE_NAME) - && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR) - && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR) - && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)], - 1)));])], - [$2=yes], - [$2=no], - [$2=cross])]) -AS_IF([test $$2 = yes], [$3], [$4]) -])# _AC_FUNC_FNMATCH_IF - - -# _AC_LIBOBJ_FNMATCH -# ------------------ -# Prepare the replacement of fnmatch. -AC_DEFUN([_AC_LIBOBJ_FNMATCH], -[AC_REQUIRE([AC_C_CONST])dnl -AC_REQUIRE([AC_FUNC_ALLOCA])dnl -AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl -AC_CHECK_DECLS([getenv]) -AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmempcpy]) -AC_CHECK_HEADERS([wchar.h wctype.h]) -AC_LIBOBJ([fnmatch]) -AC_CONFIG_LINKS([lib/fnmatch.h:lib/fnmatch_.h]) -AC_DEFINE(fnmatch, rpl_fnmatch, - [Define to rpl_fnmatch if the replacement function should be used.]) -])# _AC_LIBOBJ_FNMATCH - - -# AC_FUNC_FNMATCH_GNU -# ------------------- -AC_DEFUN([AC_FUNC_FNMATCH_GNU], -[AC_REQUIRE([AC_GNU_SOURCE]) -_AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu], - [rm -f lib/fnmatch.h], - [_AC_LIBOBJ_FNMATCH]) -])# AC_FUNC_FNMATCH_GNU - # Check for stdbool.h that conforms to C99. # Copyright (C) 2002 Free Software Foundation, Inc. @@ -3422,115 +3291,6 @@ AC_DEFUN([jm_FUNC_GETGROUPS], fi ]) -#serial 9 - -# 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(locale.h unistd.h mach/mach.h fcntl.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 - #serial 5 AC_PREREQ(2.13) -- cgit v1.2.3-54-g00ecf