From 469d80f6b3dcfc2900f0faf5ab553fb3531c41f9 Mon Sep 17 00:00:00 2001 From: Eduardo Lima Date: Wed, 21 Dec 2005 21:29:39 +0000 Subject: [PATCH] Included option in configure to make ps backend compilation optional with 2005-12-21 Eduardo Lima * Makefile.am: * configure.ac: * backend/Makefile.am: * backend/ev-document-factory.c: * shell/ev-document-types.c: Included option in configure to make ps backend compilation optional with --disable-ps. --- ChangeLog | 10 ++++++++++ Makefile.am | 6 +++++- backend/Makefile.am | 6 +++++- backend/ev-document-factory.c | 4 ++++ configure.ac | 15 ++++++++++++++- shell/ev-document-types.c | 2 ++ 6 files changed, 40 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 324d5986..92caf14b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-12-21 Eduardo Lima + * Makefile.am: + * configure.ac: + * backend/Makefile.am: + * backend/ev-document-factory.c: + * shell/ev-document-types.c: + + Included option in configure to make ps backend + compilation optional with --disable-ps. + 2005-12-20 Nickolay V. Shmyrev * backend/ev-document-factory.c: diff --git a/Makefile.am b/Makefile.am index 5acc74fd..de5ad3e7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,11 @@ SUBDIRS = cut-n-paste po help data # Backends -SUBDIRS += pdf ps +SUBDIRS += pdf + +if ENABLE_PS +SUBDIRS += ps +endif if ENABLE_PIXBUF SUBDIRS += pixbuf diff --git a/backend/Makefile.am b/backend/Makefile.am index 75509e69..97f99105 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -45,8 +45,12 @@ libevbackend_la_SOURCES= \ ev-document-misc.c libevbackend_la_LIBADD = \ - $(top_builddir)/pdf/libpdfdocument.la \ + $(top_builddir)/pdf/libpdfdocument.la + +if ENABLE_PS +libevbackend_la_LIBADD += \ $(top_builddir)/ps/libpsdocument.la +endif if ENABLE_PIXBUF libevbackend_la_LIBADD += \ diff --git a/backend/ev-document-factory.c b/backend/ev-document-factory.c index 1cf30141..a695c452 100644 --- a/backend/ev-document-factory.c +++ b/backend/ev-document-factory.c @@ -28,7 +28,9 @@ #include "ev-poppler.h" #include "pixbuf-document.h" #include "tiff-document.h" +#ifdef ENABLE_PS #include "ps-document.h" +#endif #ifdef ENABLE_DVI #include "dvi-document.h" #endif @@ -53,10 +55,12 @@ const EvDocumentType document_types[] = { /* PDF: */ {"application/pdf", EV_BACKEND_PDF, pdf_document_get_type}, +#ifdef ENABLE_PS /* Postscript: */ {"application/postscript", EV_BACKEND_PS, ps_document_get_type}, {"application/x-gzpostscript", EV_BACKEND_PS, ps_document_get_type}, {"image/x-eps", EV_BACKEND_PS, ps_document_get_type}, +#endif #ifdef ENABLE_TIFF /* Tiff: */ diff --git a/configure.ac b/configure.ac index 3fe05b03..b66c1881 100644 --- a/configure.ac +++ b/configure.ac @@ -137,6 +137,15 @@ dnl for backtrace() AC_CHECK_HEADERS([execinfo.h]) dnl ================== ggv checks =================================================== +AC_ARG_ENABLE(ps, + [AC_HELP_STRING([--disable-ps], [Compile without PostScript backend])],enable_ps=$enableval,enable_ps="yes") + +if test x$enable_ps = xyes; then + AC_DEFINE([ENABLE_PS], [1], [Enable support for PostScript files.]) +fi + +AM_CONDITIONAL(ENABLE_PS, test x$enable_ps = xyes) +if test x$enable_ps = xyes; then AC_ARG_WITH(gs-pkg, [ --with-gs=dir Directory Where GhostScript package is installed.]) @@ -162,6 +171,7 @@ fi AA_PARMS="-sDEVICE=x11alpha -dNOPLATFONTS" AC_DEFINE_UNQUOTED(ALPHA_PARAMS, "$AA_PARMS", [Anti-aliasing parameters for Ghostscript.]) AC_MSG_RESULT(Antialiasing parameters for Ghostscript: $AA_PARMS) +fi dnl ======================== End of ggv checks ================================= dnl ================== tiff checks =================================================== @@ -279,8 +289,11 @@ dnl ================== End of comic book checks ================================ dnl =================== Mime types list ==================================================== -EVINCE_MIME_TYPES="application/pdf;application/postscript;application/x-gzpostscript" +EVINCE_MIME_TYPES="application/pdf" +if test "x$disable_ps" = "xno" ; then + EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/postscript;application/x-gzpostscript" +fi if test "x$enable_dvi" = "xyes"; then EVINCE_MIME_TYPES="$EVINCE_MIME_TYPES;application/x-dvi" fi diff --git a/shell/ev-document-types.c b/shell/ev-document-types.c index 27fb2fe2..d6634f3c 100644 --- a/shell/ev-document-types.c +++ b/shell/ev-document-types.c @@ -136,6 +136,7 @@ ev_document_types_add_filters (GtkWidget *chooser, EvDocument *document) gtk_file_filter_add_pixbuf_formats (filter); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); +#ifdef ENABLE_PS if (document == NULL || backend == EV_BACKEND_PS) { default_filter = filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, _("PostScript Documents")); @@ -143,6 +144,7 @@ ev_document_types_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 if (document == NULL || backend == EV_BACKEND_PDF) { default_filter = filter = gtk_file_filter_new (); -- 2.43.0