PKG_CHECK_MODULES(PREVIEWER, gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gthread-2.0)
-if test "$os_win32" = no; then
- PKG_CHECK_MODULES(SMCLIENT, gtk+-2.0 gthread-2.0 sm >= 1.0.0)
-else
- PKG_CHECK_MODULES(SMCLIENT, gtk+-2.0 gthread-2.0)
+# *********
+# SM client
+# *********
+
+GDK_TARGET="$($PKG_CONFIG --variable target gdk-2.0)"
+
+SMCLIENT_PKGS=
+AC_MSG_CHECKING([which smclient backend to use])
+AC_ARG_WITH([smclient],
+ [AS_HELP_STRING([--with-smclient-backend],[which smclient backend to use (no|xsmp|win32|quartz)])],
+ [],
+ [case "$GDK_TARGET" in
+ x11) case "$with_platform" in
+ gnome) with_smclient=xsmp SMCLIENT_PKGS="sm >= 1.0.0" ;;
+ *) with_smclient=no ;;
+ esac ;;
+ win32|quartz) with_smclient=$GDK_TARGET ;;
+ *) with_smclient=no ;;
+ esac])
+AC_MSG_RESULT([$with_smclient])
+
+if test "$with_smclient" != "no"; then
+ AC_DEFINE([WITH_SMCLIENT],[1],[Define if smclient is enabled])
+
+ PKG_CHECK_MODULES([SMCLIENT],[gtk+-2.0 gthread-2.0 $SMCLIENT_PKGS])
+ AC_SUBST([SMCLIENT_CFLAGS])
+ AC_SUBST([SMCLIENT_LIBS])
fi
-AC_SUBST(SMCLIENT_CFLAGS)
-AC_SUBST(SMCLIENT_LIBS)
+AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
+AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
+AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
+AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])
+
+# ***
BACKEND_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -export-symbols \$(top_srcdir)/backend/backend.symbols"
AC_SUBST(BACKEND_LIBTOOL_FLAGS)
GTK+ Unix Print....: $with_gtk_unix_print
Keyring Support....: $with_keyring
DBUS Support.......: $enable_dbus
+ SM client support..: $with_smclient
Nautilus Plugin....: $enable_nautilus
Thumbnailer........: $enable_thumbnailer
Previewer..........: $enable_previewer
noinst_LTLIBRARIES = libsmclient.la
-if OS_WIN32
-platform_sources = eggsmclient-win32.c
-else
-platform_sources = \
- eggsmclient-xsmp.c \
- eggdesktopfile.c \
- eggdesktopfile.h
-platform_defines = -DEGG_SM_CLIENT_BACKEND_XSMP
-endif
+NULL =
+
+if WITH_SMCLIENT
+libsmclient_la_SOURCES = \
+ eggdesktopfile.c \
+ eggdesktopfile.h \
+ eggsmclient.c \
+ eggsmclient.h \
+ eggsmclient-private.h \
+ $(NULL)
-libsmclient_la_SOURCES = \
- eggsmclient.c \
- eggsmclient.h \
- eggsmclient-private.h \
- $(platform_sources)
+libsmclient_la_CPPFLAGS = \
+ -DG_LOG_DOMAIN=\""EggSMClient"\" \
+ $(DISABLE_DEPRECATED) \
+ $(AM_CPPFLAGS)
-libsmclient_la_CFLAGS = \
- -DG_LOG_DOMAIN=\""EggSMClient"\" \
- $(platform_defines) \
- $(SMCLIENT_CFLAGS) \
- $(WARNING_CFLAGS) \
- $(DISABLE_DEPRECATED)
+libsmclient_la_CFLAGS = \
+ $(SMCLIENT_CFLAGS) \
+ $(WARNING_CFLAGS) \
+ $(AM_CFLAGS)
-libsmclient_la_LIBADD = $(SMCLIENT_LIBS)
+libsmclient_la_LIBADD = \
+ $(SMCLIENT_LIBS)
-EXTRA_DIST = \
- eggsmclient-win32.c \
- eggsmclient-xsmp.c \
- eggdesktopfile.c \
- eggdesktopfile.h
+if WITH_SMCLIENT_XSMP
+libsmclient_la_SOURCES += eggsmclient-xsmp.c
+libsmclient_la_CPPFLAGS += -DEGG_SM_CLIENT_BACKEND_XSMP
+endif
+if WITH_SMCLIENT_WIN32
+libsmclient_la_SOURCES += eggsmclient-win32.c
+endif
+if WITH_SMCLIENT_QUARTZ
+libsmclient_la_SOURCES += eggsmclient-osx.c
+endif
+endif # WITH_SMCLIENT
#endif
#include "totem-scrsaver.h"
+
+#ifdef WITH_SMCLIENT
#include "eggsmclient.h"
+#endif
#include "ev-application.h"
#include "ev-document-factory.h"
TotemScrsaver *scr_saver;
+#ifdef WITH_SMCLIENT
EggSMClient *smclient;
+#endif
gchar *filechooser_open_uri;
gchar *filechooser_save_uri;
GKeyFile *state_file;
gchar **uri_list;
+#ifdef WITH_SMCLIENT
if (egg_sm_client_is_resumed (application->smclient)) {
state_file = egg_sm_client_get_state_file (application->smclient);
if (!state_file)
return FALSE;
- } else if (g_file_test (application->crashed_file, G_FILE_TEST_IS_REGULAR)) {
+ } else
+#endif /* WITH_SMCLIENT */
+ if (g_file_test (application->crashed_file, G_FILE_TEST_IS_REGULAR)) {
if (ev_application_run_crash_recovery_dialog (application)) {
state_file = g_key_file_new ();
g_key_file_load_from_file (state_file,
return TRUE;
}
+#ifdef WITH_SMCLIENT
+
static void
smclient_save_state_cb (EggSMClient *client,
GKeyFile *state_file,
ev_application_shutdown (application);
}
+#endif /* WITH_SMCLIENT */
+
static void
ev_application_init_session (EvApplication *application)
{
application->crashed_file = g_build_filename (application->dot_dir,
"evince-crashed", NULL);
+#ifdef WITH_SMCLIENT
application->smclient = egg_sm_client_get ();
g_signal_connect (application->smclient, "save_state",
G_CALLBACK (smclient_save_state_cb),
g_signal_connect (application->smclient, "quit",
G_CALLBACK (smclient_quit_cb),
application);
+#endif
}
/**
#include "ev-init.h"
#include "ev-file-helpers.h"
#include "ev-stock-icons.h"
+
+#ifdef WITH_SMCLIENT
#include "eggsmclient.h"
#ifndef G_OS_WIN32
#include "eggdesktopfile.h"
#endif
+#endif /* WITH_SMCLIENT */
static gchar *ev_page_label;
static gchar *ev_find_string;
context = g_option_context_new (N_("GNOME Document Viewer"));
g_option_context_set_translation_domain(context, GETTEXT_PACKAGE);
g_option_context_add_main_entries (context, goption_options, GETTEXT_PACKAGE);
-
+
+#ifdef WITH_SMCLIENT
g_option_context_add_group (context, egg_sm_client_get_option_group ());
+#endif
+
g_option_context_add_group (context, gtk_get_option_group (TRUE));
if (!g_option_context_parse (context, &argc, &argv, &error)) {
ev_stock_icons_init ();
-#ifdef G_OS_WIN32
- /* Manually set name and icon in win32 */
- g_set_application_name (_("Evince"));
- gtk_window_set_default_icon_name ("evince");
-#else
+#if defined(WITH_SMCLIENT) && !defined(G_OS_WIN32)
egg_set_desktop_file (GNOMEDATADIR "/applications/evince.desktop");
-#endif /* G_OS_WIN32 */
+#else
+ /* Manually set name and icon */
+ g_set_application_name (_("Document Viewer"));
+ gtk_window_set_default_icon_name ("evince");
+#endif /* WITH_SMCLIENT && !G_OS_WIN32 */
ev_application_load_session (EV_APP);
load_files (file_arguments, args);