After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 628961 - Add Makefile.am files for generating enum types and marshallers
Add Makefile.am files for generating enum types and marshallers
Status: RESOLVED DUPLICATE of bug 705557
Product: gnome-common
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Gnome Common Maintainer(s)
Gnome Common Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-09-07 14:21 UTC by Emmanuele Bassi (:ebassi)
Modified: 2013-08-06 12:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Makefile.am.enums (1.47 KB, text/plain)
2010-09-07 14:21 UTC, Emmanuele Bassi (:ebassi)
Details
Makefile.am.marshal (1.40 KB, text/plain)
2010-09-07 14:22 UTC, Emmanuele Bassi (:ebassi)
Details

Description Emmanuele Bassi (:ebassi) 2010-09-07 14:21:34 UTC
Created attachment 169669 [details]
Makefile.am.enums

Clutter has been shipping with two additional Makefile extensions that handle the generation of enumeration GTypes and marshaller files. their usage is pretty trivial:

  ‣ define a bunch of variables
  ‣ include Makefile.am.$(section)
  ‣ ???
  ‣ PROFIT!

more in detail:

• Makefile.am.enums

generates the enumeration GTypes using two template files and glib-mkenums; it requires three variables to be defined:

  glib_enum_h = the file of the enumeration template for the header
  glib_enum_c = the file of the enumeration template for the body
  glib_enum_headers = the list of headers to be scanned

• Makefile.am.marshal

generates the marshallers from a list; it requires two variables to be defined:

  glib_marshal_list = the file with the list of marshaller descriptions
  glib_marshal_prefix = the prefix for the marshallers

both files require the EXTRA_DIST, BUILT_SOURCES, CLEANFILES and DISTCLEANFILES targets to be defined prior to inclusion.

the rules generated respect out-of-tree builds.

both files are currently licensed under the LGPLv2.1+.
Comment 1 Emmanuele Bassi (:ebassi) 2010-09-07 14:22:00 UTC
Created attachment 169670 [details]
Makefile.am.marshal
Comment 2 Emmanuele Bassi (:ebassi) 2010-09-07 14:22:47 UTC
mmh, I guess I missed it but the point of this bug is to include these files inside gnome-common, so that other projects can use them.
Comment 3 Christian Persch 2010-10-07 13:32:41 UTC
I like the idea. However, I think it would be even better to add this to glib directly (the goal is to kill gnome-common), and make this not includable Makefile.am snippets (which have to be installed somewhere, and then you need a way to know where to include them from), but subst rules you can just use like @GSETTINGS_RULES@.

Would be nice to make them automagic like the gsettings rules are (just declare project_MARSHALS / project_ENUMS/FLAGS and have the rules take care of the rest?).

Also, do these snippets work with nonrecursive automake?
Comment 4 Emmanuele Bassi (:ebassi) 2010-10-07 14:16:38 UTC
(In reply to comment #3)
> I like the idea. However, I think it would be even better to add this to glib
> directly (the goal is to kill gnome-common), and make this not includable
> Makefile.am snippets (which have to be installed somewhere, and then you need a
> way to know where to include them from), but subst rules you can just use like
> @GSETTINGS_RULES@.

> Would be nice to make them automagic like the gsettings rules are (just declare
> project_MARSHALS / project_ENUMS/FLAGS and have the rules take care of the
> rest?).

mmh, yeah, that would be nice as well...
 
> Also, do these snippets work with nonrecursive automake?

if you have multiple namespaces then: no, they won't.

but if your library only has one namespace then they don't have any problem.
Comment 5 Philip Withnall 2013-08-06 12:24:24 UTC
I’ve ported the patches to GLib and filed bug #705557 with them. The new patches also support non-recursive automake and multiple namespaces.

*** This bug has been marked as a duplicate of bug 705557 ***