Fix build against libnotify >= 0.7.0.

This commit is contained in:
Daiki Ueno
2010-11-15 12:49:01 +09:00
parent 12bc18e1ba
commit 862a54eac3
2 changed files with 35 additions and 10 deletions

View File

@ -46,10 +46,14 @@ case "$with_gtk" in
;; ;;
3.0) GTK_API_VERSION=3.0 3.0) GTK_API_VERSION=3.0
GTK_REQUIRED=2.91.0 GTK_REQUIRED=2.91.0
EEK_API_VERSION=0.90 # EEK_API_VERSION=0.90
# EEK_API_MAJOR_VERSION=0
# EEK_API_MINOR_VERSION=90
# EEK_API_PC_VERSION=0.90
EEK_API_VERSION=0.1
EEK_API_MAJOR_VERSION=0 EEK_API_MAJOR_VERSION=0
EEK_API_MINOR_VERSION=90 EEK_API_MINOR_VERSION=1
EEK_API_PC_VERSION=0.90 EEK_API_PC_VERSION=0.1
EEK_LIBRARY_SUFFIX="-$EEK_API_VERSION" EEK_LIBRARY_SUFFIX="-$EEK_API_VERSION"
;; ;;
esac esac
@ -87,9 +91,25 @@ PKG_CHECK_MODULES([LIBFAKEKEY], [libfakekey], ,
[AC_MSG_ERROR([libfakekey not found])]) [AC_MSG_ERROR([libfakekey not found])])
PKG_CHECK_MODULES([CSPI], [cspi-1.0], , PKG_CHECK_MODULES([CSPI], [cspi-1.0], ,
[AC_MSG_ERROR([AT-SPI C not found])]) [AC_MSG_ERROR([AT-SPI C not found])])
PKG_CHECK_MODULES([NOTIFY], [libnotify], , PKG_CHECK_MODULES([NOTIFY], [libnotify], ,
[AC_MSG_ERROR([libnotify not found])]) [AC_MSG_ERROR([libnotify not found])])
dnl libnotify >= 0.7.0 omitted the feature to attach notification to widget.
need_libnotify_attach_workaround=0
save_CFLAGS="$CFLAGS"
CFLAGS="$NOTIFY_CFLAGS"
save_LIBS="$LIBS"
LIBS="$NOTIFY_LIBS"
AC_TRY_LINK([#include <libnotify/notification.h>],
[notify_notification_new (NULL, NULL, NULL);], ,
[need_libnotify_attach_workaround=1])
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
AC_DEFINE_UNQUOTED([NEED_LIBNOTIFY_ATTACH_WORKAROUND],
$need_libnotify_attach_workaround,
[Define if notify_notification_new work around is needed])
AC_MSG_CHECKING([whether you enable Vala language support]) AC_MSG_CHECKING([whether you enable Vala language support])
AC_ARG_ENABLE(vala, AC_ARG_ENABLE(vala,
AS_HELP_STRING([--enable-vala=no/yes], AS_HELP_STRING([--enable-vala=no/yes],
@ -117,12 +137,14 @@ if test x$enable_clutter = xyes; then
PKG_CHECK_MODULES([CLUTTER], [clutter-1.0], , PKG_CHECK_MODULES([CLUTTER], [clutter-1.0], ,
[AC_MSG_ERROR([Clutter not found -- install it or add --disable-clutter])]) [AC_MSG_ERROR([Clutter not found -- install it or add --disable-clutter])])
AC_DEFINE([HAVE_CLUTTER], [1], [Define if Clutter is found]) AC_DEFINE([HAVE_CLUTTER], [1], [Define if Clutter is found])
need_swap_event_workaround=no have_clutter_gtk=0
PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-1.0],, need_swap_event_workaround=0
PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-1.0], [have_clutter_gtk=1],
[PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-0.10 clutter-x11-1.0], [PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-0.10 clutter-x11-1.0],
[need_swap_event_workaround=yes])]) [have_clutter_gtk=1; need_swap_event_workaround=1])])
AC_DEFINE([HAVE_CLUTTER_GTK], [1], [Define if Clutter-Gtk is found]) AC_DEFINE_UNQUOTED([HAVE_CLUTTER_GTK], $have_clutter_gtk,
AC_DEFINE([NEED_SWAP_EVENT_WORKAROUND], [1], [Define if Clutter-Gtk is found])
AC_DEFINE_UNQUOTED([NEED_SWAP_EVENT_WORKAROUND], $need_swap_event_workaround,
[Define if GLX_INTEL_swap_event work around is needed]) [Define if GLX_INTEL_swap_event work around is needed])
fi fi
AM_CONDITIONAL(HAVE_CLUTTER, [test x$enable_clutter = xyes]) AM_CONDITIONAL(HAVE_CLUTTER, [test x$enable_clutter = xyes])

View File

@ -1645,8 +1645,11 @@ main (int argc, char *argv[])
"eekboard is starting without a window.\n" "eekboard is starting without a window.\n"
"To make eekboard show up, click on some window with " "To make eekboard show up, click on some window with "
"an editable widget.", "an editable widget.",
"keyboard", "keyboard"
NULL); #if NEED_LIBNOTIFY_ATTACH_WORKAROUND
, NULL
#endif
);
notify_notification_add_action notify_notification_add_action
(notification, (notification,
"dont-ask", "dont-ask",