]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-pdf.m4
Merge changes from CUPS 1.5svn-r9763.
[thirdparty/cups.git] / config-scripts / cups-pdf.m4
CommitLineData
e1d6a774 1dnl
75bd9771 2dnl "$Id: cups-pdf.m4 7449 2008-04-14 18:27:53Z mike $"
e1d6a774 3dnl
eac3a0a0 4dnl PDF filter configuration stuff for CUPS.
e1d6a774 5dnl
eac3a0a0 6dnl Copyright 2007-2011 by Apple Inc.
e1d6a774 7dnl Copyright 2006 by Easy Software Products, all rights reserved.
8dnl
9dnl These coded instructions, statements, and computer programs are the
bc44d920 10dnl property of Apple Inc. and are protected by Federal copyright
11dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
12dnl which should have been included with this file. If this file is
13dnl file is missing or damaged, see the license at "http://www.cups.org/".
e1d6a774 14dnl
15
ee6ddad2 16AC_ARG_WITH(pdftops, [ --with-pdftops set pdftops filter (gs,/path/to/gs,pdftops,/path/to/pdftops,none), default=pdftops ])
e1d6a774 17
18PDFTOPS=""
bf3816c7
MS
19CUPS_PDFTOPS=""
20CUPS_GHOSTSCRIPT=""
e1d6a774 21
bf3816c7
MS
22case "x$with_pdftops" in
23 x) # Default/auto
24 if test $uname != Darwin; then
25 AC_PATH_PROG(CUPS_PDFTOPS, pdftops)
26 if test "x$CUPS_PDFTOPS" != x; then
27 AC_DEFINE(HAVE_PDFTOPS)
28 PDFTOPS="pdftops"
29 else
30 AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs)
31 if test "x$CUPS_GHOSTSCRIPT" != x; then
32 AC_DEFINE(HAVE_GHOSTSCRIPT)
33 PDFTOPS="pdftops"
34 fi
35 fi
ae71f5de 36 fi
bf3816c7 37 ;;
91c84a35 38
bf3816c7 39 xgs)
ae71f5de
MS
40 AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs)
41 if test "x$CUPS_GHOSTSCRIPT" != x; then
42 AC_DEFINE(HAVE_GHOSTSCRIPT)
bf3816c7
MS
43 PDFTOPS="pdftops"
44 else
45 AC_MSG_ERROR(Unable to find gs program!)
46 exit 1
ae71f5de 47 fi
bf3816c7 48 ;;
ae71f5de 49
ee6ddad2
MS
50 x/*/gs) # Use /path/to/gs without any check:
51 CUPS_GHOSTSCRIPT="$with_pdftops"
52 AC_DEFINE(HAVE_GHOSTSCRIPT)
53 PDFTOPS="pdftops"
54 ;;
55
bf3816c7
MS
56 xpdftops)
57 AC_PATH_PROG(CUPS_PDFTOPS, pdftops)
58 if test "x$CUPS_PDFTOPS" != x; then
59 AC_DEFINE(HAVE_PDFTOPS)
60 PDFTOPS="pdftops"
61 else
62 AC_MSG_ERROR(Unable to find pdftops program!)
91c84a35 63 exit 1
e1d6a774 64 fi
bf3816c7 65 ;;
ee6ddad2
MS
66
67 x/*/pdftops) # Use /path/to/pdftops without any check:
68 CUPS_PDFTOPS="$with_pdftops"
69 AC_DEFINE(HAVE_PDFTOPS)
70 PDFTOPS="pdftops"
71 ;;
72
73 xnone) # Make no pdftops filter if with_pdftops=none:
74 ;;
75
76 *) # Invalid with_pdftops value:
77 AC_MSG_ERROR(Invalid with_pdftops value!)
78 exit 1
79 ;;
bf3816c7 80esac
e1d6a774 81
eac3a0a0
MS
82if test "x$CUPS_PDFTOPS" != x; then
83 AC_MSG_CHECKING(whether pdftops supports -origpagesizes)
84 if ($CUPS_PDFTOPS -h 2>&1 | grep -q -- -origpagesizes); then
85 AC_MSG_RESULT(yes)
86 AC_DEFINE(HAVE_PDFTOPS_WITH_ORIGPAGESIZES)
87 else
88 AC_MSG_RESULT(no)
89 fi
90
91 DEFAULT_PDFTOPS=""
92elif test "x$CUPS_GHOSTSCRIPT" != x; then
93 AC_MSG_CHECKING(whether gs supports the ps2write device)
94 if ($CUPS_GHOSTSCRIPT -h 2>&1 | grep -q ps2write); then
95 AC_MSG_RESULT(yes)
96 AC_DEFINE(HAVE_GHOSTSCRIPT_PS2WRITE)
97 else
98 AC_MSG_RESULT(no)
99 fi
100
101 DEFAULT_PDFTOPS=""
102else
103 DEFAULT_PDFTOPS="#"
104fi
105
bf3816c7
MS
106AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS")
107AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT")
eac3a0a0 108AC_SUBST(DEFAULT_PDFTOPS)
e1d6a774 109AC_SUBST(PDFTOPS)
110
111dnl
75bd9771 112dnl End of "$Id: cups-pdf.m4 7449 2008-04-14 18:27:53Z mike $".
e1d6a774 113dnl