Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Zsh 4.2.3 and 4.2.4 are built improperly on AMD64 Gentoo Linux version 2005.0



This uses the same trick for the resource file as for the signal names,
passing the main header through cpp and looking for file names.  It
should make finding the definitions more reliable.

Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.27
diff -u -r1.27 configure.ac
--- configure.ac	4 Feb 2005 16:59:31 -0000	1.27
+++ configure.ac	14 Feb 2005 13:47:51 -0000
@@ -1275,13 +1275,26 @@
 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 && \

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author