httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Ananiev" <anan...@thegdb.com>
Subject [PATCH] Fix more build issues
Date Mon, 19 May 2008 19:10:03 GMT
(i've sent this earlier but seems like it didn't reach the list)

Currently if apache2.2 doesn't have apxs installed (win32)
the configure script will pick the wrong libapr
and libaprutil. This patch also fixes two errors in win32/libapreq2.mak


Index: win32/Configure.pl
===================================================================
--- win32/Configure.pl (revision 657565)
+++ win32/Configure.pl (working copy)
@@ -37,12 +37,17 @@
 generate_tests($apreq_home, \@tests);

 my %apr_libs;
-my %map = (apr => 'libapr.lib', apu => 'libaprutil.lib');
+my $prog = apache_prog_name($apache);
+my @httpd_ver = httpd_version($prog);
 my $devnull = devnull();
+my %map =
+(
+    apr => $httpd_ver[1] == 2 ? 'libapr-1.lib' : 'libapr.lib',
+    apu => $httpd_ver[1] == 2 ? 'libaprutil-1.lib' : 'libaprutil.lib'
+);

-my $prog = apache_prog_name($apache);
 foreach my $what (qw(apr apu)) {
-    my $ap = ($prog eq 'httpd.exe') ?
+    my $ap = ($httpd_ver[1] == 2) ?
         "$what-1-config.bat" : "$what-config.bat";
     my $cfg = catfile $apache, 'bin', $ap;
     my $lib;
@@ -308,6 +313,15 @@
     return;
 }

+sub httpd_version
+{
+    my $prog = shift;
+    my $vers = qx{$prog -v};
+    die qq{Could not parse "$apache" version}
+        unless $vers =~ m!Apache/2.(\d).(\d)!;
+    return (2, $1, $2);
+}
+
 sub generate_defs {
     my $preamble =<<'END';
 LIBRARY
Index: win32/libapreq2.mak
===================================================================
--- win32/libapreq2.mak (revision 657565)
+++ win32/libapreq2.mak (working copy)
@@ -68,9 +68,7 @@
  "$(INTDIR)\module_custom.obj" \
  "$(INTDIR)\module_cgi.obj" \
  "$(INTDIR)\error.obj" \
- "$(INTDIR)\libapreq.res \
- "$(APR_LIB)" \
- "$(APU_LIB)"
+ "$(INTDIR)\libapreq.res"

 !IF  "$(CFG)" == "libapreq2 - Win32 Release"

@@ -87,7 +85,7 @@
 BSC32_FLAGS=/nologo /o"$(OUTDIR)\libapreq2.bsc"
 LINK32=link.exe
 MANIFEST=$(OUTDIR)\libapreq2.dll.manifest
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
odbccp32.lib /nologo /dll /incremental:no /machine:I386 
/out:"$(OUTDIR)\libapreq2.dll" /implib:"$(OUTDIR)\libapreq2.lib"
+LINK32_FLAGS="$(APR_LIB)" "$(APU_LIB)" kernel32.lib user32.lib gdi32.lib 
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib 
uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /machine:I386 
/out:"$(OUTDIR)\libapreq2.dll" /implib:"$(OUTDIR)\libapreq2.lib"

 "$(OUTDIR)\libapreq2.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
     $(LINK32) @<<




Mime
View raw message