source: trunk/src/3rdparty/libmng/configure.in@ 119

Last change on this file since 119 was 2, checked in by dmik, 20 years ago

Imported xplatform parts of the official release 3.3.1 from Trolltech

File size: 4.8 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2
3AC_INIT(libmng.h)
4
5dnl this call will define PACKAGE and VERSION
6dnl please use this as the primary reference for the version number
7AM_INIT_AUTOMAKE(libmng, 1.0.4)
8
9dnl pass the version string on the the makefiles
10AC_SUBST(PACKAGE)
11AC_SUBST(VERSION)
12
13dnl Checks for programs.
14AC_PROG_CC
15AC_ISC_POSIX
16AM_C_PROTOTYPES
17if test "x$U" != "x"; then
18 AC_MSG_ERROR(Compiler not ANSI compliant)
19fi
20AM_PROG_LIBTOOL
21AC_PROG_INSTALL
22
23dnl support for files >2GB
24AC_SYS_LARGEFILE
25
26dnl Check for required header files
27AC_HEADER_STDC
28
29dnl Checks for typedefs, structures, and compiler characteristics.
30AC_C_CONST
31
32dnl need pow and fabs
33AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow, LIBS="$LIBS -lm"))
34
35
36dnl what functionality we want to add (read, write, display).
37dnl all on by default. see libmng_conf.h for full descriptions
38
39dnl we only support the full mng spec for not (no LC or VLC)
40AC_DEFINE(MNG_SUPPORT_FULL)
41
42dnl remove support in library to read images?
43AC_ARG_ENABLE(read,
44[ --disable-read remove read support from library])
45if test "x$enable_read" != "xno"; then
46 AC_DEFINE(MNG_SUPPORT_READ)
47fi
48
49dnl remove support in library to write images?
50AC_ARG_ENABLE(write,
51[ --disable-write remove write support from library])
52if test "x$enable_write" != "xno"; then
53 AC_DEFINE(MNG_SUPPORT_WRITE)
54fi
55
56dnl remove support in library to display images?
57AC_ARG_ENABLE(display,
58[ --disable-display remove display support from library])
59if test "x$enable_display" != "xno"; then
60 AC_DEFINE(MNG_SUPPORT_DISPLAY)
61fi
62
63dnl remove support in library to access chunks?
64AC_ARG_ENABLE(chunks,
65[ --disable-chunks remove support for chunk access])
66if test "x$enable_chunks" != "xno"; then
67 AC_DEFINE(MNG_ACCESS_CHUNKS)
68fi
69
70dnl disable support for accessing chunks that have been previously read?
71AC_ARG_ENABLE(storechunks,
72[ --disable-storechunks remove support for access of previous chunks],[
73if test "x$enable_storechunks" != "xno"; then
74 AC_DEFINE(MNG_STORE_CHUNKS)
75fi
76])
77
78dnl enable support for debug tracing callbacks and messages?
79AC_ARG_ENABLE(trace,
80[ --enable-trace include support for debug tracing callbacks],[
81if test "x$enable_trace" = "xyes"; then
82 AC_DEFINE(MNG_SUPPORT_TRACE)
83 AC_DEFINE(MNG_TRACE_TELLTALE)
84fi
85])
86
87dnl verbose error text
88dnl this should always be on
89AC_DEFINE(MNG_ERROR_TELLTALE)
90
91
92dnl libz is required.
93AC_ARG_WITH(zlib,
94[ --with-zlib[=DIR] use zlib include/library files in DIR],[
95 if test -d "$withval"; then
96 CPPFLAGS="$CPPFLAGS -I$withval/include"
97 LDFLAGS="$LDFLAGS -L$withval/lib"
98 fi
99])
100AC_CHECK_HEADER(zlib.h,
101 AC_CHECK_LIB(z, gzread, , AC_MSG_ERROR(zlib library not found)),
102 AC_MSG_ERROR(zlib header not found)
103)
104
105dnl check for jpeg library
106AC_ARG_WITH(jpeg,
107[ --with-jpeg[=DIR] use jpeg include/library files in DIR],
108[with_jpeg=$withval],[with_jpeg=_auto])
109
110 if test "x$with_jpeg" != "xno" -a "x$with_jpeg" != "xyes" -a \
111 "x$with_jpeg" != "x_auto"; then
112 # Save in case test with directory specified fails
113 _cppflags=${CPPFLAGS}
114 _ldflags=${LDFLAGS}
115 _restore=1
116
117 CPPFLAGS="${CPPFLAGS} -I$withval/include"
118 LDFLAGS="${LDFLAGS} -L$withval/lib"
119 else
120 _restore=0
121 fi
122
123 if test "x$with_jpeg" != "xno"; then
124 AC_CHECK_HEADER(jpeglib.h,
125 AC_CHECK_LIB(jpeg, jpeg_read_header, [
126 LIBS="$LIBS -ljpeg"
127 AC_DEFINE(HAVE_LIBJPEG)
128 _restore=0
129 ],
130 AC_MSG_WARN(jpeg library not found)),
131 AC_MSG_WARN(jpeg header not found)
132 )
133 fi
134
135 test $_restore -eq 1 && CPPFLAGS=$_cppflags LDFLAGS=$_ldflags
136
137dnl check for lcms library
138AC_ARG_WITH(lcms,
139[ --with-lcms[=DIR] use lcms include/library files in DIR],
140[with_lcms=$withval],[with_lcms=_auto])
141
142 if test "x$with_lcms" != "xno" -a "x$with_lcms" != "xyes" -a \
143 "x$with_lcms" != "x_auto"; then
144 # Save in case test with directory specified fails
145 _cppflags=$CPPFLAGS
146 _ldflags=$LDFLAGS
147 _restore=1
148
149 CPPFLAGS="$CPPFLAGS -I$withval/include"
150 LDFLAGS="$LDFLAGS -L$withval/lib"
151 else
152 _restore=0
153 fi
154
155 if test "x$with_lcms" != "xno"; then
156 AC_CHECK_HEADER(lcms.h, [
157 have_lcms=yes
158 AC_CHECK_LIB(lcms, cmsCreateRGBProfile, [
159 LIBS="$LIBS -llcms"
160 AC_DEFINE(HAVE_LIBLCMS)
161 dnl for now this implies MNG_INCLUDE_LCMS in the headers:
162 AC_DEFINE(MNG_FULL_CMS)
163 _restore=0
164 have_lcms=yes
165 ],[
166 have_lcms=no
167 ])
168 ])
169 dnl give feedback only if the user asked specifically for lcms
170 if test "x$with_lcms" != "x_auto" -a "x$have_lcms" != "xyes"; then
171 AC_MSG_WARN([lcms not found... disabling CMS support])
172 fi
173 fi
174
175 test $_restore -eq 1 && CPPFLAGS=$_cppflags LDFLAGS=$_ldflags
176
177AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.