Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 13917 invoked from network); 27 Apr 2005 14:43:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Apr 2005 14:43:37 -0000 Received: (qmail 69512 invoked by uid 500); 27 Apr 2005 14:44:25 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 69484 invoked by uid 500); 27 Apr 2005 14:44:24 -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 69469 invoked by uid 99); 27 Apr 2005 14:44:24 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.logilune.com (HELO mail.logilune.com) (195.80.154.36) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 27 Apr 2005 07:44:21 -0700 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id B8810D6933; Wed, 27 Apr 2005 16:43:23 +0200 (CEST) Message-ID: <426FA50A.2070701@stason.org> Date: Wed, 27 Apr 2005 10:43:22 -0400 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050322 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: Nick *** CC: dev@perl.apache.org Subject: Re: [PATCH] Dynamic linking on Cygwin References: <579727945.1114594557675.JavaMail.nobody@app4.ni.bg> In-Reply-To: <579727945.1114594557675.JavaMail.nobody@app4.ni.bg> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Nick *** wrote: > Note that this patch doesn't fix the dynamic linking entirely, but does 75% of the job. > The problem with cygwin is that it behaves like windows (it's a posix layer over windows after all). > That's why we need to supply all symbols during linking time just like on win32, by adding -lapr-0 -laprutil-0 and -lhttpd. On windows, Apache supplies all the three libraries and it's easy to link, but on cygwin apache doesn't play nice and doesn't supply libhttpd. > My patch adds libapr and libaprutil. Also, I have a workaround for libhttpd, but currently I'm thinking on how to implement it. Thanks Nick. But please test for me the patch below. I've just changed the way you've generated the flags to make the dealing with space separators less painful for the eyes and replaced the hardcoded -lmod_perl with "-l$self->{MP_LIBNAME}". Though I can't test it. Index: Changes =================================================================== --- Changes (revision 164866) +++ Changes (working copy) @@ -12,6 +12,15 @@ =item 1.999_23-dev +improving DSO support on cygwin. The problem with cygwin is that it +behaves like windows (it's a posix layer over windows after +all). That's why we need to supply all symbols during linking time +just like on win32, by adding -lapr-0 -laprutil-0 and -lhttpd. On +windows, Apache supplies all the three libraries and it's easy to +link, but on cygwin apache doesn't play nice and doesn't supply +libhttpd. Nick's patch adds libapr and libaprutil. [Nick *** +] + improve the diagnostics when detecting mp2 < 1.999022, tell the user which files and/or dirs need to be removed [Stas] Index: lib/Apache2/Build.pm =================================================================== --- lib/Apache2/Build.pm (revision 164832) +++ lib/Apache2/Build.pm (working copy) @@ -464,6 +464,10 @@ $ldopts .= $self->gtop_ldopts; } + if (CYGWIN && $self->is_dynamic) { + $ldopts .= join ' ', '', $self->apru_link_flags; + } + $config->{ldflags} = $ldflags; #reset # on Irix mod_perl.so needs to see the libperl.so symbols, which @@ -1050,7 +1054,9 @@ return @apru_link_flags if @apru_link_flags; - for ($self->apr_config_path, $self->apu_config_path) { + # first use apu_config_path and then apr_config_path in order to + # resolve the symbols right during linking + for ($self->apu_config_path, $self->apr_config_path) { if (my $link = $_ && -x $_ && qx{$_ --link-ld --libs}) { chomp $link; if ($self->httpd_is_source_tree) { @@ -1801,6 +1807,20 @@ $flags; } +sub otherldflags_cygwin { + my $self = shift; + my $flags = $self->otherldflags_default; + + unless ($self->{MP_STATIC_EXTS}) { + $flags .= join " ", '', + $self->apru_link_flags, + '-L' . $self->file_path('src/modules/perl'), + "-l$self->{MP_LIBNAME}"; + } + + $flags; +} + sub typemaps { my $self = shift; my @typemaps = (); -- __________________________________________________________________ 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