[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gawk 3.1.1 has bad configure check for mmap() on Solaris
From: |
Paul Eggert |
Subject: |
Re: gawk 3.1.1 has bad configure check for mmap() on Solaris |
Date: |
Mon, 20 May 2002 23:11:51 -0700 (PDT) |
> From: Aharon Robbins <address@hidden>
> Date: Mon, 20 May 2002 23:00:03 +0300
>
> Thanks for the report. This will likely be fixed when I move off
> Autoconf 2.13. I'm not sure when that will be though.
If it helps, here's a patch to upgrade Gawk 3.1.1 to Autoconf 2.53 and
Automake 1.6.1. I verified that this does fix the Solaris cc mmap bug
that he mentioned.
Before applying this patch, please remove the following source files:
acconfig.h
m4/isc-posix.m4
m4/jm-mktime.m4
m4/largefile.m4
m4/ssize_t.m4
Then run "aclocal -I m4", "autoconf", and "configure".
Most of the patch simply upgrades files like ansi2knr.c to
the latest version from Automake and Autoconf.
diff -pru gawk-3.1.1/ansi2knr.c gawk-3.1.1-autoconf/ansi2knr.c
--- gawk-3.1.1/ansi2knr.c 2000-11-07 08:15:29.000000000 -0800
+++ gawk-3.1.1-autoconf/ansi2knr.c 2001-05-19 23:15:20.000000000 -0700
@@ -1,6 +1,6 @@
-/* Copyright (C) 1989, 1997, 1998, 1999 Aladdin Enterprises. All rights
reserved. */
+/* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */
-/*$Id: ansi2knr.c $*/
+/*$Id: ansi2knr.c,v 1.3 2000/04/13 03:41:48 lpd Exp $*/
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
/*
@@ -37,21 +37,21 @@ program under the GPL.
* There are no error messages.
*
* ansi2knr recognizes function definitions by seeing a non-keyword
- * identifier at the left margin, followed by a left parenthesis,
- * with a right parenthesis as the last character on the line,
- * and with a left brace as the first token on the following line
- * (ignoring possible intervening comments), except that a line
+ * identifier at the left margin, followed by a left parenthesis, with a
+ * right parenthesis as the last character on the line, and with a left
+ * brace as the first token on the following line (ignoring possible
+ * intervening comments and/or preprocessor directives), except that a line
* consisting of only
* identifier1(identifier2)
* will not be considered a function definition unless identifier2 is
* the word "void", and a line consisting of
* identifier1(identifier2, <<arbitrary>>)
* will not be considered a function definition.
- * ansi2knr will recognize a multi-line header provided
- * that no intervening line ends with a left or right brace or a semicolon.
- * These algorithms ignore whitespace and comments, except that
- * the function name must be the first thing on the line.
- * The following constructs will confuse it:
+ * ansi2knr will recognize a multi-line header provided that no intervening
+ * line ends with a left or right brace or a semicolon. These algorithms
+ * ignore whitespace, comments, and preprocessor directives, except that
+ * the function name must be the first thing on the line. The following
+ * constructs will confuse it:
* - Any other construct that starts at the left margin and
* follows the above syntax (such as a macro or function call).
* - Some macros that tinker with the syntax of function headers.
@@ -61,6 +61,27 @@ program under the GPL.
* The original and principal author of ansi2knr is L. Peter Deutsch
* <address@hidden>. Other authors are noted in the change history
* that follows (in reverse chronological order):
+
+ lpd 2000-04-12 backs out Eggert's changes because of bugs:
+ - concatlits didn't declare the type of its bufend argument;
+ - concatlits didn't't recognize when it was inside a comment;
+ - scanstring could scan backward past the beginning of the string; when
+ - the check for \ + newline in scanstring was unnecessary.
+
+ 2000-03-05 Paul Eggert <address@hidden>
+
+ Add support for concatenated string literals.
+ * ansi2knr.c (concatlits): New decl.
+ (main): Invoke concatlits to concatenate string literals.
+ (scanstring): Handle backslash-newline correctly. Work with
+ character constants. Fix bug when scanning backwards through
+ backslash-quote. Check for unterminated strings.
+ (convert1): Parse character constants, too.
+ (appendline, concatlits): New functions.
+ * ansi2knr.1: Document this.
+
+ lpd 1999-08-17 added code to allow preprocessor directives
+ wherever comments are allowed
lpd 1999-04-12 added minor fixes from Pavel Roskin
<address@hidden> for clean compilation with
gcc -W -Wall
@@ -196,6 +217,8 @@ program under the GPL.
#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
/* Forward references */
+char *ppdirforward();
+char *ppdirbackward();
char *skipspace();
char *scanstring();
int writeblanks();
@@ -298,7 +321,7 @@ f: if ( line >= buf + (bufsize - 1) )
goto wl;
if ( fgets(line, (unsigned)(buf + bufsize - line), in)
== NULL )
goto wl;
- switch ( *skipspace(more, 1) )
+ switch ( *skipspace(ppdirforward(more), 1) )
{
case '{':
/* Definitely a function header. */
@@ -349,32 +372,70 @@ wl: fputs(buf, out);
return 0;
}
-/* Skip over whitespace and comments, in either direction. */
+/*
+ * Skip forward or backward over one or more preprocessor directives.
+ */
+char *
+ppdirforward(p)
+ char *p;
+{
+ for (; *p == '#'; ++p) {
+ for (; *p != '\r' && *p != '\n'; ++p)
+ if (*p == 0)
+ return p;
+ if (*p == '\r' && p[1] == '\n')
+ ++p;
+ }
+ return p;
+}
+char *
+ppdirbackward(p, limit)
+ char *p;
+ char *limit;
+{
+ char *np = p;
+
+ for (;; p = --np) {
+ if (*np == '\n' && np[-1] == '\r')
+ --np;
+ for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np)
+ if (np[-1] == 0)
+ return np;
+ if (*np != '#')
+ return p;
+ }
+}
+
+/*
+ * Skip over whitespace, comments, and preprocessor directives,
+ * in either direction.
+ */
char *
skipspace(p, dir)
- register char *p;
- register int dir; /* 1 for forward, -1 for backward */
-{ for ( ; ; )
- { while ( is_space(*p) )
- p += dir;
- if ( !(*p == '/' && p[dir] == '*') )
- break;
- p += dir; p += dir;
- while ( !(*p == '*' && p[dir] == '/') )
- { if ( *p == 0 )
- return p; /* multi-line comment?? */
- p += dir;
- }
- p += dir; p += dir;
- }
- return p;
+ char *p;
+ int dir; /* 1 for forward, -1 for backward */
+{
+ for ( ; ; ) {
+ while ( is_space(*p) )
+ p += dir;
+ if ( !(*p == '/' && p[dir] == '*') )
+ break;
+ p += dir; p += dir;
+ while ( !(*p == '*' && p[dir] == '/') ) {
+ if ( *p == 0 )
+ return p; /* multi-line comment?? */
+ p += dir;
+ }
+ p += dir; p += dir;
+ }
+ return p;
}
/* Scan over a quoted string, in either direction. */
char *
scanstring(p, dir)
- register char *p;
- register int dir;
+ char *p;
+ int dir;
{
for (p += dir; ; p += dir)
if (*p == '"' && p[-dir] != '\\')
@@ -412,14 +473,14 @@ writeblanks(start, end)
int
test1(buf)
char *buf;
-{ register char *p = buf;
+{ char *p = buf;
char *bend;
char *endfn;
int contin;
if ( !isidfirstchar(*p) )
return 0; /* no name at left margin */
- bend = skipspace(buf + strlen(buf) - 1, -1);
+ bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1);
switch ( *bend )
{
case ';': contin = 0 /*2*/; break;
@@ -498,7 +559,7 @@ convert1(buf, out, header, convert_varar
int header; /* Boolean */
int convert_varargs; /* Boolean */
{ char *endfn;
- register char *p;
+ char *p;
/*
* The breaks table contains pointers to the beginning and end
* of each argument.
diff -pru gawk-3.1.1/configure.in gawk-3.1.1-autoconf/configure.in
--- gawk-3.1.1/configure.in 2002-04-29 05:23:32.000000000 -0700
+++ gawk-3.1.1-autoconf/configure.in 2002-05-20 15:33:17.275117000 -0700
@@ -29,11 +29,12 @@ AM_INIT_AUTOMAKE(gawk, 3.1.1)
AM_CONFIG_HEADER(config.h:configh.in)
dnl Additional argument stuff
-AC_ARG_ENABLE(portals, [ --enable-portals Enable /p as path prefix for
portals], AC_DEFINE(HAVE_PORTALS))
+AC_ARG_ENABLE(portals, [ --enable-portals Enable /p as path prefix for
portals], AC_DEFINE(HAVE_PORTALS, 1, [we have portals on /p on this system]))
AC_ARG_WITH(whiny-user-strftime, [ --with-whiny-user-strftime Force use of
included version of strftime for deficient systems],
if test "$withval" = yes
then
- AC_DEFINE(USE_INCLUDED_STRFTIME)
+ AC_DEFINE(USE_INCLUDED_STRFTIME, 1,
+ [force use of our version of strftime])
fi
)
@@ -119,25 +120,25 @@ AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_SIZE_T
AC_TYPE_GETGROUPS
-GAWK_AC_TYPE_SSIZE_T
+AC_CHECK_TYPE(ssize_t, int)
AC_EGREP_HEADER([int.*sprintf], stdio.h,
- AC_DEFINE(SPRINTF_RET, int),
+ AC_DEFINE(SPRINTF_RET, int, [return type of sprintf]),
AC_DEFINE(SPRINTF_RET, char *))
dnl see if time_t is defined in <sys/types.h>
AC_TRY_COMPILE([#include <sys/types.h>],[
time_t foo;
foo = 0;
],
- AC_DEFINE(TIME_T_IN_SYS_TYPES_H))
+ AC_DEFINE(TIME_T_IN_SYS_TYPES_H, 1,
+ [some systems define this type here]))
dnl checks for functions
-AC_DEFINE(REGEX_MALLOC)
+AC_DEFINE(REGEX_MALLOC, 1, [use malloc instead of alloca in regex.c])
AC_FUNC_VPRINTF
-dnl one day use [ AC_CHECK_TYPE(ssize_t, int) ]
GAWK_AC_FUNC_STRTOD_C89
AC_FUNC_MKTIME
case "$ac_cv_func_working_mktime" in
-yes) AC_DEFINE(HAVE_MKTIME)
+yes) AC_DEFINE(HAVE_MKTIME, 1, [we have the mktime function])
;;
esac
@@ -149,7 +150,7 @@ dnl check for dynamic linking
dnl This is known to be very primitive
AC_CHECK_HEADER(dlfcn.h,
AC_CHECK_LIB(dl, dlopen,
- AC_DEFINE(DYNAMIC)
+ AC_DEFINE(DYNAMIC, 1, [allow dynamic addition of builtins])
LIBS="$LIBS -ldl"
if test "$GCC" = yes
then
@@ -167,7 +168,8 @@ dnl have to hardwire it for VMS POSIX. S
dnl ditto for BeOS, OS/2, and MS-DOS.
case `(uname) 2> /dev/null` in
*VMS*|*BeOS*|*OS/2*|*MS-DOS*)
- AC_DEFINE(GETPGRP_VOID)
+ AC_DEFINE(GETPGRP_VOID, 1,
+ [Define to 1 if the `getpgrp' function requires zero arguments.])
;;
*) AC_FUNC_GETPGRP
;;
diff -pru gawk-3.1.1/depcomp gawk-3.1.1-autoconf/depcomp
--- gawk-3.1.1/depcomp 2000-11-06 05:01:02.000000000 -0800
+++ gawk-3.1.1-autoconf/depcomp 2002-03-25 22:04:19.000000000 -0800
@@ -18,6 +18,11 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
# Originally written by Alexandre Oliva <address@hidden>.
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
@@ -26,7 +31,16 @@ if test -z "$depmode" || test -z "$sourc
fi
# `libtool' can also be set to `yes' or `no'.
-depfile=${depfile-`echo "$object" | sed
's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+if test -z "$depfile"; then
+ base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+ dir=`echo "$object" | sed 's,/.*$,/,'`
+ if test "$dir" = "$object"; then
+ dir=
+ fi
+ # FIXME: should be _deps on DOS.
+ depfile="$dir.deps/$base"
+fi
+
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
@@ -48,6 +62,20 @@ if test "$depmode" = dashXmstdout; then
fi
case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
@@ -61,9 +89,10 @@ gcc)
if test -z "$gccflag"; then
gccflag=-MD,
fi
- if "$@" -Wp,"$gccflag$tmpdepfile"; then :
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
else
- stat=$?
rm -f "$tmpdepfile"
exit $stat
fi
@@ -97,20 +126,6 @@ hp)
exit 1
;;
-dashmd)
- # The Java front end to gcc doesn't run cpp, so we can't use the -Wp
- # trick. Instead we must use -M and then rename the resulting .d
- # file. This is also the case for older versions of gcc, which
- # don't implement -Wp.
- if "$@" -MD; then :
- else
- stat=$?
- rm -f FIXME
- exit $stat
- fi
- FIXME: rewrite the file
- ;;
-
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
@@ -120,7 +135,6 @@ sgi)
stat=$?
if test $stat -eq 0; then :
else
- stat=$?
rm -f "$tmpdepfile"
exit $stat
fi
@@ -129,19 +143,60 @@ sgi)
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
- # Clip off the initial element (the dependent). Don't try to be
+ # Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5).
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
tr ' ' '
-' < "$tmpdepfile" | sed 's/^[^\.]*\.o://' | tr '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
' ' ' >> $depfile
+ echo >> $depfile
+ # The second pass generates a dummy entry for each header file.
tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. This file always lives in the current directory.
+ # Also, the AIX compiler puts `$object:' at the start of each line;
+ # $object doesn't have directory information.
+ stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ outname="$stripped.o"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
@@ -151,6 +206,44 @@ sgi)
rm -f "$tmpdepfile"
;;
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+
+ base=`echo "$object" | sed -e 's/\.o$//' -e 's/\.lo$//'`
+ tmpdepfile1="$base.o.d"
+ tmpdepfile2="$base.d"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-MD
+ else
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile1"; then
+ tmpdepfile="$tmpdepfile1"
+ else
+ tmpdepfile="$tmpdepfile2"
+ fi
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a space and a tab in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
@@ -231,7 +324,7 @@ makedepend)
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
- tail +3 "$tmpdepfile" | tr ' ' '
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
@@ -299,6 +392,21 @@ msvisualcpp)
done
;;
esac
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u
\\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
) &
diff -pru gawk-3.1.1/install-sh gawk-3.1.1-autoconf/install-sh
--- gawk-3.1.1/install-sh 1994-12-22 19:52:54.000000000 -0800
+++ gawk-3.1.1-autoconf/install-sh 2002-03-08 04:43:36.000000000 -0800
@@ -1,15 +1,27 @@
#!/bin/sh
#
# install - install a program, script, or datafile
-# This comes from X11R5.
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
# set DOITPROG to echo to test this script
@@ -29,7 +41,7 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
-tranformbasename=""
+transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
@@ -97,7 +109,7 @@ then
echo "install: no input file specified"
exit 1
else
- true
+ :
fi
if [ x"$dir_arg" != x ]; then
@@ -106,8 +118,9 @@ if [ x"$dir_arg" != x ]; then
if [ -d $dst ]; then
instcmd=:
+ chmodcmd=""
else
- instcmd=mkdir
+ instcmd=$mkdirprog
fi
else
@@ -117,7 +130,7 @@ else
if [ -f $src -o -d $src ]
then
- true
+ :
else
echo "install: $src does not exist"
exit 1
@@ -128,7 +141,7 @@ else
echo "install: no destination specified"
exit 1
else
- true
+ :
fi
# If destination is a directory, append the input filename; if your system
@@ -138,7 +151,7 @@ else
then
dst="$dst"/`basename $src`
else
- true
+ :
fi
fi
@@ -150,8 +163,8 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
+defaultIFS='
+ '
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
@@ -170,7 +183,7 @@ while [ $# -ne 0 ] ; do
then
$mkdirprog "${pathcomp}"
else
- true
+ :
fi
pathcomp="${pathcomp}/"
@@ -181,10 +194,10 @@ if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
@@ -203,7 +216,7 @@ else
then
dstfile=`basename $dst`
else
- true
+ :
fi
# Make a temp file name in the proper directory.
@@ -222,10 +235,10 @@ else
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
# Now rename the file to the real destination.
diff -pru gawk-3.1.1/m4/socket.m4 gawk-3.1.1-autoconf/m4/socket.m4
--- gawk-3.1.1/m4/socket.m4 2000-06-23 02:47:55.000000000 -0700
+++ gawk-3.1.1-autoconf/m4/socket.m4 2002-05-20 15:29:41.545546000 -0700
@@ -79,7 +79,7 @@ then
esac
AC_MSG_RESULT([${gawk_lib_loc}])
- AC_DEFINE(HAVE_SOCKETS)
+ AC_DEFINE(HAVE_SOCKETS, 1, [we have sockets on this system])
fi
AC_SUBST(SOCKET_LIBS)dnl
])dnl
diff -pru gawk-3.1.1/m4/strtod.m4 gawk-3.1.1-autoconf/m4/strtod.m4
--- gawk-3.1.1/m4/strtod.m4 2002-04-16 04:57:52.000000000 -0700
+++ gawk-3.1.1-autoconf/m4/strtod.m4 2002-05-20 15:31:01.435385000 -0700
@@ -54,6 +54,6 @@ main ()
gawk_ac_cv_func_strtod_c89=yes, gawk_ac_cv_func_strtod_c89=no,
gawk_ac_cv_func_strtod_c89=no)])
if test $gawk_ac_cv_func_strtod_c89 = no; then
- AC_DEFINE(STRTOD_NOT_C89)
+ AC_DEFINE(STRTOD_NOT_C89, 1, [strtod doesn't have C89 semantics])
fi
])# GAWK_FUNC_STRTOD_C89
diff -pru gawk-3.1.1/missing gawk-3.1.1-autoconf/missing
--- gawk-3.1.1/missing 2000-11-22 05:54:56.000000000 -0800
+++ gawk-3.1.1-autoconf/missing 2002-03-08 04:43:36.000000000 -0800
@@ -18,6 +18,11 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
@@ -25,6 +30,14 @@ fi
run=:
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
@@ -65,7 +78,7 @@ Supported PROGRAM values:
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing 0.3 - GNU automake"
+ echo "missing 0.4 - GNU automake"
;;
-*)
@@ -74,31 +87,46 @@ Supported PROGRAM values:
exit 1
;;
- aclocal)
+ aclocal*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acinclude.m4' or \`configure.in'. You might want
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`configure.in'. You might want to install the
+ you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acconfig.h' or \`configure.in'. You might want
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p'
${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
@@ -111,10 +139,15 @@ WARNING: \`$1' is missing on your system
touch $touch_files
;;
- automake)
+ automake*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
@@ -122,6 +155,34 @@ WARNING: \`$1' is missing on your system
while read f; do touch "$f"; done
;;
+ autom4te)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1Help2man' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
@@ -176,6 +237,11 @@ WARNING: \`$1' is missing on your system
;;
help2man)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
@@ -196,6 +262,11 @@ WARNING: \`$1' is missing on your system
;;
makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
diff -pru gawk-3.1.1/mkinstalldirs gawk-3.1.1-autoconf/mkinstalldirs
--- gawk-3.1.1/mkinstalldirs 1995-08-25 09:59:56.000000000 -0700
+++ gawk-3.1.1-autoconf/mkinstalldirs 2002-03-08 04:44:47.000000000 -0800
@@ -2,25 +2,90 @@
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <address@hidden>
# Created: 1993-05-16
-# Last modified: 1994-03-25
# Public domain
+# $Id: mkinstalldirs,v 1.3 2002/03/08 12:44:47 akim Exp $
+
errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
-for file in ${1+"$@"} ; do
+# process command line arguments
+while test $# -gt 0 ; do
+ case "${1}" in
+ -h | --help | --h* ) # -h for help
+ echo "${usage}" 1>&2; exit 0 ;;
+ -m ) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
+ dirmode="${1}"
+ shift ;;
+ -- ) shift; break ;; # stop option processing
+ -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
+ * ) break ;; # first non-opt arg
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+0) exit 0 ;;
+esac
+
+case $dirmode in
+'')
+ if mkdir -p -- . 2>/dev/null; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ fi ;;
+*)
+ if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ fi ;;
+esac
+
+for file
+do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
- for d in ${1+"$@"} ; do
+ for d
+ do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" || errstatus=$?
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
fi
pathcomp="$pathcomp/"
@@ -29,4 +94,8 @@ done
exit $errstatus
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 3
+# End:
# mkinstalldirs ends here
diff -pru gawk-3.1.1/ylwrap gawk-3.1.1-autoconf/ylwrap
--- gawk-3.1.1/ylwrap 2002-02-19 08:17:37.000000000 -0800
+++ gawk-3.1.1-autoconf/ylwrap 2001-11-11 10:44:57.000000000 -0800
@@ -1,6 +1,6 @@
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
-# Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+# Copyright 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
# Written by Tom Tromey <address@hidden>.
#
# This program is free software; you can redistribute it and/or modify
@@ -44,14 +44,6 @@ case "$input" in
;;
esac
-# The directory holding the input.
-input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
-# Quote $INPUT_DIR so we can use it in a regexp.
-# FIXME: really we should care about more than `.' and `\'.
-input_rx=`echo "$input_dir" | sed -e 's,\\\\,\\\\\\\\,g' -e 's,\\.,\\\\.,g'`
-
-echo "got $input_rx"
-
pairlist=
while test "$#" -ne 0; do
if test "$1" = "--"; then
@@ -94,6 +86,12 @@ if test $status -eq 0; then
y_tab_nodot="yes"
fi
+ # The directory holding the input.
+ input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
+ # Quote $INPUT_DIR so we can use it in a regexp.
+ # FIXME: really we should care about more than `.' and `\'.
+ input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+
while test "$#" -ne 0; do
from="$1"
# Handle y_tab.c and y_tab.h output by DOS
@@ -114,11 +112,24 @@ if test $status -eq 0; then
*) target="../$2";;
esac
- # Edit out `#line' or `#' directives. We don't want the
- # resulting debug information to point at an absolute srcdir;
- # it is better for it to just mention the .y file with no
- # path.
- sed -e "/^#/ s,$input_rx,," "$from" > "$target" || status=$?
+ # Edit out `#line' or `#' directives.
+ #
+ # We don't want the resulting debug information to point at
+ # an absolute srcdir; it is better for it to just mention the
+ # .y file with no path.
+ #
+ # We want to use the real output file name, not yy.lex.c for
+ # instance.
+ #
+ # We want the include guards to be adjusted too.
+ FROM=`echo "$from" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+ TARGET=`echo "$2" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+ sed "/^#/{s,$input_rx,,;s,$from,$2,;s,$FORM,$TO,;}" "$from"
>"$target" ||
+ status=$?
else
# A missing file is only an error for the first file. This
# is a blatant hack to let us support using "yacc -d". If -d