Bug 34915

Summary: Installing Apache 2.1.5-dev using Makefile.win fails
Product: Apache httpd-2 Reporter: James Park <pencilethics>
Component: BuildAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED FIXED    
Severity: minor Keywords: PatchAvailable
Priority: P2    
Version: 2.1-HEAD   
Target Milestone: ---   
Hardware: PC   
OS: Windows Server 2003   
Attachments: Patch to Makefile.win
Patch to Makefile.win (edited)

Description James Park 2005-05-14 03:57:04 UTC
Errors in the _install target (which is called by installd and installr) of
Makefile.win in trunk (Revision 170110 - 2.1.5-dev) prevent a successful
install; a trivial error in the configuration copying portion causes nmake to
choke when copying httpd-dav.conf to the install location. This error is only
visible on a "fresh" install; the error-causing lines that cause nmake to choke
are behind "if not exists" clauses. Some additional flaws cause unnecessary
duplicate configuration files (which do not get processed by awk) to be copied
to $(INSTDIR)\conf\original.

The erroneous lines are 678-679, 664, 680, 696, 712, 728, 749, 766, 783, 786,
789 and 792. If you compare lines 678-679 with lines 694-695 you will notice
that they are identical, and careful analysis tells you that 678-679 should be
referring to httpd-autoindex.conf, not httpd-dav.conf (since httpd-dav.conf does
not exist when these lines are processed); the remaining lines copy the extra
configuration files to the incorrect location and as a result the following
lines look for them in the wrong place, producing unnecessary duplicates which
do not get processed with awk. Careful scrutiny should point out that the
offending lines should be copying the files to $(INSTDIR)\conf\original\extra,
not $(INSTDIR)\conf\original.

To avoid irritating Win32 users who compile and install from source, these
problems should be fixed. (However the only "critical" error which halts the
build process is present in lines 678-679.)

Steps to Reproduce:

1) Checkout trunk and APR (apr, apr-iconv, apr-util) from SVN repository
(Revision 170114 as of writing)
2) Build OpenSSL 0.9.7g (for mod_ssl) and zlib 1.2.2 (for mod_deflate) and copy
into srclib.
3) Open Apache.dsw in Visual C++ 6.0 and export makefiles.
4) nmake /f Makefile.win installr INSTDIR=C:\Somefolder
5) Error results during file copying - nmake halts with something to the effect
of "NMAKE Stop: copy returned 0x1 - httpd-dav.conf does not exist"

installd should produce the same error, since it also calls the _install target.

Using:
1) Windows Server 2003 SP1
2) Platform SDK for Windows XP SP2
3) Visual C++ 6.0 SP6
Comment 1 James Park 2005-05-14 03:59:19 UTC
Created attachment 15027 [details]
Patch to Makefile.win
Comment 2 James Park 2005-05-14 10:58:36 UTC
Comment on attachment 15027 [details]
Patch to Makefile.win

