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 642479 - Allow checking for GDK backends
Allow checking for GDK backends
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-02-16 16:26 UTC by Emmanuele Bassi (:ebassi)
Modified: 2011-02-16 18:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow checking for GDK backends (1.80 KB, patch)
2011-02-16 16:26 UTC, Emmanuele Bassi (:ebassi)
accepted-commit_now Details | Review
Allow checking for GDK backends / v2.0 (2.87 KB, patch)
2011-02-16 17:54 UTC, Emmanuele Bassi (:ebassi)
none Details | Review

Description Emmanuele Bassi (:ebassi) 2011-02-16 16:26:51 UTC
Third party code used to rely on the target variable in pkg-config to conditionally compile. Since the target variable has been replaced by the targets one, listing multiple backends, this is not possible any more.

GTK+ should ship a simple m4 macro to achieve the same results.
Comment 1 Emmanuele Bassi (:ebassi) 2011-02-16 16:26:53 UTC
Created attachment 181018 [details] [review]
Allow checking for GDK backends

Now that a single shared object can contain multiple backends we also
need to provide a simple way for third party code to verify that the
copy of GDK they are linking to supports their backend.

The simplest way to verify is an m4 macro, GTK_CHECK_BACKEND(), shipped
with the gtk+ m4 macros.

The usage is pretty basic:

  GTK_CHECK_BACKEND([x11], [gtk_has_x11=yes], [gtk_has_x11=no])
  AM_CONDITIONAL(BUILD_X11_CODE, test "x$gtk_has_x11" = "xno")
Comment 2 Matthias Clasen 2011-02-16 17:26:02 UTC
Review of attachment 181018 [details] [review]:

Looks good to me; would be good to mention in the docs, both in the migration guide for backend-specific code, and in the 'compiling applications' section
Comment 3 Emmanuele Bassi (:ebassi) 2011-02-16 17:54:30 UTC
Created attachment 181026 [details] [review]
Allow checking for GDK backends / v2.0

Same patch, but with the macro documented in the migration guide.

The "Compiling" section does mention autotools, so I'm not really sure how to bring the macro up.
Comment 4 Emmanuele Bassi (:ebassi) 2011-02-16 18:49:56 UTC
Pushed a fixed version of the patch, thanks to mitch