]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-image.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-image.m4
1 dnl
2 dnl "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $"
3 dnl
4 dnl Image library/filter stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 2007 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 turn on image filters, default=auto])
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
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])
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
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...
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
65 dnl ZLIB library...
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
72 dnl PNG library...
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)
77 LIBPNG="-lpng"))
78 else
79 AC_MSG_NOTICE([PNG support disabled with --disable-png.])
80 fi
81
82 dnl TIFF library...
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
108 dnl End of "$Id: cups-image.m4 6649 2007-07-11 21:46:42Z mike $".
109 dnl