>Number: 2319
>Category: config
>Synopsis: last awk script in configure breaks with braindead awks
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Fri May 29 13:20:00 PDT 1998
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.3b7
>Environment:
At least UTS 2.1.2 and IRIX 5.3
>Description:
There's an awk script in the "configure" program that tries to break up
sed scripts to get around braindead seds. Unfortunately, it breaks on
braindead awks!
>How-To-Repeat:
Extract the awk script out of configure and try it on some scratch files.
>Fix:
On IRIX 5.3, it is sufficient to change the input file from being sent to it
via standard input to instead be a parameter at the end of the awk command line.
UTS 2.1.2, however, has another problem in that the >$file overwrites the file
on every line so each file only contains the last line. The only solution I
could think of was to use nawk if it is available. This fixes the IRIX 5.3
problem too. A patch is below. There are many other problems specific to
UTS 2.1.2 only but I am going to submit those in a separate report.
*** configure.O Wed May 27 15:19:29 1998
--- configure Wed May 27 15:59:35 1998
***************
*** 134,139 ****
--- 134,155 ----
PERL="`echo $PERL | sed -e 's://:/:'`"
##
+ ## look for a nawk because some awks are braindead
+ ##
+
+ AWK=awk
+ OIFS="$IFS" IFS=':'
+ for dir in $PATH; do
+ OIFS2="$IFS" IFS="$DIFS"
+ if test -x "$dir/nawk"; then
+ AWK="$dir/nawk"
+ break 2
+ fi
+ IFS="$OIFS2"
+ done
+ IFS="$OIFS"
+
+ ##
## determine default parameters
##
***************
*** 267,273 ****
;;
--shadow)
# determine GNU platform triple
! gnutriple=`$aux/GuessOS | awk '{ printf("%s",$1); }' | sed -e
's:/:-:g'`
# create Makefile wrapper (the first time only)
if [ ".`ls $top/src.* 2>/dev/null`" = . ]; then
if [ .$quiet = .no ]; then
--- 283,289 ----
;;
--shadow)
# determine GNU platform triple
! gnutriple=`$aux/GuessOS | $AWK '{ printf("%s",$1); }' | sed -e
's:/:-:g'`
# create Makefile wrapper (the first time only)
if [ ".`ls $top/src.* 2>/dev/null`" = . ]; then
if [ .$quiet = .no ]; then
***************
*** 277,283 ****
echo "## Apache Makefile (shadow wrapper)" >> Makefile
echo "##" >> Makefile
echo "" >> Makefile
! echo "GNUTRIPLE=\`$aux/GuessOS | awk '{ printf(\"%s\",\$\$1);
}' | sed -e 's:/:-:g'\`" >> Makefile
echo "" >> Makefile
echo "all build install install-quiet clean distclean:" >>
Makefile
echo " @\$(MAKE) -f Makefile.\$(GNUTRIPLE) \$(MFLAGS)
\$@" >> Makefile
--- 293,299 ----
echo "## Apache Makefile (shadow wrapper)" >> Makefile
echo "##" >> Makefile
echo "" >> Makefile
! echo "GNUTRIPLE=\`$aux/GuessOS | $AWK '{
printf(\"%s\",\$\$1); }' | sed -e 's:/:-:g'\`" >> Makefile
echo "" >> Makefile
echo "all build install install-quiet clean distclean:" >>
Makefile
echo " @\$(MAKE) -f Makefile.\$(GNUTRIPLE) \$(MFLAGS)
\$@" >> Makefile
***************
*** 936,942 ****
# split sedsubst into chunks of 50 commands
# to workaround limits in braindead seds
! files=`awk <$sedsubst '
BEGIN { line=0; cnt=0; }
{
if (line % 50 == 0) {
--- 952,958 ----
# split sedsubst into chunks of 50 commands
# to workaround limits in braindead seds
! files=`$AWK <$sedsubst '
BEGIN { line=0; cnt=0; }
{
if (line % 50 == 0) {
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]