httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject [apreq-2] xsbuilder on Win32
Date Thu, 12 Jun 2003 04:47:11 GMT
The build/xsbuilder.pl script needs some tweaks
to work on Win32.
- getting the base directory needs some special
consideration, due to "httpd-apreq-2" being compared
to a dos short path name;
- getting the Apache include and lib directories
needs a different mechanism than reading a config.status
file from a unix configure script;
- the library location and names passed into WriteMakeFile
need to be adjusted on Win32.

The following is a stab at addressing these - with this,
on Win32 the perl glue's 'perl Makefile.PL' generates
things so that one can proceed to the 'make' stage
(there's some failures at this point due to some
missing symbols, but that's a thing with the win32 build).

===========================================================
Index: xsbuilder.pl
===================================================================
RCS file: /home/cvs/httpd-apreq-2/build/xsbuilder.pl,v
retrieving revision 1.4
diff -u -r1.4 xsbuilder.pl
--- xsbuilder.pl	7 Jun 2003 20:16:23 -0000	1.4
+++ xsbuilder.pl	12 Jun 2003 04:33:09 -0000
@@ -8,9 +8,13 @@
 use warnings FATAL => 'all';
 use Apache2;
 use Apache::Build;
+require Win32 if Apache::Build::WIN32;

 use Cwd;
-cwd =~ m{^(.+httpd-apreq-2)} or die "Can't find base cvs directory";
+
+my $cwd = Apache::Build::WIN32 ?
+    Win32::GetLongPathName(cwd) : cwd;
+$cwd =~ m{^(.+httpd-apreq-2)} or die "Can't find base cvs directory";
 my $base_dir = $1;
 my $src_dir = "$base_dir/src";
 my $xs_dir = "$base_dir/glue/perl/xsbuilder";
@@ -20,13 +24,28 @@
     read $file, $_[0], -s $file;
 }

-slurp my $config => "$base_dir/config.status";
-$config =~ /^s,\@APACHE2_INCLUDES\@,([^,]+)/m && -d $1 or
-    die "Can't find apache include directory";
-my $apache_includes = $1;
-$config =~ m/^s,\@APACHE2_LIBS\@,([^,]+)/m && -d $1 or
-    die "Can't find apr lib directory";
-my $apr_libs = $1;
+my ($apache_includes, $apr_libs);
+if (Apache::Build::WIN32) {
+    my $apache_dir = Apache::Build->build_config()->dir;
+    ($apache_includes = $apache_dir . '/include') =~ s!\\!/!g;
+    ($apr_libs = $apache_dir . '/lib') =~ s!\\!/!g;
+}
+else {
+    slurp my $config => "$base_dir/config.status";
+    $config =~ /^s,\@APACHE2_INCLUDES\@,([^,]+)/m && -d $1 or
+        die "Can't find apache include directory";
+    $apache_includes = $1;
+    $config =~ m/^s,\@APACHE2_LIBS\@,([^,]+)/m && -d $1 or
+        die "Can't find apr lib directory";
+    $apr_libs = $1;
+}
+
+my $apr_lib_flags = Apache::Build::WIN32 ?
+    qq{-L$apr_libs -llibapr -llibaprutil} :
+    qq{-L$apr_libs -lapr-0 -laprutil-0};
+my $apreq_lib_flags = Apache::Build::WIN32 ?
+    qq{-L$base_dir/win32/libs -llibapreq -lmod_apreq} :
+    qq{-L$src_dir/.libs -lapreq};

 my $mp2_typemaps = Apache::Build->new->typemaps;
 read DATA, my $grammar, -s DATA;
@@ -178,7 +197,7 @@
     'VERSION' => '0.01',
     'TYPEMAPS' => [qw(@$mp2_typemaps $typemap)],
     'INC'      => "-I.. -I../.. -I../../.. -I$src_dir -I$xs_dir -I$apache_includes",
-    'LIBS'     => "-L$src_dir/.libs -L$apr_libs -lapreq -lapr-0 -laprutil-0",
+    'LIBS'     => "$apreq_lib_flags $apr_lib_flags",
 } ;
 $txt .= "'depend'  => $deps,\n" if ($deps) ;
 $txt .= qq{
========================================================================

-- 
best regards,
randy

Mime
View raw message