1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-13 23:31:08 +02:00

22470: attempt to improve errno.h searching

This commit is contained in:
Peter Stephenson 2006-05-29 16:01:17 +00:00
parent 29ed6c7e3a
commit cd821f5f5f
2 changed files with 20 additions and 7 deletions

View file

@ -1,7 +1,11 @@
2006-05-29 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 10343: Src/exec.c: make bad #! interpreters print a more
informative message.
* 22470: configure.ac: incorporate extensions to errno.h
searching found by <johann@myrkraverk.com> trying to maximise
matches and minimise the risk of finding the wrong file.
* zsh-users/10343: Src/exec.c: make bad #! interpreters print a
more informative message.
2006-05-28 Clint Adams <clint@zsh.org>

View file

@ -1312,16 +1312,25 @@ sed 's/\\\\\\\\/\//g' |
$AWK '{ if ($1 ~ /err/) files[[$1]] = $1 }
END { for (var in files) print var }'`"
rm -f nametmp.c
for ERRNO_H in $errfile_list /dev/null
lnerrs=0
for ERRNO_TRY_H in $errfile_list /dev/null
do
dnl Try to make sure it doesn't get confused by files that don't
dnl have real error definitions in. Count definitions to make sure.
nerrs=`test -f $ERRNO_H && \
$EGREP '#[ ]*define[ ][ ]*E[0-9A-Z]*[ ]*(_HURD_ERRNO \()?[0-9]+\)?' $ERRNO_H | \
dnl Definitions of error numbers have become more and more general, so
dnl pick the file with the most matches, which must be at least 7.
dnl Careful with cut and paste in the pattern: the square brackets
dnl must contain a space and a tab.
nerrs=`test -f $ERRNO_TRY_H && \
$EGREP '#[ ]*define[ ][ ]*E[0-9A-Z]*[ ]*(_HURD_ERRNO )?\(?[_A-Z0-9]' $ERRNO_TRY_H | \
wc -l | sed 's/[ ]//g'`
test "x$nerrs" != x && test "$nerrs" -ge 7 && break
if test "x$nerrs" != x && test "$nerrs" -ge 7 && test "$nerrs" -gt "$lnerrs"
then
lnerrs=$nerrs
ERRNO_H=$ERRNO_TRY_H
fi
done
if test x$ERRNO_H = x"/dev/null"; then
if test x$ERRNO_H = x; then
AC_MSG_ERROR(ERROR MACROS NOT FOUND: please report to developers)
fi
zsh_cv_path_errno_h=$ERRNO_H