2 define([OPJ_MAJOR], [1])
3 define([OPJ_MINOR], [4])
4 define([OPJ_BUILD], [0])
6 define([JP3D_MAJOR], [1])
7 define([JP3D_MINOR], [3])
8 define([JP3D_BUILD], [0])
11 #AC_INIT (PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL])
13 OPJ_MAJOR.OPJ_MINOR.OPJ_BUILD,
14 http://code.google.com/p/openjpeg/,
15 openjpeg-OPJ_MAJOR.OPJ_MINOR.OPJ_BUILD,
16 http://www.openjpeg.org/)
17 AC_CONFIG_SRCDIR([libopenjpeg/openjpeg.c])
18 AC_CONFIG_HEADERS(opj_config.h)
21 #foreign:package will not follow the GNU Standards
22 AM_INIT_AUTOMAKE(foreign)
31 JP3D_MAJOR_NR=JP3D_MAJOR
32 JP3D_MINOR_NR=JP3D_MINOR
33 JP3D_BUILD_NR=JP3D_BUILD
34 AC_SUBST(JP3D_MAJOR_NR)
35 AC_SUBST(JP3D_MINOR_NR)
36 AC_SUBST(JP3D_BUILD_NR)
38 # Checks for programs.
66 AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,)
69 AC_PATH_PROG([PKGCONFIG], [pkg-config])
71 # ------------------------------
73 # ------------------------------
74 AC_MSG_CHECKING(whether to build with PNG support)
81 [ --enable-png[=[yes|no]] Build with PNG support [ [default=yes] ]],
82 test "$enable_png" = "no" && with_libpng="no")
84 if test "x$with_libpng" = xyes ; then
86 AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])
89 AC_ARG_WITH(png_includes,
90 [ --with-png-includes=DIR PNG includes in nonstandard DIR])
91 if test -n "$with_png_includes" ; then
92 pngheader="$with_png_includes"
93 pngincludes="-I$with_png_includes"
95 if test -n "$PKGCONFIG" ; then
96 pngincludes="`$PKGCONFIG --variable=includedir libpng`"
98 if test -n "$pngincludes" ; then
99 pngheader="$pngincludes"
100 pngincludes="-I$pngincludes"
103 if test -n "$pngheader" ; then
104 pngheader="$pngheader/png.h"
108 AC_CHECK_HEADER($pngheader,png_header_found="yes",,)
110 if test "$png_header_found" = "no" ; then
113 if test -n "$LIBPNG_CONFIG" ; then
114 pngincludes="`$LIBPNG_CONFIG --I_opts`"
115 pngheader="`$LIBPNG_CONFIG --I_opts | $SED 's/-I//'`"
117 if test -n "$pngheader" ; then
118 pngheader="$pngheader/png.h"
119 AC_CHECK_HEADER($pngheader,png_header_found="yes",,)
123 AC_ARG_WITH(png_libraries,
124 [ --with-png-libraries=DIR PNG library in nonstandard DIR])
125 if [[ -n "$with_png_libraries" ]] ; then
126 pnglibs="-L$with_png_libraries -lpng -lz $LIB_MATH"
128 if test -n "$LIBPNG_CONFIG" ; then
129 pnglibs="`$LIBPNG_CONFIG --ldflags` -lz $LIB_MATH"
131 if test -n "$PKGCONFIG" ; then
132 pnglibs="`$PKGCONFIG --libs libpng` $LIB_MATH"
136 if test -n "$pnglibs" ; then
137 if test -n "$pngincludes" ; then
139 png_header_found="yes"
140 AC_DEFINE(HAVE_LIBPNG, [1], [define to 1 if you have libpng])
145 AC_MSG_RESULT(png is usable:$with_libpng)
146 AM_CONDITIONAL([with_libpng], [test x$with_libpng = xyes])
147 LDLIBS="$LDLIBS $pnglibs"
148 AC_SUBST(pngincludes)
150 # -------------------------------
152 # -------------------------------
153 AC_MSG_CHECKING(whether to build with TIFF support)
157 tiff_header_found="no"
160 [ --enable-tiff[=[yes|no]] Build with TIFF support [ [default=yes] ]],
161 test "$enable_tiff" = "no" && with_libtiff="no")
163 if test "x$with_libtiff" = xyes ; then
166 AC_CHECK_LIB(tiff, TIFFOpen, tifflibs=-ltiff)
167 if test -n "$tifflibs" ; then
168 AC_CHECK_HEADER(tiff.h,tiff_header_found="yes",,)
169 if test "$tiff_header_found" = "yes" ; then
171 LIBS="$LIBS -ltiff $LIB_MATH"
172 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
176 if test "x$with_libtiff" = xno ; then
178 AC_ARG_WITH(tiff_includes,
179 [ --with-tiff-includes=DIR TIFF includes in nonstandard DIR])
180 if test -n "$with_tiff_includes" ; then
181 tiffheader="$with_tiff_includes/tiff.h"
182 AC_CHECK_HEADER($tiffheader,tiff_header_found="yes",,)
183 if test "$tiff_header_found" = "yes" ; then
184 tiffincludes="-I$with_tiff_includes"
187 AC_ARG_WITH(tiff_libraries,
188 [ --with-tiff-libraries=DIR TIFF library in nonstandard DIR])
189 if test -n "$with_tiff_libraries" ; then
190 tifflibs="-L$with_tiff_libraries"
192 tifflibs="$tifflibs -ltiff $LIB_MATH"
197 AC_CHECK_LIB(tiff, TIFFOpen, , tifflibs="",)
199 if test -n "$tifflibs" ; then
200 if test "$tiff_header_found" = "yes" ; then
202 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
205 LIBS="$savedLIBS $tifflibs"
209 AC_MSG_RESULT(tiff is usable:$with_libtiff)
210 AM_CONDITIONAL([with_libtiff], [test x$with_libtiff = xyes])
211 LDLIBS="$tifflibs $LDLIBS"
212 AC_SUBST(tiffincludes)
214 # -------------------------------
215 # Test for LCMS version 2.x
216 # -------------------------------
217 AC_MSG_CHECKING(whether to build with LCMS support)
223 lcms1_header_found="no"
224 lcms2_header_found="no"
225 have_lcms1_version=""
226 have_lcms2_version=""
230 [ --enable-lcms2[=[yes|no]] Build with LCMS-2 support [ [default=yes] ]],
231 test "$enable_lcms2" = "no" && with_liblcms2="no")
233 if test "x$with_liblcms2" = xyes ; then
236 AC_ARG_WITH(lcms2_includes,
237 [ --with-lcms2-includes=DIR LCMS-2 includes in nonstandard DIR])
238 if test -n "$with_lcms2_includes" ; then
239 lcms2header="$with_lcms2_includes"
240 lcms2includes="-I$with_lcms2_includes"
242 if test -n "$PKGCONFIG" ; then
243 lcms2includes="`$PKGCONFIG --variable=prefix lcms2`"
245 if test -n "$lcms2includes" ; then
246 lcms2header="$lcms2_includes"
247 lcms2includes="-I$lcms2includes/include"
250 if test -n "$lcms2header" ; then
251 lcms2header="$lcms2header/lcms2.h"
253 lcms2header="lcms2.h"
255 AC_CHECK_HEADER($lcms2header,lcms2_header_found="yes",,)
257 AC_ARG_WITH(lcms2_libraries,
258 [ --with-lcms2-libraries=DIR LCMS-2 library in nonstandard DIR])
259 if test -n "$with_lcms2_libraries" ; then
260 lcms2libs="-L$with_lcms2_libraries -llcms2"
262 if test -n "$PKGCONFIG" ; then
263 lcms2libs="`$PKGCONFIG --libs lcms2`"
265 if test -z "$lcms2libs" ; then
268 lcms2libs="$lcms2libs $LIB_MATH"
274 AC_CHECK_LIB(lcms2, cmsOpenProfileFromFile, ,lcms2libs="",)
276 if test -n "$lcms2libs" ; then
277 if test "$lcms2_header_found" = "yes" ; then
279 AC_DEFINE(HAVE_LIBLCMS2, [1], [define to 1 if you have lcms version 2.x])
280 if test -n "$PKGCONFIG" ; then
281 have_lcms2_version="`$PKGCONFIG --modversion lcms2`"
285 if test "$with_liblcms2" = "no" ; then
290 LIBS="$savedLIBS $lcms2libs"
293 AC_MSG_RESULT(lcms2 is usable:$with_liblcms2)
294 AM_CONDITIONAL([with_liblcms2], [test x$with_liblmcs2 = xyes])
295 LDLIBS="$lcms2libs $LDLIBS"
296 AC_SUBST(lcms2includes)
298 AC_MSG_RESULT(lcms2libs:$lcms2libs)
299 # ----------------------------
300 # Test for LCMS version 1.x
301 # ----------------------------
302 if [[ -z "$lcms2libs" ]] ; then
305 [ --enable-lcms1[=[yes|no]] Build with LCMS-1 support [ [default=yes] ]],
306 test "$enable_lcms1" = "no" && with_liblcms1="no")
308 if test "x$with_liblcms1" = xyes ; then
311 AC_ARG_WITH(lcms1_includes,
312 [ --with-lcms1-includes=DIR LCMS-1 includes in nonstandard DIR])
313 if test -n "$with_lcms1_includes" ; then
314 lcms1header="$with_lcms1_includes"
315 lcms1includes="-I$with_lcms1_includes"
317 if test -n "$PKGCONFIG" ; then
318 lcms1includes="`$PKGCONFIG --variable=includedir lcms`"
320 if test -n "$lcms1includes" ; then
321 lcms1header="$lcms1includes"
322 lcms1includes="-I$lcms1includes"
325 if test -n "$lcms1header" ; then
326 lcms1header="$lcms1header/lcms.h"
330 AC_CHECK_HEADER($lcms1header,lcms1_header_found="yes",,)
332 AC_ARG_WITH(lcms1_libraries,
333 [ --with-lcms1-libraries=DIR LCMS-1 library in nonstandard DIR])
334 if test -n "$with_lcms1_libraries" ; then
335 lcms1libs="-L$with_lcms1_libraries -llcms"
337 if test -n "$PKGCONFIG" ; then
338 lcms1libs="`$PKGCONFIG --libs lcms`"
340 if test -z "$lcms1libs" ; then
343 lcms1libs="$lcms1libs $LIB_MATH"
349 AC_CHECK_LIB(lcms, cmsOpenProfileFromFile, ,lcms1libs="",)
351 if test -n "$lcms1libs" ; then
352 if test "$lcms1_header_found" = "yes" ; then
354 AC_DEFINE(HAVE_LIBLCMS1, [1], [define to 1 if you have lcms version 1.x])
355 if test -n "$PKGCONFIG" ; then
356 have_lcms1_version="`$PKGCONFIG --modversion lcms`"
360 if test "$with_liblcms1" = "no" ; then
365 LIBS="$savedLIBS $lcms1libs"
367 AC_MSG_RESULT(lcms is usable:$with_liblcms1)
370 AM_CONDITIONAL([with_liblcms1], [test x$with_liblcms1 = xyes])
371 LDLIBS="$lcms1libs $LDLIBS"
372 AC_SUBST(lcms1includes)
375 # -------------------------------
377 # -------------------------------
378 AC_MSG_CHECKING(whether to build with JPWL support)
382 [ --enable-jpwl[=[yes|no]] Build with JPWL support [ [default=no] ]],
383 test "$enable_jpwl" = "yes" && with_libjpwl="yes")
385 AC_MSG_RESULT($with_libjpwl)
386 AM_CONDITIONAL([with_libjpwl], [test x$with_libjpwl = xyes])
387 if test "$with_libjpwl" = "yes" ; then
392 # -------------------------------
393 # Test for creating SHARED LIBS
394 # -------------------------------
395 with_sharedlibs="yes"
396 AC_MSG_CHECKING(whether to build shared libraries)
397 AC_ARG_ENABLE(shared,
398 [ --enable-shared[=[yes|no]] Build shared libs [ [default=yes] ]],
399 test "$enable_shared" = "no" && with_sharedlibs="no")
401 AC_MSG_RESULT($with_sharedlibs)
402 AM_CONDITIONAL([with_sharedlibs], [test x$with_sharedlibs = xyes])
404 # -------------------------------
405 # Test for creating JP3D
406 # -------------------------------
409 AC_MSG_CHECKING(whether to build the JP3D library)
411 [ --enable-jp3d[=[yes|no]] Build jp3d libs [ [default=no] ]],
412 test "$enable_jp3d" = "yes" && with_jp3d="yes")
414 AC_MSG_RESULT($with_jp3d)
415 if test "$with_jp3d" = "yes" ; then
422 AC_CHECK_PROG(with_doxygen, doxygen, [yes],[no],,)
423 AM_CONDITIONAL([with_doxygen], [test x$with_doxygen = xyes])
425 AC_CONFIG_FILES([Makefile])
426 AC_CONFIG_FILES([libopenjpeg.pc])
427 AC_CONFIG_FILES([libopenjpeg/Makefile])
428 AC_CONFIG_FILES([jpwl/Makefile])
429 AC_CONFIG_FILES([codec/Makefile])
430 AC_CONFIG_FILES([mj2/Makefile])
431 AC_CONFIG_FILES([doc/Makefile])
432 AC_CONFIG_FILES([jp3d/Makefile])
433 AC_CONFIG_FILES([jp3d/libjp3dvm/Makefile])
434 AC_CONFIG_FILES([jp3d/codec/Makefile])
437 echo "----------------------------------------------"
438 echo " your configuration"
440 echo "--with-png-libraries: $with_libpng"
441 echo "libpng header : $png_header_found"
442 echo "--enable-tiff : $with_libtiff"
443 echo "libtiff header : $tiff_header_found"
444 echo "--enable-lcms2 : $with_liblcms2"
445 echo "lcms2 header : $lcms2_header_found"
446 echo "lcms2 version : $have_lcms2_version"
447 echo "--enable-lcms1 : $with_liblcms1"
448 echo "lcms1 header : $lcms1_header_found"
449 echo "lcms1 version : $have_lcms1_version"
450 echo "--enable-jpwl : $with_libjpwl"
451 echo "--enable-jp3d : $with_jp3d"
452 echo "--enable-shared : $with_sharedlibs"
453 echo "----------------------------------------------"