><HTML imagetoolbarenabled="true"><HEAD/><BODY><PRE>--- Makefile.win	2005-05-13 00:35:33.203125000 +1200
>+++ Makefile.win	2005-05-14 12:59:49.937500000 +1200
>@@ -661,7 +661,7 @@
> <<
> 	if not exist "$(INSTDIR)\conf\httpd.conf" \
> 	    copy "$(INSTDIR)\conf\original\httpd.conf" "$(INSTDIR)\conf\httpd.conf"
>-	copy docs\conf\extra\httpd-autoindex.conf.in "$(INSTDIR)\conf\original\httpd-autoindex.conf" <.y
>+	copy docs\conf\extra\httpd-autoindex.conf.in "$(INSTDIR)\conf\original\extra\httpd-autoindex.conf" <.y
> 	-awk -f <<script.awk "docs/conf/extra/httpd-autoindex.conf.in" "$(INSTDIR)" > "$(INSTDIR)\conf\original\extra\httpd-autoindex.conf"
>     BEGIN { 
> 	serverroot = ARGV[2];
>@@ -675,9 +675,9 @@
> 	print $$0;
>     }
> <<
>-	if not exist "$(INSTDIR)\conf\extra\httpd-dav.conf" \
>-	    copy "$(INSTDIR)\conf\original\extra\httpd-dav.conf" "$(INSTDIR)\conf\extra\httpd-dav.conf"
>-	copy docs\conf\extra\httpd-dav.conf.in "$(INSTDIR)\conf\original\httpd-dav.conf" <.y
>+	if not exist "$(INSTDIR)\conf\extra\httpd-autoindex.conf" \
>+	    copy "$(INSTDIR)\conf\original\extra\httpd-autoindex.conf" "$(INSTDIR)\conf\extra\httpd-autoindex.conf"
>+	copy docs\conf\extra\httpd-dav.conf.in "$(INSTDIR)\conf\original\extra\httpd-dav.conf" <.y
> 	-awk -f <<script.awk "docs/conf/extra/httpd-dav.conf.in" "$(INSTDIR)" > "$(INSTDIR)\conf\original\extra\httpd-dav.conf"
>     BEGIN { 
> 	serverroot = ARGV[2];
>@@ -693,7 +693,7 @@
> <<
> 	if not exist "$(INSTDIR)\conf\extra\httpd-dav.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-dav.conf" "$(INSTDIR)\conf\extra\httpd-dav.conf"
>-	copy docs\conf\extra\httpd-manual.conf.in "$(INSTDIR)\conf\original\httpd-manual.conf" <.y
>+	copy docs\conf\extra\httpd-manual.conf.in "$(INSTDIR)\conf\original\extra\httpd-manual.conf" <.y
> 	-awk -f <<script.awk "docs/conf/extra/httpd-manual.conf.in" "$(INSTDIR)" > "$(INSTDIR)\conf\original\extra\httpd-manual.conf"
>     BEGIN { 
> 	serverroot = ARGV[2];
>@@ -709,7 +709,7 @@
> <<
> 	if not exist "$(INSTDIR)\conf\extra\httpd-manual.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-manual.conf" "$(INSTDIR)\conf\extra\httpd-manual.conf"
>-	copy docs\conf\extra\httpd-multilang-errordoc.conf.in "$(INSTDIR)\conf\original\httpd-multilang-errordoc.conf" <.y
>+	copy docs\conf\extra\httpd-multilang-errordoc.conf.in "$(INSTDIR)\conf\original\extra\httpd-multilang-errordoc.conf" <.y
> 	-awk -f <<script.awk "docs/conf/extra/httpd-multilang-errordoc.conf.in" "$(INSTDIR)" > "$(INSTDIR)\conf\original\extra\httpd-multilang-errordoc.conf"
>     BEGIN { 
> 	serverroot = ARGV[2];
>@@ -725,7 +725,7 @@
> <<
> 	if not exist "$(INSTDIR)\conf\extra\httpd-multilang-errordoc.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-multilang-errordoc.conf" "$(INSTDIR)\conf\extra\httpd-multilang-errordoc.conf"
>-	copy docs\conf\extra\httpd-ssl.conf.in "$(INSTDIR)\conf\original\httpd-ssl.conf" <.y
>+	copy docs\conf\extra\httpd-ssl.conf.in "$(INSTDIR)\conf\original\extra\httpd-ssl.conf" <.y
> 	-awk -f <<script.awk "docs/conf/extra/httpd-ssl.conf.in" "$(INSTDIR)" > "$(INSTDIR)\conf\original\extra\httpd-ssl.conf"
>     BEGIN { 
> 	serverroot = ARGV[2];
>@@ -746,7 +746,7 @@
> <<
> 	if not exist "$(INSTDIR)\conf\extra\httpd-ssl.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-ssl.conf" "$(INSTDIR)\conf\extra\httpd-ssl.conf"
>-	copy docs\conf\extra\httpd-userdir.conf.in "$(INSTDIR)\conf\original\httpd-userdir.conf" <.y
>+	copy docs\conf\extra\httpd-userdir.conf.in "$(INSTDIR)\conf\original\extra\httpd-userdir.conf" <.y
> 	-awk -f <<script.awk "docs/conf/extra/httpd-userdir.conf.in" "$(INSTDIR)" > "$(INSTDIR)\conf\original\extra\httpd-userdir.conf"
>     BEGIN { 
> 	serverroot = ARGV[2];
>@@ -763,7 +763,7 @@
> <<
> 	if not exist "$(INSTDIR)\conf\extra\httpd-userdir.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-userdir.conf" "$(INSTDIR)\conf\extra\httpd-userdir.conf"
>-	copy docs\conf\extra\httpd-mpm.conf.in "$(INSTDIR)\conf\original\httpd-mpm.conf" <.y
>+	copy docs\conf\extra\httpd-mpm.conf.in "$(INSTDIR)\conf\original\extra\httpd-mpm.conf" <.y
> 	-awk -f <<script.awk "docs/conf/extra/httpd-mpm.conf.in" "$(INSTDIR)" > "$(INSTDIR)\conf\original\extra\httpd-mpm.conf"
>     BEGIN { 
> 	serverroot = ARGV[2];
>@@ -780,16 +780,16 @@
> <<
> 	if not exist "$(INSTDIR)\conf\extra\httpd-mpm.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-mpm.conf" "$(INSTDIR)\conf\extra\httpd-mpm.conf"
>-	copy docs\conf\extra\httpd-default.conf.in "$(INSTDIR)\conf\original\httpd-default.conf" <.y
>+	copy docs\conf\extra\httpd-default.conf.in "$(INSTDIR)\conf\original\extra\httpd-default.conf" <.y
> 	if not exist "$(INSTDIR)\conf\extra\httpd-default.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-default.conf" "$(INSTDIR)\conf\extra\httpd-default.conf"
>-	copy docs\conf\extra\httpd-info.conf.in "$(INSTDIR)\conf\original\httpd-info.conf" <.y
>+	copy docs\conf\extra\httpd-info.conf.in "$(INSTDIR)\conf\original\extra\httpd-info.conf" <.y
> 	if not exist "$(INSTDIR)\conf\extra\httpd-info.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-info.conf" "$(INSTDIR)\conf\extra\httpd-info.conf"
>-	copy docs\conf\extra\httpd-languages.conf.in "$(INSTDIR)\conf\original\httpd-languages.conf" <.y
>+	copy docs\conf\extra\httpd-languages.conf.in "$(INSTDIR)\conf\original\extra\httpd-languages.conf" <.y
> 	if not exist "$(INSTDIR)\conf\extra\httpd-languages.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-languages.conf" "$(INSTDIR)\conf\extra\httpd-languages.conf"
>-	copy docs\conf\extra\httpd-vhosts.conf.in "$(INSTDIR)\conf\original\httpd-vhosts.conf" <.y
>+	copy docs\conf\extra\httpd-vhosts.conf.in "$(INSTDIR)\conf\original\extra\httpd-vhosts.conf" <.y
> 	if not exist "$(INSTDIR)\conf\extra\httpd-vhosts.conf" \
> 	    copy "$(INSTDIR)\conf\original\extra\httpd-vhosts.conf" "$(INSTDIR)\conf\extra\httpd-vhosts.conf"
> 	-awk -f <<script.awk "support/dbmmanage.in" >"$(INSTDIR)\bin\dbmmanage.pl"
Comment 3 James Park 2005-05-14 11:02:17 UTC
Created attachment 15028 [details]
Patch to Makefile.win (edited)

Please ignore comment #2 - I messed up editing the attachment.
Comment 4 Paul Querna 2005-12-06 07:43:34 UTC
Makefile.win has been fixed up in 2.2.0 w/ patches.