]> www.fi.muni.cz Git - evince.git/commitdiff
Add --without-libgnome, check for libgnome and libgnomeui separately, and
authorRoss Burton <ross@openedhand.com>
Fri, 4 May 2007 15:17:37 +0000 (15:17 +0000)
committerRoss Burton <rburton@src.gnome.org>
Fri, 4 May 2007 15:17:37 +0000 (15:17 +0000)
2007-05-04  Ross Burton  <ross@openedhand.com>

* configure.ac:
Add --without-libgnome, check for libgnome and libgnomeui
separately, and add them to the symbols as required.

* libdocument/ev-file-helpers.c:
When building without libgnome, use g_get_user_config_dir instead
of gnome_user_dir_get.

* shell/ev-application.c:
When building without libgnome, don't use session management.

* shell/main.c:
When building without libgnome, don't use GnomeProgram or
initialise the authentication manager.

This fixes #328842.

svn path=/trunk/; revision=2436

ChangeLog
configure.ac
libdocument/ev-file-helpers.c
shell/ev-application.c
shell/main.c

index 99c8bb10edbc80de9629b28bf03d5fe6adb284ed..4e9a61434dd964dc4430248e587cc9bd705db0f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2007-05-04  Ross Burton  <ross@openedhand.com>
+
+       * configure.ac:
+       Add --without-libgnome, check for libgnome and libgnomeui
+       separately, and add them to the symbols as required.
+
+       * libdocument/ev-file-helpers.c:
+       When building without libgnome, use g_get_user_config_dir instead
+       of gnome_user_dir_get.
+
+       * shell/ev-application.c:
+       When building without libgnome, don't use session management.
+
+       * shell/main.c:
+       When building without libgnome, don't use GnomeProgram or
+       initialise the authentication manager.
+
+       This fixes #328842.
+
 2007-05-04  Ross Burton  <ross@openedhand.com>
 
        * shell/ev-window.c:
index b418a54e55b365395b770e9edf726134c3215fa2..8962561b59ba4bf01a055da2a585e398201884c9 100644 (file)
@@ -54,13 +54,26 @@ LIBXML_REQUIRED=2.5.0
 
 GTK_PRINT_REQUIRED=2.10.0
 
-PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED)
-PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED gnome-vfs-2.0 libgnome-2.0 >= $LIBGNOME_REQUIRED)
-PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libglade-2.0 gnome-vfs-2.0)
-PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0 gnome-keyring-1 >= $KEYRING_REQUIRED)
+PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED)
+PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED gnome-vfs-2.0)
+PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 gnome-vfs-2.0)
+PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0 gnome-keyring-1 >= $KEYRING_REQUIRED)
+
+AC_ARG_WITH(libgnome,
+        AC_HELP_STRING([--without-libgnome],[disable the use of libgnome]),
+       [case "${withval}" in
+       yes) WITH_GNOME=yes ;;
+       no) WITH_GNOME=no ;;
+       *) AC_MSG_ERROR(bad value ${withval} for --with-libgnome) ;;
+       esac],
+       [WITH_GNOME=yes]) dnl Default value
+AM_CONDITIONAL(WITH_GNOME, test x$WITH_GNOME = "xyes")
 
-BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
-AC_SUBST(BACKEND_CFLAGS)
+if test x$WITH_GNOME = "xyes"; then
+        PKG_CHECK_MODULES(GNOME, libgnome-2.0 >= $LIBGNOME_REQUIRED)
+        PKG_CHECK_MODULES(GNOMEUI, libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
+        AC_DEFINE([WITH_GNOME],[1],[Define if GNOME support is enabled])
+fi
 
 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`  
 AC_SUBST(GLIB_GENMARSHAL)
@@ -134,8 +147,18 @@ if test "x$enable_dbus" = "xyes" ; then
         AC_DEFINE([ENABLE_DBUS],[1],[Define if DBUS support is enabled])
 fi
 
-SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
-SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS -lz"
+LIB_CFLAGS="$LIB_CFLAGS $GNOME_CFLAGS"
+LIB_LIBS="$LIB_LIBS $GNOME_LIBS"
+AC_SUBST(LIB_CFLAGS)
+AC_SUBST(LIB_LIBS)
+
+BACKEND_CFLAGS="$BACKEND_CFLAGS $GNOME_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
+BACKEND_LIBS="$BACKEND_LIBS $GNOME_LIBS"
+AC_SUBST(BACKEND_CFLAGS)
+AC_SUBST(BACKEND_LIBS)
+
+SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $GNOMEUI_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
+SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $GNOMEUI_LIBS -lz"
 AC_SUBST(SHELL_CFLAGS)
 AC_SUBST(SHELL_LIBS)
 
@@ -468,6 +491,7 @@ AC_OUTPUT
 
 echo "
 Configure summary:
+       GNOME Support......:  $WITH_GNOME
        Print Support......:  $enable_print
        DBUS Support.......:  $enable_dbus
        Nautilus Plugin....:  $HAVE_NAUTILUS
index d9b6448418b1739e33196265d76a37f433e5cb89..5e83b3bc957c1376ca305f906e873848a9b5a29d 100644 (file)
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <libgnomevfs/gnome-vfs-xfer.h>
+
+#if WITH_GNOME
 #include <libgnome/gnome-init.h>
+#endif
 
 #include "ev-file-helpers.h"
 
@@ -63,9 +66,15 @@ ev_dot_dir (void)
        if (dot_dir == NULL) {
                gboolean exists;
 
+#if WITH_GNOME
                dot_dir = g_build_filename (gnome_user_dir_get (),
                                            "evince",
                                            NULL);
+#else
+               dot_dir = g_build_filename (g_get_user_config_dir (),
+                                           "evince",
+                                           NULL);
+#endif
 
                exists = ensure_dir_exists (dot_dir);
                if (!exists)
index 99ab0daf48a47435798417325135c3f6082ec9de..75c22470ce8cc486398ee110efa1f33f7940e66d 100644 (file)
 #include <gtk/gtkstock.h>
 #include <gtk/gtkwidget.h>
 #include <gtk/gtkmain.h>
+
+#if WITH_GNOME
 #include <libgnomeui/gnome-client.h>
-#include <string.h>
+#endif
 
 #ifdef ENABLE_DBUS
 #include "ev-application-service.h"
 #include <dbus/dbus-glib-bindings.h>
 #endif
 
+#include <string.h>
+
 struct _EvApplication {
        GObject base_instance;
 
@@ -137,6 +141,7 @@ ev_application_get_instance (void)
        return instance;
 }
 
+#if WITH_GNOME
 static void
 removed_from_session (GnomeClient *client, EvApplication *application)
 {
@@ -184,6 +189,7 @@ init_session (EvApplication *application)
        g_signal_connect (client, "die",
                          G_CALLBACK (removed_from_session), application);
 }
+#endif
 
 /**
  * ev_display_open_if_needed:
@@ -603,7 +609,9 @@ ev_application_class_init (EvApplicationClass *ev_application_class)
 static void
 ev_application_init (EvApplication *ev_application)
 {
+#if WITH_GNOME
        init_session (ev_application);
+#endif
 
        ev_application->toolbars_model = egg_toolbars_model_new ();
 
index 090b6bf888006a8c588781fa6858a7acf6838162..64b86dfa05c99826021289017183c736ece12df4 100644 (file)
 #include <gtk/gtkmain.h>
 #include <stdlib.h>
 #include <string.h>
+
+#if WITH_GNOME
 #include <libgnome/gnome-program.h>
 #include <libgnomeui/gnome-ui-init.h>
 #include <libgnomeui/gnome-app-helper.h>
 #include <libgnomeui/gnome-authentication-manager.h>
+#endif
+
+#include <libgnomevfs/gnome-vfs-init.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
 
 #ifdef ENABLE_DBUS
@@ -282,7 +287,11 @@ main (int argc, char *argv[])
        gboolean enable_metadata = FALSE;
        GOptionContext *context;
        GHashTable *args;
+#if WITH_GNOME
        GnomeProgram *program;
+#else
+       GError *error = NULL;
+#endif
 
        context = g_option_context_new (_("GNOME Document Viewer"));
 
@@ -296,12 +305,24 @@ main (int argc, char *argv[])
        g_option_context_add_main_entries (context, goption_options, NULL);
 #endif
 
+#if WITH_GNOME
        program = gnome_program_init (PACKAGE, VERSION,
                                      LIBGNOMEUI_MODULE, argc, argv,
                                      GNOME_PARAM_GOPTION_CONTEXT, context,
                                      GNOME_PARAM_HUMAN_READABLE_NAME, _("Evince"),
                                      GNOME_PARAM_APP_DATADIR, GNOMEDATADIR,
                                      NULL);
+#else
+       g_option_context_add_group (context, gtk_get_option_group (TRUE));
+       if (!g_option_context_parse (context, &argc, &argv, &error)) {
+               g_warning ("Cannot parse arguments: %s", error->message);
+               g_error_free (error);
+               return 1;
+       }
+       g_option_context_free (context);
+       
+       gnome_vfs_init ();
+#endif
 
        args = arguments_parse ();
 
@@ -309,16 +330,19 @@ main (int argc, char *argv[])
        if (!ev_application_register_service (EV_APP)) {
                if (load_files_remote (file_arguments, args)) {
                        g_hash_table_destroy (args);
+#if WITH_GNOME
                        g_object_unref (program);
-                       
+#endif
                        return 0;
                }
        } else {
                enable_metadata = TRUE;
        }
 #endif
-       
+
+#if WITH_GNOME 
        gnome_authentication_manager_init ();
+#endif
 
        if (enable_metadata) {
                ev_metadata_manager_init ();
@@ -336,13 +360,19 @@ main (int argc, char *argv[])
 
        gtk_main ();
 
+#if WITH_GNOME
        gnome_accelerators_sync ();
+#endif
+
        ev_file_helpers_shutdown ();
 
        if (enable_metadata) {
                ev_metadata_manager_shutdown ();
        }
-       g_object_unref (program);
 
+#if WITH_GNOME
+       g_object_unref (program);
+#endif
+       
        return 0;
 }