From 3a5c9827a10cf00f8a143829dc1785365a30bc93 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 14 Feb 2005 13:56:12 +0000 Subject: 20811: Use the cpp trick to find the file with resource names --- ChangeLog | 6 ++++++ configure.ac | 27 ++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e97882f5..d5ba2ac62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-02-14 Peter Stephenson + + * 20811: configure.ac: Copy the trick for finding the + file with signal names to make finding the file with resource + names more reliable. + 2005-02-10 Wayne Davison * unposted: Completion/Unix/Command/_yodl: Added missing diff --git a/configure.ac b/configure.ac index 35d846c01..f7a731b08 100644 --- a/configure.ac +++ b/configure.ac @@ -1275,13 +1275,26 @@ dnl Look for the file containing the RLIMIT_* definitions dnl ----------------------------------------------------- dnl CALL FOR MORE (FEWER?) LOCATIONS: I've just copied the signal checking. AC_CACHE_CHECK(where the RLIMIT macros are located,zsh_cv_path_rlimit_h, -[for RESOURCE_H in /usr/include/bsd/sys/resource.h dnl - /usr/include/asm/resource.h dnl - /usr/include/linux/resource.h dnl - /usr/include/sys/resource.h dnl - /usr/include/bits/resource.h dnl - /usr/include/resourcebits.h dnl - /dev/null; +[dnl Look at the output from the preprocessor. +dnl Copied from the search for the signal names above. +echo "#include " >restmp.c +resourcefile_list="`$CPP restmp.c | +sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ + -e 's/^#[ ].*\"\(.*\)\"/\1/p' | +sed 's/\\\\\\\\/\//g' | +$AWK '{ if (\$1 ~ \"resource\") files[[\$1]] = \$1 } + END { for (var in files) print var }'`" +rm -f restmp.c +if test -z "$resourcefile_list"; then + dnl No list: look at standard places. + resourcefile_list="/usr/include/bsd/sys/resource.h +/usr/include/asm/resource.h +/usr/include/linux/resource.h +/usr/include/sys/resource.h +/usr/include/bits/resource.h +/usr/include/resourcebits.h" +fi +for RESOURCE_H in $resourcefile_list /dev/null; do test -f $RESOURCE_H && \ grep '#[ ]*define[ ][ ]*RLIMIT_[A-Z]*[ ]*[0-9A-Z][0-9]*' $RESOURCE_H > /dev/null && \ -- cgit 1.4.1