summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-07-01 19:17:12 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-07-01 19:17:12 -0700
commit5583dcb6c889512e891dc9c6e76acf3654eb4ebc (patch)
tree824eb3245952e5a5a0b0495319b0c9e980911752
parentc2418359b3e9f2eb7a72f4ea5245637190571cc8 (diff)
downloademacs-5583dcb6c889512e891dc9c6e76acf3654eb4ebc.tar.gz
* configure.ac (GTK_COMPILES): Check API a bit more carefully.
Also check that it links. Say whether it compiled and linked.
-rw-r--r--ChangeLog5
-rw-r--r--configure.ac22
2 files changed, 26 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a073ea42ed7..0f793066595 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ * configure.ac (GTK_COMPILES): Check API a bit more carefully.
+ Also check that it links. Say whether it compiled and linked.
+
2013-07-01 Paul Eggert <eggert@cs.ucla.edu>
Merge from gnulib, incorporating:
diff --git a/configure.ac b/configure.ac
index 2a7fb209a59..b36c41691fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2131,8 +2131,28 @@ if test x"$pkg_check_gtk" = xyes; then
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$GTK_LIBS $LIBS"
dnl Try to compile a simple GTK program.
+ AC_MSG_CHECKING([whether GTK compiles])
GTK_COMPILES=no
- AC_CHECK_FUNCS(gtk_main, GTK_COMPILES=yes)
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Check the Gtk and Glib APIs. */
+ #include <gtk/gtk.h>
+ #include <glib-object.h>
+ static void
+ callback (GObject *go, GParamSpec *spec, gpointer user_data)
+ {}
+ ]],
+ [[
+ GtkSettings *gs = 0;
+ /* Use G_CALLBACK to make sure function pointers can be cast to void *;
+ strict C prohibits this. Use gtk_main_iteration to test that the
+ libraries are there. */
+ if (g_signal_handler_find (G_OBJECT (gs), G_SIGNAL_MATCH_FUNC,
+ 0, 0, 0, G_CALLBACK (callback), 0))
+ gtk_main_iteration ();
+ ]])],
+ [GTK_COMPILES=yes])
+ AC_MSG_RESULT([$GTK_COMPILES])
if test "${GTK_COMPILES}" != "yes"; then
GTK_OBJ=
if test "$USE_X_TOOLKIT" != "maybe"; then