summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2005-02-16 17:52:23 +0000
committerBart Schaefer <barts@users.sourceforge.net>2005-02-16 17:52:23 +0000
commitec83e6d09ef55c59546cb02faafe0d8fd2e6c248 (patch)
treeb640d29b648460e67c1b04136ea4af27359ae4b6
parentUnposted typo correction from Wayne. (diff)
downloadzsh-ec83e6d09ef55c59546cb02faafe0d8fd2e6c248.tar
zsh-ec83e6d09ef55c59546cb02faafe0d8fd2e6c248.tar.gz
zsh-ec83e6d09ef55c59546cb02faafe0d8fd2e6c248.tar.bz2
zsh-ec83e6d09ef55c59546cb02faafe0d8fd2e6c248.tar.lz
zsh-ec83e6d09ef55c59546cb02faafe0d8fd2e6c248.tar.xz
zsh-ec83e6d09ef55c59546cb02faafe0d8fd2e6c248.tar.zst
zsh-ec83e6d09ef55c59546cb02faafe0d8fd2e6c248.zip
20811.
-rw-r--r--configure.ac27
1 files changed, 20 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 99d1c49df..96bcd2dad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1274,13 +1274,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 <sys/resource.h>" >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 && \