Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 36437 invoked from network); 5 Nov 2003 06:08:50 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 Nov 2003 06:08:50 -0000 Received: (qmail 43743 invoked by uid 500); 5 Nov 2003 06:08:37 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 43568 invoked by uid 500); 5 Nov 2003 06:08:36 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 43555 invoked from network); 5 Nov 2003 06:08:36 -0000 Received: from unknown (HELO theoryx5.uwinnipeg.ca) (142.132.1.82) by daedalus.apache.org with SMTP; 5 Nov 2003 06:08:36 -0000 Received: from theoryx5.uwinnipeg.ca (localhost.localdomain [127.0.0.1]) by theoryx5.uwinnipeg.ca (8.12.8/8.12.8) with ESMTP id hA5669ch010566; Wed, 5 Nov 2003 00:06:09 -0600 Received: from localhost (randy@localhost) by theoryx5.uwinnipeg.ca (8.12.8/8.12.8/Submit) with ESMTP id hA56699F010562; Wed, 5 Nov 2003 00:06:09 -0600 Date: Wed, 5 Nov 2003 00:06:09 -0600 (CST) From: Randy Kobes To: Stas Bekman cc: dev@perl.apache.org Subject: Re: [mp2] MP_HAVE_APR_LIBS? In-Reply-To: <3FA76C1C.6060702@stason.org> Message-ID: References: <3FA76C1C.6060702@stason.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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); $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); chomp @libs; $libs = join ' ', @libs; } +if (WIN32) { + $libs =~ s{/libpath:}{-L}g; + $libs =~ s{(\w+)\.lib}{-l$1}g; +} ModPerl::BuildMM::WriteMakefile( 'NAME' => 'APR', ==================================================================== sets both the MP_HAVE_APR_LIBS define and also adjusts the $libs in xs/APR/APR/Makefile.PL to something that ExtUtils::MakeMaker understands (the reason for this is that, eg, (apr|apu)-config --link-ld gives /libpath:"/Path/to/Apache2", which is of a form needed to build c-modules, but ExtUtils::MakeMaker expects it to be -L"/Path/to/Apache2"). However, when I use this, I get an error from xs/APR/APR/APR.xs: ========================================================= cd "src/modules/perl" && NMAKE -f Makefile.modperl cl -c -IC:/MyFiles/MODPER~1.0/src/modules/perl -IC:/MyFiles/MODPER~1.0/xs -IC:/Apache2/include -IC:\Apache2/include -nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DMOD_PERL -DMP_COMPAT_1X -MD -DNDEBUG -O1 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-IC:\Perl\lib\CORE" -DMP_HAVE_APR_LIBS APR.c APR.c APR.xs(22) : error C2065: 'my_perl' : undeclared identifier APR.xs(22) : warning C4047: 'function' : 'struct interpreter *' differs in levels of indirection from 'int ' APR.xs(22) : warning C4024: 'Perl_IStdIO_ptr' : different types for formal and actual parameter 1 APR.xs(22) : warning C4047: 'function' : 'struct interpreter *' differs in levels of indirection from 'int ' APR.xs(22) : warning C4024: 'Perl_IStdIO_ptr' : different types for formal and actual parameter 1 ============================================================ coming from the fprintf(stderr, ...) call. I'm not sure what the fix is - I tried PerlIO_printf(PerlIO_stderr(), ...) but came up against another error: ============================================================ cd "src/modules/perl" && NMAKE -f Makefile.modperl cl -c -IC:/MyFiles/MODPER~1.0/src/modules/perl -IC:/MyFiles/MODPER~1.0/xs -IC:/Apache2/include -IC:\Apache2/include -nologo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DMOD_PERL -DMP_COMPAT_1X -MD -DNDEBUG -O1 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-IC:\Perl\lib\CORE" -DMP_HAVE_APR_LIBS APR.c APR.c APR.xs(22) : error C2065: 'my_perl' : undeclared identifier APR.xs(22) : warning C4047: 'function' : 'struct interpreter *' differs in levels of indirection from 'int ' APR.xs(22) : warning C4024: 'Perl_PerlIO_stderr' : different types for formal and actual parameter 1 ===================================================================== I noticed that in src/modules/perl/* that the fprintf(stderr, ...) calls are commented out - is that related to this problem? Thanks. -- best regards, randy --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org