| Allow disabling ghostscript and foomatic. Pulled from upstream bzr rev 7447: |
| |
| https://bugs.linuxfoundation.org/show_bug.cgi?id=1342 |
| |
| --- a/Makefile.am |
| +++ b/Makefile.am |
| @@ -412,11 +412,14 @@ pdftopdf_LDADD = \ |
| # Simple filter binaries |
| # ====================== |
| pkgfilter_SCRIPTS = \ |
| - filter/gstopxl \ |
| filter/imagetops \ |
| filter/pstopdf \ |
| filter/textonly \ |
| filter/texttops |
| +if ENABLE_GHOSTSCRIPT |
| +pkgfilter_SCRIPTS += \ |
| + filter/gstopxl |
| +endif |
| if ENABLE_BRAILLE |
| nodist_pkgfilter_SCRIPTS = \ |
| filter/braille/drivers/generic/brftoembosser \ |
| @@ -420,8 +423,6 @@ pdftopdf_LDADD = \ |
| bannertopdf \ |
| commandtoescpx \ |
| commandtopclx \ |
| - foomatic-rip \ |
| - gstoraster \ |
| pdftoijs \ |
| sys5ippprinter \ |
| pdftops \ |
| @@ -432,6 +433,14 @@ pkgfilter_PROGRAMS += \ |
| texttopdf \ |
| urftopdf \ |
| rastertopdf |
| +if ENABLE_GHOSTSCRIPT |
| +pkgfilter_PROGRAMS += \ |
| + gstoraster |
| +endif |
| +if ENABLE_FOOMATIC |
| +pkgfilter_PROGRAMS += \ |
| + foomatic-rip |
| +endif |
| if ENABLE_IMAGEFILTERS |
| pkgfilter_PROGRAMS += \ |
| imagetopdf \ |
| @@ -737,8 +746,11 @@ initrcdir = $(INITDDIR) |
| initrc_SCRIPTS = utils/cups-browsed |
| man_MANS = \ |
| utils/cups-browsed.8 \ |
| - utils/cups-browsed.conf.5 \ |
| + utils/cups-browsed.conf.5 |
| +if ENABLE_FOOMATIC |
| +man_MANS += \ |
| filter/foomatic-rip/foomatic-rip.1 |
| +endif |
| EXTRA_DIST += utils/cups-browsed.in \ |
| $(man_MANS) |
| utils/org.cups.cupsd.Notifier.xml |
| @@ -752,9 +764,12 @@ ppd_DATA = \ |
| ppd/HP-Color_LaserJet_CM3530_MFP-PDF.ppd \ |
| ppd/HP-PhotoSmart_Pro_B8300-hpijs-pdftoijs.ppd \ |
| ppd/Ricoh-PDF_Printer-PDF.ppd \ |
| - ppd/pxlcolor.ppd \ |
| - ppd/pxlmono.ppd \ |
| ppd/textonly.ppd |
| +if ENABLE_GHOSTSCRIPT |
| +ppd_DATA += \ |
| + ppd/pxlcolor.ppd \ |
| + ppd/pxlmono.ppd |
| +endif |
| |
| EXTRA_DIST += $(ppd_DATA) |
| |
| @@ -782,7 +797,9 @@ distclean-local: |
| install-exec-hook: |
| $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) |
| $(INSTALL) -d -m 755 $(DESTDIR)$(pkgfilterdir) |
| +if ENABLE_FOOMATIC |
| $(LN_S) -f $(pkgfilterdir)/foomatic-rip $(DESTDIR)$(bindir) |
| +endif |
| if ENABLE_BRAILLE |
| $(LN_S) -f imagetobrf $(DESTDIR)$(pkgfilterdir)/imagetoubrl |
| $(LN_S) -f textbrftoindexv3 $(DESTDIR)$(pkgfilterdir)/textbrftoindexv4 |
| @@ -806,7 +823,9 @@ if RCLINKS |
| fi |
| endif |
| $(RM) $(DESTDIR)$(pkgcharsetdir)/pdf.utf-8 |
| +if ENABLE_FOOMATIC |
| $(RM) $(DESTDIR)$(bindir)/foomatic-rip |
| +endif |
| if ENABLE_BRAILLE |
| $(RM) $(DESTDIR)$(pkgfilterdir)/imagetoubrl |
| $(RM) $(DESTDIR)$(pkgfilterdir)/textbrftoindexv4 |
| --- a/configure.ac |
| +++ b/configure.ac |
| @@ -431,6 +431,11 @@ AS_IF([test x"$long_long_found" = "xyes"], [ |
| # ================ |
| # Check for pdf2ps |
| # ================ |
| +AC_ARG_ENABLE([ghostscript], |
| + [AS_HELP_STRING([--disable-ghostscript], [Disable filters using Ghostscript.])], |
| + [enable_ghostscript="$enableval"], |
| + [enable_ghostscript=yes] |
| +) |
| AC_ARG_WITH([pdftops], |
| [AS_HELP_STRING([--with-pdftops=value], [Set which pdftops to use (gs,pdftops,pdftocairo,acroread,hybrid).])], |
| [with_pdftops="$withval"], |
| @@ -471,25 +476,35 @@ AS_CASE([x$with_pdftops_maxres], |
| [AC_MSG_ERROR([Unknown value of with-pdftops-maxres provided: $with_pdftops])] |
| ) |
| |
| -AS_IF([test "x$with_gs_path" != "xsystem"], [ |
| - CUPS_GHOSTSCRIPT="$with_gs_path" |
| -], [ |
| - AC_PATH_PROG(CUPS_GHOSTSCRIPT, [gs], [AC_MSG_ERROR([Required gs binary is missing. Please install ghostscript-gpl package.])]) |
| -]) |
| -AS_IF([test "x$CUPS_GHOSTSCRIPT" != "x"], [ |
| - AC_DEFINE([HAVE_GHOSTSCRIPT], [], [Define that we provide ghostscript binary]) |
| - AS_IF([test x"$with_pdftops" = xgs], [AC_DEFINE_UNQUOTED([CUPS_PDFTOPS_RENDERER], [GS], [Define default renderer])]) |
| - |
| - AC_MSG_CHECKING(whether gs supports the ps2write device) |
| - AS_IF([`$CUPS_GHOSTSCRIPT -h 2>&1 | grep -q ps2write`], [ |
| - AC_MSG_RESULT([yes]) |
| - AC_DEFINE([HAVE_GHOSTSCRIPT_PS2WRITE], [], [gs supports ps2write]) |
| +CUPS_GHOSTSCRIPT="" |
| +AS_IF([test "x$enable_ghostscript" != "xyes"], [ |
| + AS_IF([test "x$with_gs_path" != "xsystem"], [ |
| + AC_MSG_ERROR([Cannot supply both --disable-ghostscript and --gs-path=]) |
| ], [ |
| - AC_MSG_RESULT([no]) |
| + with_gs_path="" |
| ]) |
| ], [ |
| - CUPS_GHOSTSCRIPT="gs" |
| + AS_IF([test "x$with_gs_path" != "xsystem"], [ |
| + CUPS_GHOSTSCRIPT="$with_gs_path" |
| + ], [ |
| + AC_PATH_PROG(CUPS_GHOSTSCRIPT, [gs], [AC_MSG_ERROR([Required gs binary is missing. Please install ghostscript-gpl package.])]) |
| + ]) |
| + AS_IF([test "x$CUPS_GHOSTSCRIPT" != "x"], [ |
| + AC_DEFINE([HAVE_GHOSTSCRIPT], [], [Define that we provide ghostscript binary]) |
| + AS_IF([test x"$with_pdftops" = xgs], [AC_DEFINE_UNQUOTED([CUPS_PDFTOPS_RENDERER], [GS], [Define default renderer])]) |
| + |
| + AC_MSG_CHECKING(whether gs supports the ps2write device) |
| + AS_IF([`$CUPS_GHOSTSCRIPT -h 2>&1 | grep -q ps2write`], [ |
| + AC_MSG_RESULT([yes]) |
| + AC_DEFINE([HAVE_GHOSTSCRIPT_PS2WRITE], [], [gs supports ps2write]) |
| + ], [ |
| + AC_MSG_RESULT([no]) |
| + ]) |
| + ], [ |
| + CUPS_GHOSTSCRIPT="gs" |
| + ]) |
| ]) |
| +AM_CONDITIONAL(ENABLE_GHOSTSCRIPT, test "x$enable_ghostscript" = xyes) |
| |
| AS_IF([test "x$with_pdftops_path" != "xsystem"], [ |
| CUPS_PDFTOPS="$with_pdftops_path" |
| @@ -550,6 +565,16 @@ AC_DEFINE_UNQUOTED([CUPS_POPPLER_PDFTOCAIRO], "$CUPS_PDFTOCAIRO", [pdftocairo bi |
| AC_DEFINE_UNQUOTED([CUPS_ACROREAD], "$CUPS_ACROREAD", [acroread binary to use.]) |
| AC_DEFINE_UNQUOTED([CUPS_PDFTOPS_MAX_RESOLUTION], [$CUPS_PDFTOPS_MAXRES], [max resolution used for pdftops when converting images]) |
| |
| +# ================== |
| +# Check for foomatic |
| +# ================== |
| +AC_ARG_ENABLE([foomatic], |
| + [AS_HELP_STRING([--disable-foomatic], [Disable Foomatic-based filters.])], |
| + [enable_foomatic="$enableval"], |
| + [enable_foomatic=yes] |
| +) |
| +AM_CONDITIONAL([ENABLE_FOOMATIC], [test "x$enable_foomatic" = "xyes"]) |
| + |
| # ============= |
| # Check for php |
| # ============= |
| @@ -658,8 +683,10 @@ Environment settings: |
| Build configuration: |
| cups-config: ${with_cups_config} |
| font directory: ${sysconfdir}/${FONTDIR} |
| + foomatic: ${enable_foomatic} |
| init directory: ${INITDDIR} |
| cups dom socket: ${CUPS_DEFAULT_DOMAINSOCKET} |
| + ghostscript: ${enable_ghostscript} |
| gs-path: ${with_gs_path} |
| imagefilters: ${enable_imagefilters} |
| jpeg: ${with_jpeg} |