From: Yevgen Muntyan Date: Thu, 30 Nov 2006 20:58:58 +0000 (+0000) Subject: Make pdf compilation optional. See bug #38007. X-Git-Tag: EVINCE_0_7_0~43 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=2dc20d298ea8064cf09bc5acc201a9df4e4cd4f0;p=evince.git Make pdf compilation optional. See bug #38007. 2006-11-30 Yevgen Muntyan * Makefile.am: * backend/Makefile.am: * backend/ev-document-factory.c: (ev_document_factory_add_filters): * configure.ac: * shell/ev-window.c: (build_comments_string): Make pdf compilation optional. See bug #38007. --- diff --git a/ChangeLog b/ChangeLog index fdfb9e17..d0a8f3ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-11-30 Yevgen Muntyan + + * Makefile.am: + * backend/Makefile.am: + * backend/ev-document-factory.c: (ev_document_factory_add_filters): + * configure.ac: + * shell/ev-window.c: (build_comments_string): + + Make pdf compilation optional. See bug #38007. + 2006-11-30 Carlos Garcia Campos * ps/ps.c: (get_next_text): diff --git a/Makefile.am b/Makefile.am index 5c04b74f..c2162923 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,9 @@ SUBDIRS = cut-n-paste po help data # Backends +if ENABLE_PDF SUBDIRS += pdf +endif if ENABLE_PS SUBDIRS += ps diff --git a/backend/Makefile.am b/backend/Makefile.am index f7ae5ec5..bcf975a3 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -52,8 +52,12 @@ libevbackend_la_SOURCES= \ ev-document-misc.h \ ev-document-misc.c -libevbackend_la_LIBADD = \ +libevbackend_la_LIBADD = + +if ENABLE_PDF +libevbackend_la_LIBADD += \ $(top_builddir)/pdf/libpdfdocument.la +endif if ENABLE_PS libevbackend_la_LIBADD += \ diff --git a/backend/ev-document-factory.c b/backend/ev-document-factory.c index f524e1a0..78be656c 100644 --- a/backend/ev-document-factory.c +++ b/backend/ev-document-factory.c @@ -65,8 +65,10 @@ struct _EvDocumentType }; const EvDocumentType document_types[] = { +#ifdef ENABLE_PDF /* PDF: */ {"application/pdf", EV_BACKEND_PDF, pdf_document_get_type}, +#endif #ifdef ENABLE_PS /* Postscript: */ @@ -390,6 +392,7 @@ ev_document_factory_add_filters (GtkWidget *chooser, EvDocument *document) } #endif +#ifdef ENABLE_PDF if (document == NULL || backend == EV_BACKEND_PDF) { default_filter = filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, _("PDF Documents")); @@ -397,6 +400,7 @@ ev_document_factory_add_filters (GtkWidget *chooser, EvDocument *document) file_filter_add_mime_list_and_free (filter, mime_types); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); } +#endif #ifdef ENABLE_PIXBUF if (document == NULL || backend == EV_BACKEND_PIXBUF) { diff --git a/configure.ac b/configure.ac index ed19edc8..a299f094 100644 --- a/configure.ac +++ b/configure.ac @@ -198,6 +198,7 @@ if test "x$enable_pdf" = "xyes"; then AC_DEFINE([ENABLE_PDF], [1], [Enable pdf support.]) FRONTEND_LIBS="$FRONTEND_LIBS $POPPLER_LIBS" SHELL_LIBS="$SHELL_LIBS $POPPLER_LIBS" + SHELL_CFLAGS="$SHELL_CFLAGS $POPPLER_CFLAGS" else AC_MSG_WARN("PDF support is disabled since poppler-glib library version $POPPLER_REQUIRED or newer not found") fi diff --git a/shell/ev-window.c b/shell/ev-window.c index 74426547..98d888f4 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -80,7 +80,9 @@ #include #endif +#ifdef ENABLE_PDF #include +#endif #include #include @@ -3088,6 +3090,7 @@ ev_window_dual_mode_changed_cb (EvView *view, GParamSpec *pspec, EvWindow *ev_wi static char * build_comments_string (void) { +#ifdef ENABLE_PDF PopplerBackend backend; const char *backend_name; const char *version; @@ -3109,6 +3112,9 @@ build_comments_string (void) return g_strdup_printf (_("PostScript and PDF File Viewer.\n" "Using poppler %s (%s)"), version, backend_name); +#else + return g_strdup_printf (_("Document Viewer.")); +#endif } static void