]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
bc44d920 | 2 | dnl "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $" |
ef416fc2 | 3 | dnl |
e1d6a774 | 4 | dnl Image library/filter stuff for the Common UNIX Printing System (CUPS). |
ef416fc2 | 5 | dnl |
bf3816c7 | 6 | dnl Copyright 2007-2009 by Apple Inc. |
e1d6a774 | 7 | dnl Copyright 1997-2006 by Easy Software Products, all rights reserved. |
ef416fc2 | 8 | dnl |
9 | dnl These coded instructions, statements, and computer programs are the | |
bc44d920 | 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/". | |
ef416fc2 | 14 | dnl |
15 | ||
e1d6a774 | 16 | dnl See if we want the image filters included at all... |
bf3816c7 | 17 | AC_ARG_ENABLE(image, [ --enable-image always build the image filters]) |
e1d6a774 | 18 | |
19 | IMGFILTERS="" | |
20 | if test "x$enable_image" != xno; then | |
21 | AC_MSG_CHECKING(whether to build image filters) | |
22 | if test "x$enable_image" = xyes -o $uname != Darwin; then | |
23 | IMGFILTERS="imagetops imagetoraster" | |
24 | AC_MSG_RESULT(yes) | |
25 | else | |
26 | AC_MSG_RESULT(no) | |
27 | fi | |
28 | fi | |
29 | ||
30 | AC_SUBST(IMGFILTERS) | |
31 | ||
ef416fc2 | 32 | dnl Check for image libraries... |
bf3816c7 MS |
33 | AC_ARG_ENABLE(jpeg, [ --disable-jpeg disable JPEG support]) |
34 | AC_ARG_ENABLE(png, [ --disable-png disable PNG support]) | |
35 | AC_ARG_ENABLE(tiff, [ --disable-tiff disable TIFF support]) | |
ef416fc2 | 36 | |
37 | LIBJPEG="" | |
38 | LIBPNG="" | |
39 | LIBTIFF="" | |
40 | LIBZ="" | |
41 | ||
42 | AC_SUBST(LIBJPEG) | |
43 | AC_SUBST(LIBPNG) | |
44 | AC_SUBST(LIBTIFF) | |
45 | AC_SUBST(LIBZ) | |
46 | ||
ed486911 | 47 | dnl Image libraries use math library functions... |
48 | AC_SEARCH_LIBS(pow, m) | |
49 | ||
50 | dnl Save the current libraries since we don't want the image libraries | |
51 | dnl included with every program... | |
52 | SAVELIBS="$LIBS" | |
53 | ||
54 | dnl JPEG library... | |
ef416fc2 | 55 | if test x$enable_jpeg != xno; then |
56 | AC_CHECK_HEADER(jpeglib.h, | |
57 | AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, | |
58 | AC_DEFINE(HAVE_LIBJPEG) | |
59 | LIBJPEG="-ljpeg" | |
60 | LIBS="$LIBS -ljpeg")) | |
61 | else | |
62 | AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.]) | |
63 | fi | |
64 | ||
ed486911 | 65 | dnl ZLIB library... |
ef416fc2 | 66 | AC_CHECK_HEADER(zlib.h, |
67 | AC_CHECK_LIB(z, gzgets, | |
68 | AC_DEFINE(HAVE_LIBZ) | |
69 | LIBZ="-lz" | |
70 | LIBS="$LIBS -lz")) | |
71 | ||
ed486911 | 72 | dnl PNG library... |
ef416fc2 | 73 | if test x$enable_png != xno; then |
74 | AC_CHECK_HEADER(png.h, | |
89d46774 | 75 | AC_CHECK_LIB(png, png_create_read_struct, |
ef416fc2 | 76 | AC_DEFINE(HAVE_LIBPNG) |
ed486911 | 77 | LIBPNG="-lpng")) |
ef416fc2 | 78 | else |
79 | AC_MSG_NOTICE([PNG support disabled with --disable-png.]) | |
80 | fi | |
81 | ||
ed486911 | 82 | dnl TIFF library... |
ef416fc2 | 83 | if test x$enable_tiff != xno; then |
84 | AC_CHECK_HEADER(tiff.h, | |
85 | AC_CHECK_LIB(tiff, TIFFReadScanline, | |
86 | AC_DEFINE(HAVE_LIBTIFF) | |
87 | LIBTIFF="-ltiff")) | |
88 | else | |
89 | AC_MSG_NOTICE([TIFF support disabled with --disable-tiff.]) | |
90 | fi | |
91 | ||
92 | dnl Restore original LIBS settings... | |
93 | LIBS="$SAVELIBS" | |
94 | ||
95 | EXPORT_LIBJPEG="$LIBJPEG" | |
96 | EXPORT_LIBPNG="$LIBPNG" | |
97 | EXPORT_LIBTIFF="$LIBTIFF" | |
98 | EXPORT_LIBZ="$LIBZ" | |
99 | ||
100 | AC_SUBST(EXPORT_LIBJPEG) | |
101 | AC_SUBST(EXPORT_LIBPNG) | |
102 | AC_SUBST(EXPORT_LIBTIFF) | |
103 | AC_SUBST(EXPORT_LIBZ) | |
104 | ||
105 | AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H)) | |
106 | ||
107 | dnl | |
bc44d920 | 108 | dnl End of "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $". |
ef416fc2 | 109 | dnl |