Randy Kobes wrote:
On Tue, 4 Nov 2003, Stas Bekman wrote:


Randy Kobes wrote:

Hi,
   It'll probably be obvious, but I've been trying to see
how MP_HAVE_APR_LIBS gets defined for use in xs/APR/APR.xs,
in order to see if a working version can be done for Win32.
Could someone point me in the general direction? Thanks.

It happens in top-level Makefile.PL:


Thanks, Stas! I don't know how I missed that ... Anyway, for
Win32, the reason this didn't work (assuming the existence
of the (apr|apu)-config scripts, is that a '.bat' extension
is needed in the -x test. The following:

===========================================================
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
retrieving revision 1.126
diff -u -r1.126 Makefile.PL
--- Makefile.PL 29 Oct 2003 00:42:47 -0000      1.126
+++ Makefile.PL 5 Nov 2003 05:39:44 -0000
@@ -95,8 +95,9 @@
     # overrides any local definition, not sure what's the right fix, for
     # now just define it here (should it define PASTHRU_DEFINE instead?)
     if (my $apr_bindir = $build->apr_bindir()) {
+        my $ext = WIN32 ? 'bat' : '';
         my @apr_libs = grep $_, map { -x $_ && qx{$_ --link-ld} }
-            map { qq{$apr_bindir/$_-config} } qw(apr apu);
+            map { qq{$apr_bindir/$_-config.$ext} } qw(apr apu);

That should be: + my $ext = WIN32 ? '.bat' : ''; ... + map { qq{$apr_bindir/$_-config$ext} } qw(apr apu);

         $opt_define = '-DMP_HAVE_APR_LIBS' if @apr_libs;
     }

Index: xs/APR/APR/Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.17
diff -u -r1.17 Makefile.PL
--- xs/APR/APR/Makefile.PL      22 Aug 2003 19:16:50 -0000      1.17
+++ xs/APR/APR/Makefile.PL      5 Nov 2003 05:39:44 -0000
@@ -3,18 +3,26 @@

 use lib qw(../lib);
 use ModPerl::BuildMM ();
+use Apache::Build ();
 use Config;

+use constant WIN32 => Apache::Build::WIN32;
+
 my $libs = '';
 if (my $apr_bindir = ModPerl::BuildMM::build_config()->apr_bindir()) {

-    # XXX: this works only with libapr 0.9.2+ (not on win32)
+    # XXX: this works only with libapr 0.9.2+
+    my $ext = WIN32 ? 'bat' : '';
     my @libs = grep $_, map { -x $_ && qx{$_ --link-ld --libs} }
-        map { qq{$apr_bindir/$_-config} } qw(apr apu);
+        map { qq{$apr_bindir/$_-config.$ext} } qw(apr apu);

same here.


     chomp @libs;
     $libs = join ' ', @libs;
 }

+if (WIN32) {
+    $libs =~ s{/libpath:}{-L}g;
+    $libs =~ s{(\w+)\.lib}{-l$1}g;
+}

 ModPerl::BuildMM::WriteMakefile(
     'NAME'        => 'APR',

on the issue with the compile problems, please give me a second.


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


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to