4
dnl PDF filter configuration stuff for OpenPrinting CUPS Filters.
6
dnl Copyright 2007-2011 by Apple Inc.
7
dnl Copyright 2006 by Easy Software Products, all rights reserved.
9
dnl These coded instructions, statements, and computer programs are the
10
dnl property of Apple Inc. and are protected by Federal copyright
11
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
12
dnl which should have been included with this file. If this file is
13
dnl file is missing or damaged, see the license at "http://www.cups.org/".
16
AC_ARG_WITH(pdftops-renderer, [ --with-pdftops-renderer set default renderer for pdftops filter (gs,pdftops), default=gs ])
17
AC_ARG_WITH(pdftops-maxres, [ --with-pdftops-maxres set default maximum image rendering resolution for pdftops filter (0, 75, 150, 300, 600, 1200, 2400, 4800, 90, 180, 360, 720, 1440, 2880, 5760, unlimited), default=1440 ])
18
AC_ARG_WITH(ghostscript, [ --with-ghostscript set ghostscript path for pdftops filter (gs,/path/to/gs,none), default=gs ])
19
AC_ARG_WITH(poppler-pdftops, [ --with-poppler-pdftops set Poppler pdftops path for pdftops filter (pdftops,/path/to/pdftops,none), default=pdftops ])
21
CUPS_PDFTOPS_RENDERER=""
22
CUPS_PDFTOPS_MAX_RESOLUTION=""
23
CUPS_POPPLER_PDFTOPS=""
26
case "x$with_ghostscript" in
28
AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs)
29
if test "x$CUPS_GHOSTSCRIPT" != x; then
30
AC_DEFINE(HAVE_GHOSTSCRIPT)
35
AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs)
36
if test "x$CUPS_GHOSTSCRIPT" != x; then
37
AC_DEFINE(HAVE_GHOSTSCRIPT)
39
AC_MSG_WARN(Unable to find gs program!)
43
x/*/gs) # Use /path/to/gs without any check:
44
CUPS_GHOSTSCRIPT="$with_ghostscript"
45
AC_DEFINE(HAVE_GHOSTSCRIPT)
48
xno) # --without-ghostscript
51
*) # Invalid with_ghostscript value
52
AC_MSG_ERROR(Invalid with-ghostscript value!)
57
case "x$with_poppler_pdftops" in
59
AC_PATH_PROG(CUPS_POPPLER_PDFTOPS, pdftops)
60
if test "x$CUPS_POPPLER_PDFTOPS" != x; then
61
AC_DEFINE(HAVE_POPPLER_PDFTOPS)
66
AC_PATH_PROG(CUPS_POPPLER_PDFTOPS, pdftops)
67
if test "x$CUPS_POPPLER_PDFTOPS" != x; then
68
AC_DEFINE(HAVE_POPPLER_PDFTOPS)
70
AC_MSG_WARN(Unable to find Poppler pdftops program!)
74
x/*/pdftops) # Use /path/to/pdftops without any check:
75
CUPS_POPPLER_PDFTOPS="$with_poppler_pdftops"
76
AC_DEFINE(HAVE_POPPLER_PDFTOPS)
79
xno) # --without-poppler-pdftops
82
*) # Invalid with_poppler-pdftops value
83
echo "$with_poppler_pdftops"
84
AC_MSG_ERROR(Invalid with-poppler-pdftops value!)
89
if test "x$CUPS_POPPLER_PDFTOPS" != x; then
90
AC_MSG_CHECKING(whether Poppler pdftops supports -origpagesizes)
91
if ($CUPS_POPPLER_PDFTOPS -h 2>&1 | grep -q -- -origpagesizes); then
93
AC_DEFINE(HAVE_POPPLER_PDFTOPS_WITH_ORIGPAGESIZES)
98
AC_MSG_CHECKING(whether Poppler pdftops supports -r)
99
if ($CUPS_POPPLER_PDFTOPS -h 2>&1 | grep -q -- '-r '); then
101
AC_DEFINE(HAVE_POPPLER_PDFTOPS_WITH_RESOLUTION)
106
if test "x$CUPS_GHOSTSCRIPT" != x; then
107
AC_MSG_CHECKING(whether gs supports the ps2write device)
108
if ($CUPS_GHOSTSCRIPT -h 2>&1 | grep -q ps2write); then
110
AC_DEFINE(HAVE_GHOSTSCRIPT_PS2WRITE)
116
case "x$with_pdftops_renderer" in
118
CUPS_PDFTOPS_RENDERER=GS
119
if test "x$CUPS_GHOSTSCRIPT" = x; then
120
AC_MSG_WARN(Default renderer Ghostscript is not available!)
125
CUPS_PDFTOPS_RENDERER=PDFTOPS
126
if test "x$CUPS_POPPLER_PDFTOPS" = x; then
127
AC_MSG_WARN(Default renderer Poppler pdftops is not available!)
131
*) # Invalid with_pdftops-renderer value
132
AC_MSG_ERROR(Invalid with-pdftops-renderer value!)
137
case "x$with_pdftops_maxres" in
140
CUPS_PDFTOPS_MAXRES=1440
143
x75|x150|x300|x600|x1200|x2400|x4800|x90|x180|x360|x720|x1440|x2880|x5760)
144
CUPS_PDFTOPS_MAXRES=$with_pdftops_maxres
148
CUPS_PDFTOPS_MAXRES=0
151
*) # Invalid with_pdftops-renderer value
152
AC_MSG_ERROR(Invalid with-pdftops-maxres value!)
157
AC_DEFINE_UNQUOTED(CUPS_PDFTOPS_RENDERER, $CUPS_PDFTOPS_RENDERER)
158
AC_DEFINE_UNQUOTED(CUPS_PDFTOPS_MAX_RESOLUTION, $CUPS_PDFTOPS_MAXRES)
159
AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS")
160
AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT")