randyk 2003/12/03 01:09:33
Modified: win32 Configure.pl libapreq2.mak mod_apreq.mak
test_cgi.mak testall.mak
Log:
use (apr|apu)-config utilities to get the names of the apr/aprutil libs.
Revision Changes Path
1.28 +26 -8 httpd-apreq-2/win32/Configure.pl
Index: Configure.pl
===================================================================
RCS file: /home/cvs/httpd-apreq-2/win32/Configure.pl,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- Configure.pl 3 Dec 2003 05:21:16 -0000 1.27
+++ Configure.pl 3 Dec 2003 09:09:33 -0000 1.28
@@ -3,7 +3,7 @@
use warnings;
use FindBin;
use Getopt::Long;
-require File::Spec;
+use File::Spec::Functions qw(devnull catfile catdir path);
use Cwd;
require Win32;
use ExtUtils::MakeMaker;
@@ -39,11 +39,29 @@
chdir $apreq_home;
}
+my %apr_libs;
+my %map = (apr => 'libapr.lib', apu => 'libaprutil.lib');
+my $devnull = devnull();
+foreach (qw(apr apu)) {
+ my $cfg = catfile $apache, 'bin', "$_.bat";
+ $cfg =~ s!\\!/!g;
+ my $lib;
+ eval {$lib = qx{"$cfg" --$_-lib-file 2>$devnull;}};
+ if ($@ or not $lib or $lib =~ /usage/i) {
+ $apr_libs{$_} = catfile $apache, 'lib', $map{$_};
+ }
+ else {
+ $apr_libs{$_} = chomp $lib;
+ }
+}
+
open(my $make, '>Makefile') or die qq{Cannot open Makefile: $!};
print $make <<"END";
# Microsoft Developer Studio Generated NMAKE File.
APREQ_HOME=$apreq_home
+APR_LIB=$apr_libs{apr}
+APU_LIB=$apr_libs{apu}
CFG=$cfg
APACHE=$apache
PERL=$^X
@@ -61,11 +79,11 @@
my $test = << 'END';
TEST: $(LIBAPREQ) $(MOD)
- $(MAKE) /nologo /f $(CFG_HOME)\$(TESTALL).mak CFG="$(TESTALL) - Win32
$(CFG)" APACHE="$(APACHE)" APREQ_HOME="$(APREQ_HOME)"
+ $(MAKE) /nologo /f $(CFG_HOME)\$(TESTALL).mak CFG="$(TESTALL) - Win32
$(CFG)" APACHE="$(APACHE)" APREQ_HOME="$(APREQ_HOME)" APR_LIB="$(APR_LIB)"
APU_LIB="$(APU_LIB)"
set PATH=%PATH%;$(APACHE)\bin;$(APREQ_HOME)\win32\libs
cd $(LIBDIR) && $(TESTALL).exe -v
cd $(APREQ_HOME)
- $(MAKE) /nologo /f $(CFG_HOME)\$(CGITEST).mak CFG="$(CGITEST) - Win32
$(CFG)" APACHE="$(APACHE)" APREQ_HOME="$(APREQ_HOME)"
+ $(MAKE) /nologo /f $(CFG_HOME)\$(CGITEST).mak CFG="$(CGITEST) - Win32
$(CFG)" APACHE="$(APACHE)" APREQ_HOME="$(APREQ_HOME)" APR_LIB="$(APR_LIB)"
APU_LIB="$(APU_LIB)"
copy $(LIBDIR)\test_cgi.exe $(APREQ_ENV)\t\cgi-bin\test_cgi.exe
cd $(APREQ_HOME)
END
@@ -251,13 +269,13 @@
for my $drive (@drives) {
for ('Apache2', 'Program Files/Apache2',
'Program Files/Apache Group/Apache2') {
- my $bin = File::Spec->catpath($drive, $_, 'bin');
+ my $bin = catdir $drive, $_, 'bin';
push @extras, $bin if (-d $bin);
}
}
}
- my @a = map {File::Spec->catfile($_, $program) }
- (File::Spec->path(), @extras);
+ my @a = map {catfile $_, $program}
+ (path(), @extras);
for my $base(@a) {
return $base if -x $base;
for my $ext (@path_ext) {
@@ -404,10 +422,10 @@
ALL : "$(LIBAPREQ)"
$(LIBAPREQ):
- $(MAKE) /nologo /f $(CFG_HOME)\$(LIBAPREQ).mak CFG="$(LIBAPREQ) - Win32
$(CFG)" APACHE="$(APACHE)" APREQ_HOME="$(APREQ_HOME)"
+ $(MAKE) /nologo /f $(CFG_HOME)\$(LIBAPREQ).mak CFG="$(LIBAPREQ) - Win32
$(CFG)" APACHE="$(APACHE)" APREQ_HOME="$(APREQ_HOME)" APR_LIB="$(APR_LIB)"
APU_LIB="$(APU_LIB)"
$(MOD): $(LIBAPREQ)
- $(MAKE) /nologo /f $(CFG_HOME)\$(MOD).mak CFG="$(MOD) - Win32 $(CFG)"
APACHE="$(APACHE)" APREQ_HOME="$(APREQ_HOME)"
+ $(MAKE) /nologo /f $(CFG_HOME)\$(MOD).mak CFG="$(MOD) - Win32 $(CFG)"
APACHE="$(APACHE)" APREQ_HOME="$(APREQ_HOME)" APR_LIB="$(APR_LIB)"
APU_LIB="$(APU_LIB)"
PERL_GLUE: $(MOD)
cd $(PERLGLUE)
1.4 +26 -5 httpd-apreq-2/win32/libapreq2.mak
Index: libapreq2.mak
===================================================================
RCS file: /home/cvs/httpd-apreq-2/win32/libapreq2.mak,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- libapreq2.mak 5 Nov 2003 23:26:07 -0000 1.3
+++ libapreq2.mak 3 Dec 2003 09:09:33 -0000 1.4
@@ -3,7 +3,28 @@
!IF "$(APACHE)" == ""
!MESSAGE No Apache directory was specified.
!MESSAGE This makefile is not to be run directly.
-!MESSAGE Please run Configure.bat, and then $(MAKE) on Makefile.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
+!ERROR
+!ENDIF
+
+!IF "$(APR_LIB)" == ""
+!MESSAGE No apr lib was specified.
+!MESSAGE This makefile is not to be run directly.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
+!ERROR
+!ENDIF
+
+!IF "$(APU_LIB)" == ""
+!MESSAGE No aprutil lib was specified.
+!MESSAGE This makefile is not to be run directly.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
+!ERROR
+!ENDIF
+
+!IF "$(APACHE)" == ""
+!MESSAGE No Apache directory was specified.
+!MESSAGE This makefile is not to be run directly.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
!ERROR
!ENDIF
@@ -59,8 +80,8 @@
"$(INTDIR)\apreq_params.obj" \
"$(INTDIR)\apreq_parsers.obj" \
"$(INTDIR)\apreq_env.obj" \
- "$(APACHE)\lib\libapr.lib" \
- "$(APACHE)\lib\libaprutil.lib"
+ "$(APR_LIB)" \
+ "$(APU_LIB)"
"$(OUTDIR)\libapreq2.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
@@ -86,8 +107,8 @@
"$(INTDIR)\apreq_params.obj" \
"$(INTDIR)\apreq_parsers.obj" \
"$(INTDIR)\apreq_env.obj" \
- "$(APACHE)\lib\libapr.lib" \
- "$(APACHE)\lib\libaprutil.lib"
+ "$(APR_LIB)" \
+ "$(APU_LIB)"
"$(OUTDIR)\libapreq2.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
1.8 +19 -5 httpd-apreq-2/win32/mod_apreq.mak
Index: mod_apreq.mak
===================================================================
RCS file: /home/cvs/httpd-apreq-2/win32/mod_apreq.mak,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- mod_apreq.mak 27 Oct 2003 06:55:24 -0000 1.7
+++ mod_apreq.mak 3 Dec 2003 09:09:33 -0000 1.8
@@ -3,7 +3,21 @@
!IF "$(APACHE)" == ""
!MESSAGE No Apache directory was specified.
!MESSAGE This makefile is not to be run directly.
-!MESSAGE Please run Configure.bat, and then $(MAKE) on Makefile.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
+!ERROR
+!ENDIF
+
+!IF "$(APR_LIB)" == ""
+!MESSAGE No apr lib was specified.
+!MESSAGE This makefile is not to be run directly.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
+!ERROR
+!ENDIF
+
+!IF "$(APU_LIB)" == ""
+!MESSAGE No aprutil lib was specified.
+!MESSAGE This makefile is not to be run directly.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
!ERROR
!ENDIF
@@ -56,8 +70,8 @@
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)\mod_apreq.so" /implib:"$(OUTDIR)\mod_apreq.lib"
LINK32_OBJS= \
"$(INTDIR)\mod_apreq.obj" \
- "$(APACHE)\lib\libapr.lib" \
- "$(APACHE)\lib\libaprutil.lib" \
+ "$(APR_LIB)" \
+ "$(APU_LIB)" \
"$(APACHE)\lib\libhttpd.lib" \
"$(OUTDIR)\libapreq2.lib"
@@ -81,8 +95,8 @@
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:yes /pdb:"$(OUTDIR)\mod_apreq.pdb"
/debug /machine:I386 /out:"$(OUTDIR)\mod_apreq.so"
/implib:"$(OUTDIR)\mod_apreq.lib" /pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\mod_apreq.obj" \
- "$(APACHE)\lib\libapr.lib" \
- "$(APACHE)\lib\libaprutil.lib" \
+ "$(APR_LIB)" \
+ "$(APU_LIB)" \
"$(APACHE)\lib\libhttpd.lib" \
"$(OUTDIR)\libapreq2.lib"
1.6 +19 -5 httpd-apreq-2/win32/test_cgi.mak
Index: test_cgi.mak
===================================================================
RCS file: /home/cvs/httpd-apreq-2/win32/test_cgi.mak,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- test_cgi.mak 27 Oct 2003 06:55:24 -0000 1.5
+++ test_cgi.mak 3 Dec 2003 09:09:33 -0000 1.6
@@ -3,7 +3,21 @@
!IF "$(APACHE)" == ""
!MESSAGE No Apache directory was specified.
!MESSAGE This makefile is not to be run directly.
-!MESSAGE Please run Configure.bat, and then $(MAKE) on Makefile.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
+!ERROR
+!ENDIF
+
+!IF "$(APR_LIB)" == ""
+!MESSAGE No apr lib was specified.
+!MESSAGE This makefile is not to be run directly.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
+!ERROR
+!ENDIF
+
+!IF "$(APU_LIB)" == ""
+!MESSAGE No aprutil lib was specified.
+!MESSAGE This makefile is not to be run directly.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
!ERROR
!ENDIF
@@ -84,8 +98,8 @@
LINK32_OBJS= \
"$(INTDIR)\test_cgi.obj" \
"$(OUTDIR)\libapreq2.lib" \
- "$(APACHE)\lib\libapr.lib" \
- "$(APACHE)\lib\libaprutil.lib"
+ "$(APR_LIB)" \
+ "$(APU_LIB)"
"$(OUTDIR)\test_cgi.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
@@ -140,8 +154,8 @@
LINK32_OBJS= \
"$(INTDIR)\test_cgi.obj" \
"$(OUTDIR)\libapreq2.lib" \
- "$(APACHE)\lib\libapr.lib" \
- "$(APACHE)\lib\libaprutil.lib"
+ "$(APR_LIB)" \
+ "$(APU_LIB)"
"$(OUTDIR)\test_cgi.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
1.9 +19 -5 httpd-apreq-2/win32/testall.mak
Index: testall.mak
===================================================================
RCS file: /home/cvs/httpd-apreq-2/win32/testall.mak,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- testall.mak 27 Oct 2003 06:55:24 -0000 1.8
+++ testall.mak 3 Dec 2003 09:09:33 -0000 1.9
@@ -3,7 +3,21 @@
!IF "$(APACHE)" == ""
!MESSAGE No Apache directory was specified.
!MESSAGE This makefile is not to be run directly.
-!MESSAGE Please run Configure.bat, and then $(MAKE) on Makefile.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
+!ERROR
+!ENDIF
+
+!IF "$(APR_LIB)" == ""
+!MESSAGE No apr lib was specified.
+!MESSAGE This makefile is not to be run directly.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
+!ERROR
+!ENDIF
+
+!IF "$(APU_LIB)" == ""
+!MESSAGE No aprutil lib was specified.
+!MESSAGE This makefile is not to be run directly.
+!MESSAGE Please use Perl Makefile.PL, and then $(MAKE) on Makefile.
!ERROR
!ENDIF
@@ -87,8 +101,8 @@
"$(INTDIR)\params.obj" \
"$(INTDIR)\testall.obj" \
"$(OUTDIR)\libapreq2.lib" \
- "$(APACHE)\lib\libapr.lib" \
- "$(APACHE)\lib\libaprutil.lib" \
+ "$(APR_LIB)" \
+ "$(APU_LIB)" \
"$(APACHE)\lib\libhttpd.lib" \
"$(INTDIR)\parsers.obj"
@@ -148,8 +162,8 @@
"$(INTDIR)\params.obj" \
"$(INTDIR)\testall.obj" \
"$(OUTDIR)\libapreq2.lib" \
- "$(APACHE)\lib\libapr.lib" \
- "$(APACHE)\lib\libaprutil.lib" \
+ "$(APR_LIB)" \
+ "$(APU_LIB)" \
"$(APACHE)\lib\libhttpd.lib" \
"$(INTDIR)\parsers.obj"