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