Bug 15679 - configure broken if layout begins on first line of config.layout
Summary: configure broken if layout begins on first line of config.layout
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Build (show other bugs)
Version: 2.0.43
Hardware: Other Linux
: P3 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
: 15678 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-12-27 07:35 UTC by Seth W. Klein
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
patch to acinclude.m4 to fix sed program used to parse config.layout (382 bytes, patch)
2002-12-27 07:38 UTC, Seth W. Klein
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Seth W. Klein 2002-12-27 07:35:00 UTC
The configure script is broken if the selected layout begins on the first
line of config.layout.

To reproduce:

cd httpd-2.0.43
mv config.layout config.layout.orig
sed -n '13,34p' config.layout.orig | tee config.layout
./configure
# the result is an exceedingly unobvious error from the APR sub configure
# script which complains about "--bindir: NONE/bin"
sed -n '12,34p' config.layout.orig | tee config.layout
./configure
# works

This is with GNU Sed 4.0.4 which is relevent because the problem is with the
sed program that configure uses to parse config.layout.

The following patch (which i will also attach, if the system lets me) fixes
the problem for me.

--- acinclude.m4.orig	2002-12-27 01:26:56.000000000 -0500
+++ acinclude.m4	2002-12-27 01:27:28.000000000 -0500
@@ -275,7 +275,7 @@
   fi
   pldconf=./config.pld
   changequote({,})
-  sed -e "1,/[ 	]*<[lL]ayout[ 	]*$2[ 	]*>[ 	]*/d" \
+  sed -e "0,/[ 	]*<[lL]ayout[ 	]*$2[ 	]*>[ 	]*/d" \
       -e '/[ 	]*<\/Layout>[ 	]*/,$d' \
       -e "s/^[ 	]*//g" \
       -e "s/:[ 	]*/=\'/g" \

I am tempted to indulge in a rant about the wisdom of using configure args
instead of weird config files in this situation but this bug report is hardly
the place.

I will however indulge in a suggestion. Something like:
if [ ! -s "$pldconf" ];then
    echo "*** Error: unable to find layout \"$LAYOUT\""
    exit 1
fi
at the logical place would give a much clearer error message.
Comment 1 Seth W. Klein 2002-12-27 07:38:19 UTC
Created attachment 4274 [details]
patch to acinclude.m4 to fix sed program used to parse config.layout
Comment 2 Jeff Trawick 2003-02-10 17:34:05 UTC
*** Bug 15678 has been marked as a duplicate of this bug. ***
Comment 3 Justin Erenkrantz 2003-02-17 02:39:00 UTC
Adding the 0, causes the leading parts of the files to still be included.  I finally figured out what the  right sed invocation was and committed a fix.

httpd-2.0: acinclude.m4 r1.136, configure.in r1.244
apr: build/apr_common.m4: 1.52

Note that it is really unlikely that this will be backported to 2.0 though.

Thanks for using Apache HTTP Server!