Revert manifest to default one
[external/cups.git] / config-scripts / cups-image.m4
1 dnl
2 dnl "$Id: cups-image.m4 10317 2012-03-01 00:05:55Z mike $"
3 dnl
4 dnl   Image library/filter stuff for CUPS.
5 dnl
6 dnl   Copyright 2007-2011 by Apple Inc.
7 dnl   Copyright 1997-2006 by Easy Software Products, all rights reserved.
8 dnl
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/".
14 dnl
15
16 dnl See if we want the image filters included at all...
17 AC_ARG_ENABLE(image, [  --enable-image          always build the image filters])
18
19 DEFAULT_IMAGEFILTERS="#"
20 IMGFILTERS=""
21 if 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"
25                 DEFAULT_IMAGEFILTERS=""
26                 AC_MSG_RESULT(yes)
27         else
28                 AC_MSG_RESULT(no)
29         fi
30 fi
31
32 AC_SUBST(DEFAULT_IMAGEFILTERS)
33 AC_SUBST(IMGFILTERS)
34
35 dnl Check for image libraries...
36 AC_ARG_ENABLE(jpeg, [  --disable-jpeg          disable JPEG support])
37 AC_ARG_ENABLE(png, [  --disable-png           disable PNG support])
38 AC_ARG_ENABLE(tiff, [  --disable-tiff          disable TIFF support])
39
40 LIBJPEG=""
41 LIBPNG=""
42 LIBTIFF=""
43 LIBZ=""
44
45 AC_SUBST(LIBJPEG)
46 AC_SUBST(LIBPNG)
47 AC_SUBST(LIBTIFF)
48 AC_SUBST(LIBZ)
49
50 dnl Image libraries use math library functions...
51 AC_SEARCH_LIBS(pow, m)
52
53 dnl Save the current libraries since we don't want the image libraries
54 dnl included with every program...
55 SAVELIBS="$LIBS"
56
57 dnl JPEG library...
58 if 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"))
64 else
65     AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.])
66 fi
67
68 dnl ZLIB library...
69 INSTALL_GZIP=""
70 AC_CHECK_HEADER(zlib.h,
71     AC_CHECK_LIB(z, gzgets,
72         AC_DEFINE(HAVE_LIBZ)
73         LIBZ="-lz"
74         LIBS="$LIBS -lz"
75         if test "x$GZIP" != x; then
76                 INSTALL_GZIP="-z"
77         fi))
78 AC_SUBST(INSTALL_GZIP)
79
80 dnl PNG library...
81 if test x$enable_png != xno; then
82     AC_CHECK_HEADER(png.h,
83         AC_CHECK_LIB(png, png_create_read_struct,
84             AC_DEFINE(HAVE_LIBPNG)
85             LIBPNG="-lpng"))
86 else
87     AC_MSG_NOTICE([PNG support disabled with --disable-png.])
88 fi
89
90 dnl TIFF library...
91 if test x$enable_tiff != xno; then
92     AC_CHECK_HEADER(tiff.h,
93         AC_CHECK_LIB(tiff, TIFFReadScanline,
94         AC_DEFINE(HAVE_LIBTIFF)
95         LIBTIFF="-ltiff"))
96 else
97     AC_MSG_NOTICE([TIFF support disabled with --disable-tiff.])
98 fi
99
100 dnl Restore original LIBS settings...
101 LIBS="$SAVELIBS"
102
103 EXPORT_LIBJPEG="$LIBJPEG"
104 EXPORT_LIBPNG="$LIBPNG"
105 EXPORT_LIBTIFF="$LIBTIFF"
106 EXPORT_LIBZ="$LIBZ"
107
108 AC_SUBST(EXPORT_LIBJPEG)
109 AC_SUBST(EXPORT_LIBPNG)
110 AC_SUBST(EXPORT_LIBTIFF)
111 AC_SUBST(EXPORT_LIBZ)
112
113 AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
114
115 dnl
116 dnl End of "$Id: cups-image.m4 10317 2012-03-01 00:05:55Z mike $".
117 dnl