dbus client: make libunique dependency optional

Only use single-app-instance functionality if libunique devel
files are installed at configure time
This commit is contained in:
Jussi Kukkonen 2009-06-03 19:16:13 +03:00
parent d1e58f1d32
commit 5269021ccb
2 changed files with 34 additions and 2 deletions

View file

@ -235,8 +235,19 @@ if test $enable_gui == "moblin"; then
AC_DEFINE(USE_MOBLIN_UX, 1, [Use the MUX widget library])
fi
if test $enable_gui != "no"; then
PKG_CHECK_MODULES(GUI, glib-2.0 dbus-glib-1 >= 0.60 gtk+-2.0 libglade-2.0 gconf-2.0 gio-2.0 unique-1.0)
gui_modules="glib-2.0 dbus-glib-1 >= 0.60 gtk+-2.0 libglade-2.0 gconf-2.0 gio-2.0"
PKG_CHECK_MODULES(UNIQUE, unique-1.0,
have_unique="yes",
have_unique="no")
if test $have_unique == "yes"; then
gui_modules="$gui_modules unique-1.0"
AC_DEFINE(ENABLE_UNIQUE, 1, [enable single-app-instance functionality])
fi
PKG_CHECK_MODULES(GUI, $gui_modules)
AC_PATH_PROG([GTK_BUILDER_CONV], gtk-builder-convert)
IT_PROG_INTLTOOL([0.37.1])
GETTEXT_PACKAGE=syncevolution

View file

@ -19,11 +19,14 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <unique/unique.h>
#include "config.h"
#include "sync-ui.h"
#ifdef ENABLE_UNIQUE
#include <unique/unique.h>
enum
{
COMMAND_0,
@ -95,3 +98,21 @@ main (int argc, char *argv[])
g_object_unref (app);
return 0;
}
#else
int
main (int argc, char *argv[])
{
gtk_init (&argc, &argv);
bindtextdomain (GETTEXT_PACKAGE, SYNCEVOLUTION_LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
sync_ui_create_main_window ();
gtk_main ();
return 0;
}
#endif /* ENABLE_UNIQUE */