GNOME Bugzilla – Bug 673712
dia-0.97.2 fails to build against glib-2.32 due to glib/gstrfuncs.h and glib/gtestutils.h includes
Last modified: 2012-05-20 17:20:03 UTC
In >=glib-2.31, most glib subheaders cannot be included directly. Attempting to build dia-0.97.2 against glib-2.32 results in the following error: In file included from shape_typeinfo.c:30:0: /usr/include/glib-2.0/glib/gstrfuncs.h:28:2: error: #error "Only <glib.h> can be included directly." make[3]: *** [shape_typeinfo.lo] Error 1
Created attachment 211562 [details] [review] proposed patch Patch to replace prohibited glib/gstrfuncs.h and glib/gtestutils.h includes with #include <glib.h>. Note that the #if GLIB_CHECK_VERSION(2,16,0) #include <glib/gtestutils.h> #endif check had never made sense because glib.h #includes <glib/gtestutils.h> in all glib versions starting with 2.15.1
That issue is addressed by bug 665335 for the master version. Given that dia-0-97 does not even require gtk-2-16 I'd said the check still makes (some) sense: dia-0-97 $ grep gtk configure.in GTK_MODULES="gtk+-2.0 >= 2.6.0 glib-2.0 >= 2.6.0 libxml-2.0 gdk-pixbuf-2.0 gthread-2.0" dnl with gtk+ >= 2.8 this is no longer optional [ --enable-deprecation=[no,glib,pango,gtk,yes] turn on glib/pango/gtk deprecations [default=no]], if test "x$enable_deprecation" = "xgtk"; then AM_CHECK_PYMOD(gtk,,,[AC_MSG_RESULT(could not find pygtk module)]) If there ever will be another release from the dia-0-97 branch the issues should be revisited.
(In reply to comment #2) > the check still makes (some) sense I am sorry, but I think you misunderstood. glib.h has #included glib/gtestutils.h from the first moment that glib/gtestutils.h was added (which was in glib-2.15.1, see http://git.gnome.org/browse/glib/commit/?id=6332518cc25ff682bd2e9eacd02f9a5febf6c75e) test-boundingbox.c and test-objects.c #include <glib.h>, and so automatically get glib/gtestutils.h when building against >=glib-2.16. Therefore, #if GLIB_CHECK_VERSION(2,16,0) #include <glib/gtestutils.h> #endif in test-boundingbox.c and test-objects.c has never had any useful effect, no matter which glib version dia was being built against.
Pushed merge to dia-0-97: http://git.gnome.org./browse/dia/commit/?h=dia-0-97&id=ae61326cf5e7aaba6e72af757a5cd33efe8280a1