2 dnl "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $"
4 dnl Image library/filter stuff for the Common UNIX Printing System (CUPS).
6 dnl Copyright 2007 by Apple Inc.
7 dnl Copyright 1997-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 dnl See if we want the image filters included at all...
17 AC_ARG_ENABLE(image, [ --enable-image turn on image filters, default=auto])
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"
32 dnl Check for image libraries...
33 AC_ARG_ENABLE(jpeg, [ --enable-jpeg turn on JPEG support, default=yes])
34 AC_ARG_ENABLE(png, [ --enable-png turn on PNG support, default=yes])
35 AC_ARG_ENABLE(tiff, [ --enable-tiff turn on TIFF support, default=yes])
47 dnl Image libraries use math library functions...
48 AC_SEARCH_LIBS(pow, m)
50 dnl Save the current libraries since we don't want the image libraries
51 dnl included with every program...
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)
62 AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.])
66 AC_CHECK_HEADER(zlib.h,
67 AC_CHECK_LIB(z, gzgets,
73 if test x$enable_png != xno; then
74 AC_CHECK_HEADER(png.h,
75 AC_CHECK_LIB(png, png_create_read_struct,
76 AC_DEFINE(HAVE_LIBPNG)
79 AC_MSG_NOTICE([PNG support disabled with --disable-png.])
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)
89 AC_MSG_NOTICE([TIFF support disabled with --disable-tiff.])
92 dnl Restore original LIBS settings...
95 EXPORT_LIBJPEG="$LIBJPEG"
96 EXPORT_LIBPNG="$LIBPNG"
97 EXPORT_LIBTIFF="$LIBTIFF"
100 AC_SUBST(EXPORT_LIBJPEG)
101 AC_SUBST(EXPORT_LIBPNG)
102 AC_SUBST(EXPORT_LIBTIFF)
103 AC_SUBST(EXPORT_LIBZ)
105 AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
108 dnl End of "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $".