]> 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 5580 2006-05-23 19:30:23Z mike $"
3 dnl
4 dnl Image library/filter stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
7 dnl
8 dnl These coded instructions, statements, and computer programs are the
9 dnl property of Easy Software Products and are protected by Federal
10 dnl copyright law. Distribution and use rights are outlined in the file
11 dnl "LICENSE.txt" which should have been included with this file. If this
12 dnl file is missing or damaged please contact Easy Software Products
13 dnl at:
14 dnl
15 dnl Attn: CUPS Licensing Information
16 dnl Easy Software Products
17 dnl 44141 Airport View Drive, Suite 204
18 dnl Hollywood, Maryland 20636 USA
19 dnl
20 dnl Voice: (301) 373-9600
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
23 dnl
24
25 dnl See if we want the image filters included at all...
26 AC_ARG_ENABLE(image, [ --enable-image turn on image filters, default=auto])
27
28 IMGFILTERS=""
29 if test "x$enable_image" != xno; then
30 AC_MSG_CHECKING(whether to build image filters)
31 if test "x$enable_image" = xyes -o $uname != Darwin; then
32 IMGFILTERS="imagetops imagetoraster"
33 AC_MSG_RESULT(yes)
34 else
35 AC_MSG_RESULT(no)
36 fi
37 fi
38
39 AC_SUBST(IMGFILTERS)
40
41 dnl Check for image libraries...
42 AC_ARG_ENABLE(jpeg, [ --enable-jpeg turn on JPEG support, default=yes])
43 AC_ARG_ENABLE(png, [ --enable-png turn on PNG support, default=yes])
44 AC_ARG_ENABLE(tiff, [ --enable-tiff turn on TIFF support, default=yes])
45
46 LIBJPEG=""
47 LIBPNG=""
48 LIBTIFF=""
49 LIBZ=""
50
51 AC_SUBST(LIBJPEG)
52 AC_SUBST(LIBPNG)
53 AC_SUBST(LIBTIFF)
54 AC_SUBST(LIBZ)
55
56 dnl Image libraries use math library functions...
57 AC_SEARCH_LIBS(pow, m)
58
59 dnl Save the current libraries since we don't want the image libraries
60 dnl included with every program...
61 SAVELIBS="$LIBS"
62
63 dnl JPEG library...
64 if test x$enable_jpeg != xno; then
65 AC_CHECK_HEADER(jpeglib.h,
66 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
67 AC_DEFINE(HAVE_LIBJPEG)
68 LIBJPEG="-ljpeg"
69 LIBS="$LIBS -ljpeg"))
70 else
71 AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.])
72 fi
73
74 dnl ZLIB library...
75 AC_CHECK_HEADER(zlib.h,
76 AC_CHECK_LIB(z, gzgets,
77 AC_DEFINE(HAVE_LIBZ)
78 LIBZ="-lz"
79 LIBS="$LIBS -lz"))
80
81 dnl PNG library...
82 if test x$enable_png != xno; then
83 AC_CHECK_HEADER(png.h,
84 AC_CHECK_LIB(png, png_create_read_struct,
85 AC_DEFINE(HAVE_LIBPNG)
86 LIBPNG="-lpng"))
87 else
88 AC_MSG_NOTICE([PNG support disabled with --disable-png.])
89 fi
90
91 dnl TIFF library...
92 if test x$enable_tiff != xno; then
93 AC_CHECK_HEADER(tiff.h,
94 AC_CHECK_LIB(tiff, TIFFReadScanline,
95 AC_DEFINE(HAVE_LIBTIFF)
96 LIBTIFF="-ltiff"))
97 else
98 AC_MSG_NOTICE([TIFF support disabled with --disable-tiff.])
99 fi
100
101 dnl Restore original LIBS settings...
102 LIBS="$SAVELIBS"
103
104 EXPORT_LIBJPEG="$LIBJPEG"
105 EXPORT_LIBPNG="$LIBPNG"
106 EXPORT_LIBTIFF="$LIBTIFF"
107 EXPORT_LIBZ="$LIBZ"
108
109 AC_SUBST(EXPORT_LIBJPEG)
110 AC_SUBST(EXPORT_LIBPNG)
111 AC_SUBST(EXPORT_LIBTIFF)
112 AC_SUBST(EXPORT_LIBZ)
113
114 AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
115
116 dnl
117 dnl End of "$Id: cups-image.m4 5580 2006-05-23 19:30:23Z mike $".
118 dnl