You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2002/11/26 15:04:42 UTC

[patch] xs/APR/APR/Makefile.PL

As I have mentioned earlier here:
http://mathforum.org/epigone/modperl-dev/thehplaldshend
we need to adjust to the new way apr names the libs. Here is the patch 
that makes it work with the new way. Still need to handle correctly the 
previous way. Should this be integrated into ModPerl::MM? I haven't 
found a better way then calling apu|apr-config directly since apxs 
doesn't provide this info. comments are welcome.

Index: xs/APR/APR/Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.4
diff -u -r1.4 Makefile.PL
--- xs/APR/APR/Makefile.PL      6 Apr 2002 04:42:00 -0000       1.4
+++ xs/APR/APR/Makefile.PL      26 Nov 2002 13:56:11 -0000
@@ -4,12 +4,11 @@

  my $prefix = ModPerl::MM::build_config()->apxs(-q => 'PREFIX');

-my $libdir = "$prefix/lib";
-
-my @libs = map "-l$_", qw(apr aprutil);
+my @libs = map { qx{$prefix/bin/$_-config --link-ld} } qw(apr apu);
+chomp @libs;

  ModPerl::MM::WriteMakefile(
      'NAME'        => 'APR',
      'VERSION_FROM' => 'APR.pm',
-    'LIBS'         => ["-L$libdir @libs"],
+    'LIBS'         => \@libs,
  );


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [patch] xs/APR/APR/Makefile.PL

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 27 Nov 2002, Stas Bekman wrote:

> are we good now?

looks good to me.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [patch] xs/APR/APR/Makefile.PL

Posted by Stas Bekman <st...@stason.org>.
Doug MacEachern wrote:
> note that ap[ur]-config will be required, as there may be other libs such 
> as -lgdbm.  i've disabled the linking for the moment.  i suppose if you 
> patch was modified to enable only if -x $apr_config && -x $apu_config, 
> that'd be ok.  we just won't support older versions of apr or platforms 
> that don't have the script for the moment.  still, low priority, unlikely 
> anybody will need this functionality in the near future.

are we good now?

Index: xs/APR/APR/Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.5
diff -u -r1.5 Makefile.PL
--- xs/APR/APR/Makefile.PL      26 Nov 2002 17:09:03 -0000      1.5
+++ xs/APR/APR/Makefile.PL      27 Nov 2002 01:17:17 -0000
@@ -4,16 +4,15 @@

  my $prefix = ModPerl::MM::build_config()->apxs(-q => 'PREFIX');

-my $libdir = "$prefix/lib";
-
-my @libs = map "-l$_", qw(apr aprutil);
+# XXX: this works only with libapr 0.9.2+ (not on win32)
+my @libs = grep $_, map { -x $_ && qx{$_ --link-ld} }
+    map { qx{$prefix/bin/$_-config} } qw(apr apu);
+chomp @libs;
+my $define = @libs ? '-DMP_HAVE_APR_LIBS' : '';

  ModPerl::MM::WriteMakefile(
      'NAME'        => 'APR',
      'VERSION_FROM' => 'APR.pm',
-#XXX: no longer works with apr's goofy versioning scheme
-#low priority to fix as nobody is using Perl APR bindings
-#outside of httpd
-#    'LIBS'         => ["-L$libdir @libs"],
-#    'DEFINE'       => '-DMP_HAVE_APR_LIBS', #only if @libs are found
+    'LIBS'         => \@libs,
+    'DEFINE'       => $define,
  );



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [patch] xs/APR/APR/Makefile.PL

Posted by Doug MacEachern <do...@covalent.net>.
note that ap[ur]-config will be required, as there may be other libs such 
as -lgdbm.  i've disabled the linking for the moment.  i suppose if you 
patch was modified to enable only if -x $apr_config && -x $apu_config, 
that'd be ok.  we just won't support older versions of apr or platforms 
that don't have the script for the moment.  still, low priority, unlikely 
anybody will need this functionality in the near future.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [patch] xs/APR/APR/Makefile.PL

Posted by Doug MacEachern <do...@covalent.net>.
of course, this apache "portable" runtime script does not work on windows.
(tho, not sure if the existing Makefile.PL did either)
strange thing is, MakeMaker should ignore libraries it cannot find, as it 
has been for me.  APR.pm is only meant for using apr outside of modperl, 
which i don't think anybody is doing.  could just comment out the LIBS =>
line for now, until we figure out a portable way of doing this.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org