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

Last change on this file since 479 was 2, checked in by Dmitry A. Kuminov, 17 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

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