# $Id: $
#
AC_INIT([ibus],[0.0.1],[https://bugs.launchpad.net/ibus],[ibus])
-
AM_INIT_AUTOMAKE([1.10])
+AC_GNU_SOURCE
+
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
-AC_GNU_SOURCE
# define PACKAGE_VERSION_* variables
AS_VERSION
AC_HEADER_STDC
AM_PROG_LIBTOOL
-
+# check inotify
+AC_CHECK_HEADERS([sys/inotify.h])
# check glib2
AM_PATH_GLIB_2_0
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+#include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/un.h>
-#include <sys/inotify.h>
#include <string.h>
#include <stdarg.h>
#include <glib/gstdio.h>
#include <gdk/gdkx.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
+#ifdef HAVE_SYS_INOTIFY_H
+#define HAVE_INOTIFY
+# include <sys/inotify.h>
+#endif
#include "gikimclient.h"
#define IBUS_NAME "org.freedesktop.IBus"
#if USE_DBUS_SESSION_BUS
DBusConnection *dbus;
#endif
+
+#ifdef HAVE_INOTIFY
/* inotify */
gint inotify_wd;
GIOChannel *inotify_channel;
guint inotify_source;
+#endif
DBusConnection *ibus;
gboolean enable;
}
}
+#ifdef HAVE_INOTIFY
static gboolean
_gik_im_client_inotify_cb (GIOChannel *source, GIOCondition condition, GikIMClient *client)
{
g_free (p);
}
+#endif
static void
gik_im_client_init (GikIMClient *obj)
DBusError error;
GikIMClient *client = GIK_IM_CLIENT (obj);
GikIMClientPrivate *priv;
+
+#ifdef HAVE_INOTIFY
gint inotify_fd;
gchar *watch_path;
struct stat stat_buf;
(GIOFunc)_gik_im_client_inotify_cb,
(gpointer)client);
g_free (watch_path);
-
-
+#endif
#if USE_DBUS_SESSION_BUS
/*
g_assert (client == _client);
+#ifdef HAVE_INOTIFY
g_io_channel_unref (priv->inotify_channel);
g_source_remove (priv->inotify_source);
+#endif
if (priv->preedit_string) {
g_free (priv->preedit_string);