[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Perl bindings incorrectly linking to installed libraries

From: Max Bowsher <maxb_at_ukf.net>
Date: 2005-10-03 19:18:17 CEST

The recent addition of several svn_foobar_dup() functions was the catalyst
for me discovering that the Perl bindings are incorrectly linking to
installed libraries.

The problem was: -L/libdir directories are searched from left to right
-L/usr/local/lib and -L/usr/lib had found their way into the link command to
the left of the -L options for the build-tree svn library dirs.

The fix comes in two parts:
(1) Move $apr_ldflags from before to after the -L..../libsvn_foo/.libs
options, because it will often contain -L options to common installed dirs.

(2) Prune an erroneous -L/usr/local/lib out of the Perl Config variable
lddlflags. The erroneous flag is present on the two systems I've tested
(Cygwin and Debian), and I cannot think of any legitimate reason for it to
be present.

Here's the patch, for those more competent than I in the lore of MakeMaker
to peruse:

Index: subversion/bindings/swig/perl/native/Makefile.PL.in
===================================================================
--- subversion/bindings/swig/perl/native/Makefile.PL.in (revision 16422)
+++ subversion/bindings/swig/perl/native/Makefile.PL.in (working copy)
@@ -36,6 +36,9 @@

 chomp $apr_shlib_path_var;

+my $lddlflags = $Config{lddlflags};
+$lddlflags =~ s,-L/usr/local/lib,,g;
+
 my %config = (
     ABSTRACT => 'Perl bindings for Subversion',
     INC => join(' ',$apr_cflags, $apu_cflags,
@@ -43,11 +46,13 @@
                  " -I$svnlib_srcdir/include",
                  " -I$swig_srcdir -g"),
     OBJECT => q/$(O_FILES)/,
- LIBS => [join(' ', $apr_ldflags,
+ LIBS => [join(' ',
                   (map {$_ = abs_path($_); "-L$_"} @ldpaths),
                   @ldmodules, '-lsvn_swig_perl-1',
+ $apr_ldflags,
                   `$swig -perl -ldflags`)],
- test => { TESTS => "$swig_srcdir/perl/native/t/*.t" }
+ test => { TESTS => "$swig_srcdir/perl/native/t/*.t" },
+ LDDLFLAGS => $lddlflags
 );

 sub perlish {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 3 19:19:25 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.