You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@hyperreal.org on 1998/11/05 04:12:55 UTC
cvs commit: modperl/apaci Makefile.tmpl mod_perl.config.sh
dougm 98/11/04 19:12:55
Modified: . Makefile.PL
apaci Makefile.tmpl mod_perl.config.sh
Log:
Makefile.PL will look for and link with *.a files in
$APACHE_SRC/src/modules/modperl/blib/arch/auto
assumed to be from 'make static' of an xs module
the static bootstrap call is added to perlxsi.c
handy for profiling xs modules (built w/ -pg -a) inside httpd with gprof
Revision Changes Path
1.109 +28 -1 modperl/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /export/home/cvs/modperl/Makefile.PL,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- Makefile.PL 1998/11/02 19:31:40 1.108
+++ Makefile.PL 1998/11/05 03:12:53 1.109
@@ -1809,6 +1809,27 @@
$v;
}
+#for linking third-party xs modules static built w/ MakeMaker's: 'make static'
+#must have when the xs module is compiled with profiling `-pg -a' flags
+sub add_static_ar {
+ $PERL_STATIC_AR ||= "";
+ my $cur = $APACHE_SRC =~ /^../ ? "$PWD/" : "";
+ for (qw(blib/arch/auto arch/auto)) {
+ last if -d ($ar_dir = "$APACHE_SRC/modules/perl/$_");
+ $ar_dir = "";
+ }
+
+ finddepth(sub {
+ return unless /\.a$/;
+ (my $rel = $File::Find::dir) =~ s:$APACHE_SRC/?::;
+ (my $mod = $rel) =~ s:.*auto/::;
+ $mod =~ s,/,::,;
+ print "linking static $mod => $rel/$_\n";
+ $PERL_STATIC_AR .= $cur . "$File::Find::dir/$_ ";
+ $PERL_STATIC_EXTS .= "$mod ";
+ }, $ar_dir);
+}
+
sub APACI::init {
my $lib_cfg;
if($USE_APXS) {
@@ -1834,10 +1855,16 @@
for (@xs_mod_snames) {
push @static_src, "$_.c";
}
- my $static_targets = <<EOF unless $DYNAMIC;
+
+ add_static_ar();
+
+ my $static_targets = "";
+ $static_targets = <<EOF unless $DYNAMIC;
PERL_STATIC_EXTS = @xs_modules $PERL_STATIC_EXTS
PERL_STATIC_SRCS = @static_src
EOF
+
+ $static_targets .= "PERL_STATIC_AR = $PERL_STATIC_AR\n" if $PERL_STATIC_AR;
print $apaci_cfg <<EOF;
##
1.7 +1 -0 modperl/apaci/Makefile.tmpl
Index: Makefile.tmpl
===================================================================
RCS file: /export/home/cvs/modperl/apaci/Makefile.tmpl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Makefile.tmpl 1998/07/30 15:37:15 1.6
+++ Makefile.tmpl 1998/11/05 03:12:54 1.7
@@ -25,6 +25,7 @@
MP_AR=$(PERL_AR)
MP_RANLIB=$(PERL_RANLIB)
MP_STATIC_EXTS=$(PERL_STATIC_EXTS)
+MP_STATIC_AR=$(PERL_STATIC_AR)
MP_STATIC_SRCS=$(PERL_STATIC_SRCS)
MP_STATIC_OBJS=$(PERL_STATIC_OBJS)
MP_STATIC_OBJS_PIC=$(PERL_STATIC_OBJS_PIC)
1.11 +3 -1 modperl/apaci/mod_perl.config.sh
Index: mod_perl.config.sh
===================================================================
RCS file: /export/home/cvs/modperl/apaci/mod_perl.config.sh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- mod_perl.config.sh 1998/11/02 19:31:42 1.10
+++ mod_perl.config.sh 1998/11/05 03:12:54 1.11
@@ -144,6 +144,7 @@
# determine static objects
#
perl_static_exts="$param_PERL_STATIC_EXTS"
+perl_static_ar="$param_PERL_STATIC_AR"
perl_static_srcs="$param_PERL_STATIC_SRCS"
perl_static_objs="`echo $param_PERL_STATIC_SRCS | sed -e 's:\.c:.o:g'`"
perl_static_objs_pic="`echo $param_PERL_STATIC_SRCS | sed -e 's:\.c:.lo:g'`"
@@ -189,12 +190,13 @@
echo "PERL_LD=$perl_ld"
echo "PERL_LDFLAGS=$perl_ldflags"
echo "PERL_LDDLFLAGS=$perl_lddlflags"
-echo "PERL_LIBS=$perl_libs"
+echo "PERL_LIBS=$perl_libs $perl_static_ar"
echo "PERL_XSINIT=$perl_xsinit"
echo "PERL_XSUBPP=$perl_xsubpp"
echo "PERL_AR=$perl_ar"
echo "PERL_RANLIB=$perl_ranlib"
echo "PERL_STATIC_EXTS=$perl_static_exts"
+echo "PERL_STATIC_AR=$perl_static_ar"
echo "PERL_STATIC_SRCS=$perl_static_srcs"
echo "PERL_STATIC_OBJS=$perl_static_objs"
echo "PERL_STATIC_OBJS_PIC=$perl_static_objs_pic"