Re: warnings when building Gnome2-1.010

did you upgrade gnome-vfs without rebuilding Gnome2::VFS?

prior to gnome-vfs 2.5.3, gnome-vfs did not include GTypes for the enum and flags types it defines. the binding created its own GTypes, in vfs2perl-gtypes.[ch] and used these for the automatic flag and enum stuff. then in 2.5.3, gnome-vfs included its own GTypes, in the header gnome-vfs-enum-types.h. to avoid problems, Gnome2::VFS's Makefile.PL checks the pkg-config version to decide whether to run glib-mkenums on the vfs headers, or simply to place the text '#include <libgnomevfs/gnome-vfs-enum-types.h>' in vfs2perl-gtypes.h.

if you build Gnome2::VFS with gnome-vfs 2.4.x, then upgraded gnome-vfs without rebuilding Gnome2::VFS, and then try to build Gnome2, you should see the redefinition behavior you are reporting.

there are two classes of solution for this: Don't Do That, and Paranoid.

in Don't Do That, my answer is "be sure to rebuild the bindings if you upgrade the libraries they bind."

however, since it's incredibly easy to forget to do this, Paranoid may be the best bet. that would involve adding two lines to Gnome2-VFS/Makefile.PL to add #ifndef guards around each of the proxy GType definitions (don't apply immediately!! see below, first!):

Index: Makefile.PL
RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gnome2-VFS/Makefile.PL,v
retrieving revision 1.20
diff -u -r1.20 Makefile.PL
--- Makefile.PL 24 Mar 2004 15:54:58 -0000      1.20
+++ Makefile.PL 4 Jun 2004 14:46:20 -0000
@@ -54,8 +54,10 @@
q(--fhead "#define __VFS2PERL_GTYPES_H__ 1\n\n" ) .
                       q(--fhead "#include <glib-object.h>\n\n" ) .
                       q(--fhead "G_BEGIN_DECLS\n\n" ) .
+ q(--eprod "#ifndef GNOME_VFS_TYPE_ ENUMSHORT@\n" ) . q(--eprod "#define GNOME_VFS_TYPE_ ENUMSHORT@ vfs2perl_ enum_name@_get_type()\n" ) . q(--eprod "GType vfs2perl_ enum_name@_get_type (void);\n" ) . + q(--eprod "#endif /* GNOME_VFS_TYPE_ ENUMSHORT@ */\n" ) .
                       q(--ftail "G_END_DECLS\n\n" ) .
q(--ftail "#endif /* __VFS2PERL_GTYPES_H__ */\n" ) .
                       "@vfs_headers > build/vfs2perl-gtypes.h");

essentially making the generated vfs2perl-gtypes.h have this idiom:

  #ifndef SOME_TYPE_NAME
  #define SOME_TYPE_NAME  vfs2perl_some_name_get_type()
  GType vfs2perl_some_name_get_type (void);
  #endif /* SOME_TYPE_NAME */

now, to test this, i have to ask you do something dirty and hackish. if you patch the makefile and rebuild, you'll be rebuilding against the new version and this problem will not manifest itself. so, to test this out, you'll have to open up the installed vfs2perl-gtypes.h (/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi/Gnome2/VFS/ Install/vfs2perl-gtypes.h on your system) and add those guards by hand. then try building Gnome2 again, and i bet all your redefinitions will have disappeared.

this is not a perfect solution, since the installed VFS bindings and the Gnome2 bindings will be using different enum value tables, but it should work without major problems.

if that does indeed work, and the solution sounds like a good idea, i'll commit it and we'll try to talk Torsten into a new Gnome2::VFS release. :-)

How come hair colors for women take an hour, but "wash out the gray" stuff for men only five minutes? This is so unfair!
    -- Elysse, complaining about commercials

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]