dougm 00/04/24 22:16:08
Modified: . 00README_FIRST Makefile.PL
lib/Apache Build.pm
Log:
if MP_USE_DSO=1 build libmodperl.so, else build libmodperl.a
get rid of Apache::Build::AUTOLOAD
Revision Changes Path
1.5 +3 -3 modperl-2.0/00README_FIRST
Index: 00README_FIRST
===================================================================
RCS file: /home/cvs/modperl-2.0/00README_FIRST,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- 00README_FIRST 2000/04/21 20:10:00 1.4
+++ 00README_FIRST 2000/04/25 05:16:07 1.5
@@ -18,7 +18,7 @@
to build mod_perl static:
-% perl Makefile.PL && make libmodperl.a
+% perl Makefile.PL && make
% cd ../apache-2.0/src
% ./configure --prefix=$HOME/apache-2.0 --with-mpm=mpmt_pthread
@@ -27,7 +27,7 @@
to build mod_perl dynamic:
-% perl Makefile.PL && make libmodperl.so
+% perl Makefile.PL MP_USE_DSO=1 && make
(note the dso-link-hack.pat is need for my suse-6.1, might be
different for your platform)
@@ -64,4 +64,4 @@
warn "hey, it works!";
}
---dougm 04/21
+--dougm 04/24
1.15 +9 -17 modperl-2.0/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Makefile.PL 2000/04/25 04:25:41 1.14
+++ Makefile.PL 2000/04/25 05:16:07 1.15
@@ -56,6 +56,10 @@
$code->generate;
$build->write_src_makefile;
+
+ printf "Will build mod_perl %s as %s\n",
+ $build->is_dynamic ? "shared" : "static",
+ $build->{"MODPERL_LIB"};
}
sub echo_cmd {
@@ -152,18 +156,14 @@
sub MY::top_targets {
my $self = shift;
my $string = $self->MM::top_targets;
-
- for (qw(SHARED STATIC)) {
- $string .= <<EOF;
-
-$build->{"MODPERL_LIB_$_"}:
- @(cd \$(MODPERL_SRC) && \$(MAKE) \$\@);
-EOF
- }
+ $build->mm_add_dep(\$string, pure_all => 'modperl_lib');
$string .= <<'EOF';
+modperl_lib:
+ @(cd $(MODPERL_SRC) && $(MAKE));
+
modperl_src_clean:
@(cd $(MODPERL_SRC) && $(MAKE) clean);
@@ -175,19 +175,11 @@
sub MY::clean {
my $self = shift;
my $string = $self->MM::clean(@_);
- $string =~ s/(clean\s+::)/$1 modperl_src_clean /;
+ $build->mm_add_dep(\$string, clean => 'modperl_src_clean');
$string;
}
sub MY::postamble {
- my $i = 0;
- print "you may now run:\n";
-
- for (qw(SHARED STATIC)) {
- print qq(make $build->{"MODPERL_LIB_$_"}\n);
- print " - or - \n" unless $i++;
- }
-
'';
}
1.13 +14 -13 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Build.pm 2000/04/25 04:38:53 1.12
+++ Build.pm 2000/04/25 05:16:07 1.13
@@ -22,7 +22,7 @@
my $build = $self->build_config;
my $apxs;
my @trys = ($Apache::Build::APXS,
- $build->APXS);
+ $build->{MP_APXS});
unless (IS_MOD_PERL_BUILD) {
#if we are building mod_perl via apxs, apxs should already be known
@@ -363,7 +363,7 @@
sub is_dynamic {
my $self = shift;
- $self->USE_DSO;
+ $self->{MP_USE_DSO} || $self->{MP_USE_APXS};
}
sub default_dir {
@@ -406,14 +406,6 @@
return $self->{dir} = $dir;
}
-our $AUTOLOAD;
-
-sub AUTOLOAD {
- my $self = shift;
- (my $name = $AUTOLOAD) =~ s/.*::(\w+)$/$1/;
- return $self->{$name} || $self->{lc $name};
-}
-
#--- finding apache *.h files ---
sub find {
@@ -620,9 +612,11 @@
print $fh $self->canon_make_attr($method, @{ $code->$method() });
}
- print $fh <<'EOF';
+ print $fh $self->canon_make_attr('lib', $self->is_dynamic ?
+ $self->{MODPERL_LIB_SHARED} :
+ $self->{MODPERL_LIB_STATIC});
-MODPERL_LIB=$(MODPERL_LIBNAME)$(MODPERL_LIB_EXT)
+ print $fh <<'EOF';
all: lib
@@ -722,7 +716,7 @@
my $ssl_dir = "$src/../ssl/include";
unless (-d $ssl_dir) {
my $build = $self->build_config;
- $ssl_dir = join '/', $self->SSL_BASE || '', 'include';
+ $ssl_dir = join '/', $self->{MP_SSL_BASE} || '', 'include';
}
push @inc, "-I$ssl_dir" if -d $ssl_dir;
@@ -742,6 +736,13 @@
my $self = shift;
return "";
+}
+
+#--- tweak MakeMaker ---
+
+sub mm_add_dep {
+ my($self, $string, $targ, $add) = @_;
+ $$string =~ s/($targ\s+::)/$1 $add /;
}
1;