resetting manifest requested domain to floor
[platform/upstream/lcms2.git] / configure.ac
1 #
2 # LittleCMS 2 configure script
3 #
4
5 AC_PREREQ(2.60)
6
7 #
8 # Set the package name and version
9 #
10 AC_INIT(lcms2,2.4)
11
12 #
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
16 #
17 # Here are a set of rules to help you update your library version
18 # information:
19 #
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
29 #     increment age.
30 #  6. If any interfaces have been removed since the last public release,
31 #     then set age to 0.
32 #
33 LIBRARY_CURRENT=2
34 LIBRARY_REVISION=4
35 LIBRARY_AGE=0
36
37 AC_SUBST(LIBRARY_CURRENT)dnl
38 AC_SUBST(LIBRARY_REVISION)dnl
39 AC_SUBST(LIBRARY_AGE)dnl
40
41 # Obtain system type by running config.guess
42 AC_CANONICAL_HOST
43
44 AM_INIT_AUTOMAKE([foreign 1.7.2 no-define dist-zip])
45
46 # Disable JPEG.
47 AC_ARG_WITH(jpeg,
48               [  --without-jpeg          disable JPEG support],
49               [with_jpeg=$withval],
50               [with_jpeg='yes'])
51
52 # Disable TIFF.
53 AC_ARG_WITH(tiff,
54               [  --without-tiff          disable TIFF support],
55               [with_tiff=$withval],
56               [with_tiff='yes'])
57
58 # Disable ZLIB
59 AC_ARG_WITH(zlib,
60               [  --without-zlib          disable ZLIB support],
61               [with_zlib=$withval],
62               [with_zlib='yes'])
63
64 # Check for programs
65 AC_PROG_CC_STDC
66 AC_PROG_CPP
67 AC_PROG_CXX
68
69 #AM_PROG_LD
70 #AC_SUBST(LD)
71 #AC_PROG_INSTALL
72 #AC_PROG_MAKE_SET
73 #AC_PROG_LN_S
74
75 #
76 # Tests for Windows
77 #
78 AC_EXEEXT
79 AC_OBJEXT
80
81 # Configure libtool
82 AC_ENABLE_SHARED
83 AC_ENABLE_STATIC
84 AC_LIBTOOL_WIN32_DLL
85 AC_LIBTOOL_SETUP
86 AC_PROG_LIBTOOL
87 AC_SUBST(LIBTOOL_DEPS)
88
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.
92 AM_MAINTAINER_MODE
93
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.
97 AC_C_INLINE
98 AC_SUBST(inline)
99
100 # If words are stored with the most significant byte first (like
101 # Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
102 AC_C_BIGENDIAN
103
104 #
105 # Find math library
106 #
107 LIB_MATH=''
108 AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,)
109 LIBS="$LIB_MATH $LIBS"
110 AC_SUBST(LIB_MATH)
111
112 #
113 # Check for JPEG
114 #
115 have_jpeg='no'
116 LIB_JPEG=''
117 if test ! "$with_jpeg" = 'no'
118 then
119     AC_MSG_CHECKING(for JPEG support )
120     AC_MSG_RESULT()
121     failed=0;
122     passed=0;
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`,)
128
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,
132 [AC_TRY_COMPILE(
133 #include <stdio.h>
134 #include <stdlib.h>
135 #include <jpeglib.h>
136 ,
137 changequote(<<, >>)dnl
138 <<
139 #if JPEG_LIB_VERSION < 62
140 #error IJG JPEG library must be version 6b or newer!
141 #endif
142 return 0;
143 >>,
144 changequote([, ])dnl
145 ac_cv_jpeg_version_ok='yes',
146 ac_cv_jpeg_version_ok='no')])
147 if test "$ac_cv_jpeg_version_ok" = 'yes' ; then
148  AC_MSG_RESULT(yes)
149  passed=`expr $passed + 1`
150 else
151  AC_MSG_RESULT(no)
152  failed=`expr $failed + 1`
153 fi
154 fi
155     AC_MSG_CHECKING(if JPEG package is complete)
156     if test $passed -gt 0
157     then
158     if test $failed -gt 0
159     then
160         AC_MSG_RESULT(no -- some components failed test)
161         have_jpeg='no (failed tests)'
162     else
163         LIB_JPEG='-ljpeg'
164         LIBS="$LIB_JPEG $LIBS"
165         AC_DEFINE(HasJPEG,1,Define if you have JPEG library)
166         AC_MSG_RESULT(yes)
167         have_jpeg='yes'
168     fi
169     else
170         AC_MSG_RESULT(no)
171     fi
172 fi
173 AM_CONDITIONAL(HasJPEG, test "$have_jpeg" = 'yes')
174 AC_SUBST(LIB_JPEG)
175
176 #
177 # Check for ZLIB
178 #
179 have_zlib='no'
180 dnl PNG requires zlib so enable zlib check if PNG is requested
181 if test ! "$with_zlib" = 'no' || test ! "$with_png" = 'no'
182 then
183   LIB_ZLIB=''
184   AC_MSG_CHECKING(for ZLIB support )
185   AC_MSG_RESULT()
186   failed=0;
187   passed=0;
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
198   then
199     if test $failed -gt 0
200     then
201       AC_MSG_RESULT(no -- some components failed test)
202       have_zlib='no (failed tests)'
203     else
204       LIB_ZLIB='-lz'
205       LIBS="$LIB_ZLIB $LIBS"
206       AC_DEFINE(HasZLIB,1,Define if you have zlib compression library)
207       AC_MSG_RESULT(yes)
208       have_zlib='yes'
209     fi
210   else
211     AC_MSG_RESULT(no)
212   fi
213 fi
214 AM_CONDITIONAL(HasZLIB, test "$have_zlib" = 'yes')
215 AC_SUBST(LIB_ZLIB)
216
217 #
218 # Check for TIFF
219 #
220 have_tiff='no'
221 LIB_TIFF=''
222 if test ! "$with_tiff" = 'no'
223 then
224     AC_MSG_CHECKING(for TIFF support )
225     AC_MSG_RESULT()
226     failed=0;
227     passed=0;
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
235     then
236     if test $failed -gt 0
237     then
238         AC_MSG_RESULT(no -- some components failed test)
239         have_tiff='no (failed tests)'
240     else
241         LIB_TIFF='-ltiff'
242         LIBS="$LIB_TIFF $LIBS"
243         AC_DEFINE(HasTIFF,1,Define if you have TIFF library)
244         AC_MSG_RESULT(yes)
245         have_tiff='yes'
246         AC_CHECK_HEADERS(tiffconf.h)
247     fi
248     else
249     AC_MSG_RESULT(no)
250     fi
251 fi
252 AM_CONDITIONAL(HasTIFF, test "$have_tiff" = 'yes')
253 AC_SUBST(LIB_TIFF)
254
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)
259
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)
264
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)
269
270 LIBS=''
271
272 #
273 # Perform substitutions
274 #
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])
285 AC_OUTPUT