]> 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 4644 2005-09-15 18:43:06Z mike $"
3 dnl
4 dnl Image library stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 1997-2005 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 Save the current libraries since we don't want the image libraries
26 dnl included with every program...
27 SAVELIBS="$LIBS"
28
29 dnl Check for image libraries...
30 AC_ARG_ENABLE(jpeg, [ --enable-jpeg turn on JPEG support, default=yes])
31 AC_ARG_ENABLE(png, [ --enable-png turn on PNG support, default=yes])
32 AC_ARG_ENABLE(tiff, [ --enable-tiff turn on TIFF support, default=yes])
33
34 LIBJPEG=""
35 LIBPNG=""
36 LIBTIFF=""
37 LIBZ=""
38
39 AC_SUBST(LIBJPEG)
40 AC_SUBST(LIBPNG)
41 AC_SUBST(LIBTIFF)
42 AC_SUBST(LIBZ)
43
44 if test x$enable_jpeg != xno; then
45 AC_CHECK_HEADER(jpeglib.h,
46 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
47 AC_DEFINE(HAVE_LIBJPEG)
48 LIBJPEG="-ljpeg"
49 LIBS="$LIBS -ljpeg"))
50 else
51 AC_MSG_NOTICE([JPEG support disabled with --disable-jpeg.])
52 fi
53
54 AC_CHECK_HEADER(zlib.h,
55 AC_CHECK_LIB(z, gzgets,
56 AC_DEFINE(HAVE_LIBZ)
57 LIBZ="-lz"
58 LIBS="$LIBS -lz"))
59
60 dnl PNG library uses math library functions...
61 AC_CHECK_LIB(m, pow)
62
63 if test x$enable_png != xno; then
64 AC_CHECK_HEADER(png.h,
65 AC_CHECK_LIB(png, png_set_tRNS_to_alpha,
66 AC_DEFINE(HAVE_LIBPNG)
67 LIBPNG="-lpng -lm"))
68 else
69 AC_MSG_NOTICE([PNG support disabled with --disable-png.])
70 fi
71
72 if test x$enable_tiff != xno; then
73 AC_CHECK_HEADER(tiff.h,
74 AC_CHECK_LIB(tiff, TIFFReadScanline,
75 AC_DEFINE(HAVE_LIBTIFF)
76 LIBTIFF="-ltiff"))
77 else
78 AC_MSG_NOTICE([TIFF support disabled with --disable-tiff.])
79 fi
80
81 dnl Restore original LIBS settings...
82 LIBS="$SAVELIBS"
83
84 EXPORT_LIBJPEG="$LIBJPEG"
85 EXPORT_LIBPNG="$LIBPNG"
86 EXPORT_LIBTIFF="$LIBTIFF"
87 EXPORT_LIBZ="$LIBZ"
88
89 AC_SUBST(EXPORT_LIBJPEG)
90 AC_SUBST(EXPORT_LIBPNG)
91 AC_SUBST(EXPORT_LIBTIFF)
92 AC_SUBST(EXPORT_LIBZ)
93
94 AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
95
96 dnl
97 dnl End of "$Id: cups-image.m4 4644 2005-09-15 18:43:06Z mike $".
98 dnl