You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2017/02/03 19:03:53 UTC

svn commit: r1781588 - in /subversion/trunk: build/ac-macros/swig.m4 subversion/bindings/swig/perl/native/Makefile.PL.in

Author: stsp
Date: Fri Feb  3 19:03:53 2017
New Revision: 1781588

URL: http://svn.apache.org/viewvc?rev=1781588&view=rev
Log:
Pass explicit linker flags to the perl bindings build.

This unbreaks 'make check-swig-pl' in cases where the libsvn libraries
being tested are not installed in a standard system library search path.
With another set of libsvn libraries is present on the system, the perl
bindings would gets linked to that set, and the tests would fail crashing
left and right.

* build/ac-macros/swig.m4
  (SVN_FIND_SWIG): Ask Perl which LD flags to use for linking extensions.
   Expose these flags in a new SWIG_PL_LINK variable.

* subversion/bindings/swig/perl/native/Makefile.PL.in
  (config): Pass LDFLAGS and LDDLFLAGS explicitly, instead of using
   whatever defaults the Perl installation happens to use.

Modified:
    subversion/trunk/build/ac-macros/swig.m4
    subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in

Modified: subversion/trunk/build/ac-macros/swig.m4
URL: http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/swig.m4?rev=1781588&r1=1781587&r2=1781588&view=diff
==============================================================================
--- subversion/trunk/build/ac-macros/swig.m4 (original)
+++ subversion/trunk/build/ac-macros/swig.m4 Fri Feb  3 19:03:53 2017
@@ -172,6 +172,7 @@ AC_DEFUN(SVN_FIND_SWIG,
       AC_MSG_RESULT([$PERL_VERSION])
       if test "$PERL_VERSION" -ge "5008000"; then
         SWIG_PL_INCLUDES="\$(SWIG_INCLUDES) `$PERL -MExtUtils::Embed -e ccopts`"
+        SWIG_PL_LINK="`$PERL -MExtUtils::Embed -e ldopts`"
       else
         AC_MSG_WARN([perl bindings require perl 5.8.0 or newer.])
       fi
@@ -299,6 +300,7 @@ int main()
   AC_SUBST(SWIG_PY_LINK)
   AC_SUBST(SWIG_PY_LIBS)
   AC_SUBST(SWIG_PL_INCLUDES)
+  AC_SUBST(SWIG_PL_LINK)
   AC_SUBST(SWIG_RB_LINK)
   AC_SUBST(SWIG_RB_LIBS)
   AC_SUBST(SWIG_RB_INCLUDES)

Modified: subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in?rev=1781588&r1=1781587&r2=1781588&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in Fri Feb  3 19:03:53 2017
@@ -90,6 +90,9 @@ my %config = (
                   (map {"-L$_"} @ldpaths),
                   @ldmodules, '-lsvn_swig_perl-1',
                   `$swig -perl -ldflags`)],
+    LDFLAGS => join(' ', (map {"-L$_"} @ldpaths), '@LDFLAGS@ @SWIG_PL_LINK@'),
+    LDDLFLAGS => join(' ', (map {"-L$_"} @ldpaths),
+                      '@LDFLAGS@ @SWIG_PL_LINK@ @LT_LDFLAGS@'),
     test => { TESTS => "$swig_srcdir/perl/native/t/*.t" }
 );