dougm 00/04/15 10:38:45
Modified: . Makefile.PL
lib/Apache Build.pm
Log:
fix libgdbm check logic
move some re-usable things to Apache::Build
Revision Changes Path
1.4 +3 -35 modperl-2.0/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Makefile.PL 2000/04/14 23:52:52 1.3
+++ Makefile.PL 2000/04/15 17:38:44 1.4
@@ -110,24 +110,6 @@
close $fh;
}
-sub phat_warn {
- my($msg, $abort) = @_;
- my $level = $abort ? 'ERROR' : 'WARNING';
- warn <<EOF;
-************* $level *************
-
- $msg
-
-************* $level *************
-EOF
- if ($abort) {
- exit 1;
- }
- else {
- sleep 5;
- }
-}
-
sub system_sanity_check {
return if $build->is_win32;
@@ -136,7 +118,7 @@
next unless s/^-I//;
my $header = "$_/ap_mmn.h";
if (-e $header) {
- phat_warn(<<EOF);
+ $build->phat_warn(<<EOF);
Apache headers found in unexpected location: ``$_'', suggestions:
*) Remove via ``rpm -e apache''
*) Remove by hand
@@ -146,24 +128,10 @@
}
}
- gdbm_check();
+ $build->lib_check('gdbm');
malloc_check();
}
-sub gdbm_check {
- return if $build->find_dlfile('gdbm');
-
- my $maybe = $build->find_dlfile_maybe('gdbm');
- my $suggest = @$maybe ?
- "You could just symlink it to $maybe->[0]" :
- 'You might need to install Perl from source';
- phat_warn(<<EOF);
-Your Perl is configured to link against libgdbm,
- but libgdbm.so was not found.
- $suggest
-EOF
-}
-
sub malloc_check {
return unless $build->is_dynamic;
return unless $build->perl_config('usemymalloc') eq 'y';
@@ -173,7 +141,7 @@
my $bincompat = $build->perl_config('bincompat5005');
if ($bincompat) {
- phat_warn(<<EOF, $abort);
+ $build->phat_warn(<<EOF, $abort);
Your current configuration will most likely trigger core dumps, suggestions:
*) Do not configure mod_perl as a DSO
*) Rebuild Perl without malloc pollution (Configure -Ubincompat5005)
1.3 +36 -3 modperl-2.0/lib/Apache/Build.pm
Index: Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Build.pm 2000/04/14 04:09:25 1.2
+++ Build.pm 2000/04/15 17:38:45 1.3
@@ -86,8 +86,6 @@
sub find_dlfile {
my($self, $name) = @_;
- return '' unless $Config{'libs'} =~ /$name/;
-
require DynaLoader;
require AutoLoader; #eek
@@ -101,7 +99,7 @@
return $found;
}
-sub file_dlfile_maybe {
+sub find_dlfile_maybe {
my($self, $name) = @_;
my $path = $self->libpth;
@@ -116,6 +114,23 @@
return \@maybe;
}
+sub lib_check {
+ my($self, $name) = @_;
+ return unless $self->perl_config('libs') =~ /$name/;
+
+ return if $self->find_dlfile($name);
+
+ my $maybe = $self->find_dlfile_maybe($name);
+ my $suggest = @$maybe ?
+ "You could just symlink it to $maybe->[0]" :
+ 'You might need to install Perl from source';
+ $self->phat_warn(<<EOF);
+Your Perl is configured to link against lib$name,
+ but lib$name.so was not found.
+ $suggest
+EOF
+}
+
#--- user interaction ---
sub prompt {
@@ -133,6 +148,24 @@
sub prompt_n {
my($self, $q) = @_;
$self->prompt($q, 'n') =~ /^n/i;
+}
+
+sub phat_warn {
+ my($self, $msg, $abort) = @_;
+ my $level = $abort ? 'ERROR' : 'WARNING';
+ warn <<EOF;
+************* $level *************
+
+ $msg
+
+************* $level *************
+EOF
+ if ($abort) {
+ exit 1;
+ }
+ else {
+ sleep 5;
+ }
}
#--- constuctors ---