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

Re: SWIG not generating correct type qualifiers

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2007-03-03 21:41:58 CET

Hi Nik,

On Sat, Mar 03, 2007 at 05:52:37PM +0000, Nik Clayton wrote:
> gmake MAKE=gmae swig-pl
>
> (the MAKE=gmake bit is necessary on platforms where GNU make is not
> "make", if that's not the case on your platform then just "make; make
> swig-pl" should suffice).
>
> Then
>
> cd subversion/bindings/swig/perl/native
> perl Makefile.PL
> make

(That was run for me when I did the 'make swig-pl'. I assume that's
normal).

> perl -Iblib/arch -Iblib/lib t/client/list.t
>

Works fine for me on a 32-bit Pentium 3 running Slackware:
(SWIG 1.3.29, Perl 5.8.8, APR 1.2.7).

$ uname -a
Linux lorenz 2.4.33.3 #1 Fri Sep 1 01:48:52 CDT 2006 i686 pentium3 i386
GNU/Linux
$ swig -version

SWIG Version 1.3.29

Compiled with g++ [i686-pc-linux-gnu]
...
$ perl -Iblib/arch -Iblib/lib t/client/list.t
1..19
ok 1 - use Test::SVN;
ok 2 - use SVN::Client;
ok 3 - The object isa SVN::Client
ok 4 - $path is correct -
ok 5 - The object isa _p_svn_dirent_t
ok 6 - $lock is undefined
ok 7 - $abs_path is correct - /
ok 8 - The object isa _p_apr_pool_t
ok 9 - $path is correct - A
ok 10 - The object isa _p_svn_dirent_t
ok 11 - $lock is undefined
ok 12 - $abs_path is correct - /
ok 13 - The object isa _p_apr_pool_t
ok 14 - $path is correct - iota
ok 15 - The object isa _p_svn_dirent_t
ok 16 - $lock is undefined
ok 17 - $abs_path is correct - /
ok 18 - The object isa _p_apr_pool_t
ok 19 - $list_func called 3 times

I did have to apply a patch to get the Perl bindings to build at all, so
it's possible that may have worked around the problem:

The build problem I had was that it's not possible for me to #include
the APR headers unless I include the flags from 'apr-config --cppflags',
because otherwise apr_off_t is typedef'd to off64_t, and the latter
isn't defined.

Including the relevant flags from apr-config (in my case,
-D_LARGEFILE64_SOURCE) fixes the problem. The attached patch replaces
the default set of MakeMaker CCFLAGS with the set defined by 'apr-config
--cpp-flags --cflags'. I have no idea whether it's correct generally,
but I can't build the bindings otherwise.

Regards,
Malcolm

Index: subversion/bindings/swig/perl/native/Makefile.PL.in
===================================================================
--- subversion/bindings/swig/perl/native/Makefile.PL.in (revision 23560)
+++ subversion/bindings/swig/perl/native/Makefile.PL.in (working copy)
@@ -26,6 +26,7 @@
 my @ldmodules = map {"-lsvn_$_-1"} (@modules, qw/diff subr/);
 
 my $apr_shlib_path_var = '@SVN_APR_SHLIB_PATH_VAR@';
+my $cflags = '@CPPFLAGS@ @CFLAGS@';
 my $apr_cflags = '@SVN_APR_INCLUDES@';
 my $apu_cflags = '@SVN_APRUTIL_INCLUDES@';
 
@@ -38,6 +39,7 @@
 
 my %config = (
     ABSTRACT => 'Perl bindings for Subversion',
+ CCFLAGS => $cflags,
     INC => join(' ',$apr_cflags, $apu_cflags,
                  " -I$swig_srcdir/perl/libsvn_swig_perl",
                  " -I$svnlib_srcdir/include",

  • application/pgp-signature attachment: stored
Received on Sat Mar 3 21:43:00 2007

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