2 # LittleCMS 2 configure script
8 # Set the package name and version
13 # Libtool library revision control info
14 # See the libtool documentation under the heading "Libtool's versioning
15 # system" in order to understand the meaning of these fields
17 # Here are a set of rules to help you update your library version
20 # 1. Start with version information of `0:0:0' for each libtool library.
21 # 2. Update the version information only immediately before a public
22 # release of your software. More frequent updates are unnecessary, and
23 # only guarantee that the current interface number gets larger faster.
24 # 3. If the library source code has changed at all since the last update,
25 # then increment revision (`c:r:a' becomes `c:r+1:a').
26 # 4. If any interfaces have been added, removed, or changed since the last
27 # update, increment current, and set revision to 0.
28 # 5. If any interfaces have been added since the last public release, then
30 # 6. If any interfaces have been removed since the last public release,
37 AC_SUBST(LIBRARY_CURRENT)dnl
38 AC_SUBST(LIBRARY_REVISION)dnl
39 AC_SUBST(LIBRARY_AGE)dnl
41 # Obtain system type by running config.guess
44 AM_INIT_AUTOMAKE([foreign 1.7.2 no-define dist-zip])
48 [ --without-jpeg disable JPEG support],
54 [ --without-tiff disable TIFF support],
60 [ --without-zlib disable ZLIB support],
87 AC_SUBST(LIBTOOL_DEPS)
89 # Add configure option --enable-maintainer-mode which enables dependency
90 # checking and generation useful to package maintainers. This is made an
91 # option to avoid confusing end users.
94 # If the C compiler supports the keyword inline, do nothing. Otherwise
95 # define inline to __inline__ or __inline if it accepts one of those,
96 # otherwise define inline to be empty.
100 # If words are stored with the most significant byte first (like
101 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
108 AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,)
109 LIBS="$LIB_MATH $LIBS"
117 if test ! "$with_jpeg" = 'no'
119 AC_MSG_CHECKING(for JPEG support )
123 AC_CHECK_HEADER(jconfig.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
124 AC_CHECK_HEADER(jerror.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
125 AC_CHECK_HEADER(jmorecfg.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
126 AC_CHECK_HEADER(jpeglib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
127 AC_CHECK_LIB(jpeg,jpeg_read_header,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
129 # Test for compatible JPEG library
130 if test ! "$ac_cv_jpeg_version_ok" = 'yes' ; then
131 AC_CACHE_CHECK(for JPEG library is version 6b or later, ac_cv_jpeg_version_ok,
137 changequote(<<, >>)dnl
139 #if JPEG_LIB_VERSION < 62
140 #error IJG JPEG library must be version 6b or newer!
145 ac_cv_jpeg_version_ok='yes',
146 ac_cv_jpeg_version_ok='no')])
147 if test "$ac_cv_jpeg_version_ok" = 'yes' ; then
149 passed=`expr $passed + 1`
152 failed=`expr $failed + 1`
155 AC_MSG_CHECKING(if JPEG package is complete)
156 if test $passed -gt 0
158 if test $failed -gt 0
160 AC_MSG_RESULT(no -- some components failed test)
161 have_jpeg='no (failed tests)'
164 LIBS="$LIB_JPEG $LIBS"
165 AC_DEFINE(HasJPEG,1,Define if you have JPEG library)
173 AM_CONDITIONAL(HasJPEG, test "$have_jpeg" = 'yes')
180 dnl PNG requires zlib so enable zlib check if PNG is requested
181 if test ! "$with_zlib" = 'no' || test ! "$with_png" = 'no'
184 AC_MSG_CHECKING(for ZLIB support )
188 AC_CHECK_HEADER(zconf.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
189 AC_CHECK_HEADER(zlib.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
190 AC_CHECK_LIB(z,compress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
191 AC_CHECK_LIB(z,uncompress,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
192 AC_CHECK_LIB(z,deflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
193 AC_CHECK_LIB(z,inflate,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
194 AC_CHECK_LIB(z,gzseek,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
195 AC_CHECK_LIB(z,gztell,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
196 AC_MSG_CHECKING(if ZLIB package is complete)
197 if test $passed -gt 0
199 if test $failed -gt 0
201 AC_MSG_RESULT(no -- some components failed test)
202 have_zlib='no (failed tests)'
205 LIBS="$LIB_ZLIB $LIBS"
206 AC_DEFINE(HasZLIB,1,Define if you have zlib compression library)
214 AM_CONDITIONAL(HasZLIB, test "$have_zlib" = 'yes')
222 if test ! "$with_tiff" = 'no'
224 AC_MSG_CHECKING(for TIFF support )
228 AC_CHECK_HEADER(tiff.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
229 AC_CHECK_HEADER(tiffio.h,passed=`expr $passed + 1`,failed=`expr $failed + 1`)
230 AC_CHECK_LIB(tiff,TIFFOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
231 AC_CHECK_LIB(tiff,TIFFClientOpen,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
232 AC_CHECK_LIB(tiff,TIFFIsByteSwapped,passed=`expr $passed + 1`,failed=`expr $failed + 1`,)
233 AC_MSG_CHECKING(if TIFF package is complete)
234 if test $passed -gt 0
236 if test $failed -gt 0
238 AC_MSG_RESULT(no -- some components failed test)
239 have_tiff='no (failed tests)'
242 LIBS="$LIB_TIFF $LIBS"
243 AC_DEFINE(HasTIFF,1,Define if you have TIFF library)
246 AC_CHECK_HEADERS(tiffconf.h)
252 AM_CONDITIONAL(HasTIFF, test "$have_tiff" = 'yes')
255 # Libraries that the LCMS library depends on
256 LCMS_LIB_DEPLIBS="$LIB_MATH"
257 LCMS_LIB_DEPLIBS=`echo $LCMS_LIB_DEPLIBS | sed -e 's/ */ /g'`
258 AC_SUBST(LCMS_LIB_DEPLIBS)
260 # Libraries that the jpegicc program depends on
261 JPEGICC_DEPLIBS="$LIB_JPEG $LIB_MATH"
262 JPEGICC_DEPLIBS=`echo $JPEGICC_DEPLIBS | sed -e 's/ */ /g'`
263 AC_SUBST(JPEGICC_DEPLIBS)
265 # Libraries that the tifficc program depends on
266 TIFFICC_DEPLIBS="$LIB_TIFF $LIB_JPEG $LIB_ZLIB $LIB_MATH"
267 TIFFICC_DEPLIBS=`echo $TIFFICC_DEPLIBS | sed -e 's/ */ /g'`
268 AC_SUBST(TIFFICC_DEPLIBS)
273 # Perform substitutions
275 AC_CONFIG_FILES([Makefile])
276 AC_CONFIG_FILES([lcms2.pc])
277 AC_CONFIG_FILES([include/Makefile])
278 AC_CONFIG_FILES([src/Makefile])
279 AC_CONFIG_FILES([utils/tificc/Makefile])
280 AC_CONFIG_FILES([utils/transicc/Makefile])
281 AC_CONFIG_FILES([utils/linkicc/Makefile])
282 AC_CONFIG_FILES([utils/jpgicc/Makefile])
283 AC_CONFIG_FILES([utils/psicc/Makefile])
284 AC_CONFIG_FILES([testbed/Makefile])