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.
63 AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,)
65 AC_CHECK_LIB(z,inflate,LIB_Z="-lz",,)
67 LIBS="$LIBS $LIB_MATH $LIB_Z"
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`"
97 if test -n "$pngincludes" ; then
98 pngheader="$pngincludes"
99 pngincludes="-I$pngincludes"
102 if test -n "$LIBPNG_CONFIG" ; then
103 pngincludes="`$LIBPNG_CONFIG --I_opts`"
104 pngheader="`$LIBPNG_CONFIG --I_opts | $SED 's/-I//'`"
108 if test -n "$pngheader" ; then
109 pngheader="$pngheader/png.h"
114 AC_CHECK_HEADER($pngheader,png_header_found="yes",,)
116 AC_ARG_WITH(png_libraries,
117 [ --with-png-libraries=DIR PNG library in nonstandard DIR])
118 if [[ -n "$with_png_libraries" ]] ; then
119 pnglibs="-L$with_png_libraries -lpng"
121 if test -n "$LIBPNG_CONFIG" ; then
122 pnglibs="`$LIBPNG_CONFIG --ldflags`"
124 if test -n "$PKGCONFIG" ; then
125 pnglibs="`$PKGCONFIG --libs libpng`"
130 LIBS="$pnglibs $LIB_Z $LIB_MATH"
132 AC_CHECK_LIB(png,png_create_read_struct,,pnglibs="",)
135 if test -n "$pnglibs" ; then
136 if test -n "$pngincludes" ; then
138 png_header_found="yes"
139 LIBS="$LIBS $pnglibs"
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 AC_SUBST(pngincludes)
149 # -------------------------------
151 # -------------------------------
152 AC_MSG_CHECKING(whether to build with TIFF support)
156 tiff_header_found="no"
159 [ --enable-tiff[=[yes|no]] Build with TIFF support [ [default=yes] ]],
160 test "$enable_tiff" = "no" && with_libtiff="no")
162 if test "x$with_libtiff" = xyes ; then
163 #TIFF compiled with JPEG and JBIG support?
165 AC_CHECK_LIB(jpeg,jpeg_read_header,libjpeg=-ljpeg,,)
167 AC_CHECK_LIB(jbig,jbg_enc_init,libjbig=-ljbig,,)
169 AC_CHECK_LIB(jbig85,jbg85_enc_init,libjbig85=-ljbig85,,)
173 LIBS="-ltiff $libjpeg $libjbig $libjbig85 $LIB_Z $LIB_MATH"
174 AC_CHECK_LIB(tiff, TIFFOpen, tifflibs=-ltiff)
176 if test -n "$tifflibs" ; then
177 AC_CHECK_HEADER(tiff.h,tiff_header_found="yes",,)
178 if test "$tiff_header_found" = "yes" ; then
180 LIBS="$LIBS -ltiff $libjpeg $libjbig $libjbig85"
181 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
185 if test "x$with_libtiff" = xno ; then
187 AC_ARG_WITH(tiff_includes,
188 [ --with-tiff-includes=DIR TIFF includes in nonstandard DIR])
189 if test -n "$with_tiff_includes" ; then
190 tiffheader="$with_tiff_includes/tiff.h"
191 AC_CHECK_HEADER($tiffheader,tiff_header_found="yes",,)
192 if test "$tiff_header_found" = "yes" ; then
193 tiffincludes="-I$with_tiff_includes"
196 AC_ARG_WITH(tiff_libraries,
197 [ --with-tiff-libraries=DIR TIFF library in nonstandard DIR])
198 if test -n "$with_tiff_libraries" ; then
199 tifflibs="-L$with_tiff_libraries"
201 tifflibs="$tifflibs -ltiff"
203 LIBS="$tifflibs $libjpeg $libjbig $libjbig85 $LIB_Z $LIB_MATH"
206 AC_CHECK_LIB(tiff, TIFFOpen, , tifflibs="",)
208 if test -n "$tifflibs" ; then
209 if test "$tiff_header_found" = "yes" ; then
211 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
214 LIBS="$savedLIBS $tifflibs $libjpeg $libjbig $libjbig85"
218 AC_MSG_RESULT(tiff is usable:$with_libtiff)
219 AM_CONDITIONAL([with_libtiff], [test x$with_libtiff = xyes])
220 AC_SUBST(tiffincludes)
222 # -------------------------------
223 # Test for LCMS version 2.x
224 # -------------------------------
225 AC_MSG_CHECKING(whether to build with LCMS support)
231 lcms1_header_found="no"
232 lcms2_header_found="no"
233 have_lcms1_version=""
234 have_lcms2_version=""
238 [ --enable-lcms2[=[yes|no]] Build with LCMS-2 support [ [default=yes] ]],
239 test "$enable_lcms2" = "no" && with_liblcms2="no")
241 if test "x$with_liblcms2" = xyes ; then
244 AC_ARG_WITH(lcms2_includes,
245 [ --with-lcms2-includes=DIR LCMS-2 includes in nonstandard DIR])
246 if test -n "$with_lcms2_includes" ; then
247 lcms2header="$with_lcms2_includes"
248 lcms2includes="-I$with_lcms2_includes"
250 if test -n "$PKGCONFIG" ; then
251 lcms2includes="`$PKGCONFIG --variable=prefix lcms2`"
253 if test -n "$lcms2includes" ; then
254 lcms2header="$lcms2_includes"
255 lcms2includes="-I$lcms2includes/include"
258 if test -n "$lcms2header" ; then
259 lcms2header="$lcms2header/lcms2.h"
261 lcms2header="lcms2.h"
263 AC_CHECK_HEADER($lcms2header,lcms2_header_found="yes",,)
265 AC_ARG_WITH(lcms2_libraries,
266 [ --with-lcms2-libraries=DIR LCMS-2 library in nonstandard DIR])
267 if test -n "$with_lcms2_libraries" ; then
268 lcms2libs="-L$with_lcms2_libraries -llcms2"
270 if test -n "$PKGCONFIG" ; then
271 lcms2libs="`$PKGCONFIG --libs lcms2`"
273 if test -z "$lcms2libs" ; then
276 lcms2libs="$lcms2libs"
279 LIBS="$lcms2libs $LIB_MATH"
282 AC_CHECK_LIB(lcms2, cmsOpenProfileFromFile, ,lcms2libs="",)
284 if test -n "$lcms2libs" ; then
285 if test "$lcms2_header_found" = "yes" ; then
287 AC_DEFINE(HAVE_LIBLCMS2, [1], [define to 1 if you have lcms version 2.x])
288 if test -n "$PKGCONFIG" ; then
289 have_lcms2_version="`$PKGCONFIG --modversion lcms2`"
293 if test "$with_liblcms2" = "no" ; then
298 LIBS="$savedLIBS $lcms2libs"
301 AC_MSG_RESULT(lcms2 is usable:$with_liblcms2)
302 AM_CONDITIONAL([with_liblcms2], [test x$with_liblcms2 = xyes])
303 AC_SUBST(lcms2includes)
305 AC_MSG_RESULT(lcms2libs:$lcms2libs)
306 # ----------------------------
307 # Test for LCMS version 1.x
308 # ----------------------------
309 if [[ -z "$lcms2libs" ]] ; then
312 [ --enable-lcms1[=[yes|no]] Build with LCMS-1 support [ [default=yes] ]],
313 test "$enable_lcms1" = "no" && with_liblcms1="no")
315 if test "x$with_liblcms1" = xyes ; then
318 AC_ARG_WITH(lcms1_includes,
319 [ --with-lcms1-includes=DIR LCMS-1 includes in nonstandard DIR])
320 if test -n "$with_lcms1_includes" ; then
321 lcms1header="$with_lcms1_includes"
322 lcms1includes="-I$with_lcms1_includes"
324 if test -n "$PKGCONFIG" ; then
325 lcms1includes="`$PKGCONFIG --variable=includedir lcms`"
327 if test -n "$lcms1includes" ; then
328 lcms1header="$lcms1includes"
329 lcms1includes="-I$lcms1includes"
332 if test -n "$lcms1header" ; then
333 lcms1header="$lcms1header/lcms.h"
337 AC_CHECK_HEADER($lcms1header,lcms1_header_found="yes",,)
339 AC_ARG_WITH(lcms1_libraries,
340 [ --with-lcms1-libraries=DIR LCMS-1 library in nonstandard DIR])
341 if test -n "$with_lcms1_libraries" ; then
342 lcms1libs="-L$with_lcms1_libraries -llcms"
344 if test -n "$PKGCONFIG" ; then
345 lcms1libs="`$PKGCONFIG --libs lcms`"
347 if test -z "$lcms1libs" ; then
350 lcms1libs="$lcms1libs"
353 LIBS="$lcms1libs $LIB_MATH"
356 AC_CHECK_LIB(lcms, cmsOpenProfileFromFile, ,lcms1libs="",)
358 if test -n "$lcms1libs" ; then
359 if test "$lcms1_header_found" = "yes" ; then
361 AC_DEFINE(HAVE_LIBLCMS1, [1], [define to 1 if you have lcms version 1.x])
362 if test -n "$PKGCONFIG" ; then
363 have_lcms1_version="`$PKGCONFIG --modversion lcms`"
367 if test "$with_liblcms1" = "no" ; then
372 LIBS="$savedLIBS $lcms1libs"
374 AC_MSG_RESULT(lcms is usable:$with_liblcms1)
377 AM_CONDITIONAL([with_liblcms1], [test x$with_liblcms1 = xyes])
378 AC_SUBST(lcms1includes)
381 # -------------------------------
383 # -------------------------------
384 AC_MSG_CHECKING(whether to build with JPWL support)
388 [ --enable-jpwl[=[yes|no]] Build with JPWL support [ [default=no] ]],
389 test "$enable_jpwl" = "yes" && with_libjpwl="yes")
391 AC_MSG_RESULT($with_libjpwl)
392 AM_CONDITIONAL([with_libjpwl], [test x$with_libjpwl = xyes])
393 if test "$with_libjpwl" = "yes" ; then
398 # -------------------------------
399 # Test for creating SHARED LIBS
400 # wanted result: shared xor static
401 # -------------------------------
402 with_sharedlibs="yes"
403 AC_MSG_CHECKING(whether to build shared libraries)
404 AC_ARG_ENABLE(shared,
405 [ --enable-shared[=[yes|no]] Build shared libs [ [default=yes] ]],
406 test "$enable_shared" = "no" && with_sharedlibs="no")
408 AC_MSG_RESULT($with_sharedlibs)
409 AM_CONDITIONAL([with_sharedlibs], [test x$with_sharedlibs = xyes])
411 # -------------------------------
412 # Test for creating JP3D
413 # -------------------------------
416 AC_MSG_CHECKING(whether to build the JP3D library)
418 [ --enable-jp3d[=[yes|no]] Build jp3d libs [ [default=no] ]],
419 test "$enable_jp3d" = "yes" && with_jp3d="yes")
421 AC_MSG_RESULT($with_jp3d)
422 if test "$with_jp3d" = "yes" ; then
427 AC_CHECK_PROG(with_doxygen, doxygen, [yes],[no],,)
428 AM_CONDITIONAL([with_doxygen], [test x$with_doxygen = xyes])
430 AC_CONFIG_FILES([Makefile])
431 AC_CONFIG_FILES([libopenjpeg.pc])
432 AC_CONFIG_FILES([libopenjpeg/Makefile])
433 AC_CONFIG_FILES([jpwl/Makefile])
434 AC_CONFIG_FILES([codec/Makefile])
435 AC_CONFIG_FILES([mj2/Makefile])
436 AC_CONFIG_FILES([doc/Makefile])
437 AC_CONFIG_FILES([jp3d/Makefile])
438 AC_CONFIG_FILES([jp3d/libjp3dvm/Makefile])
439 AC_CONFIG_FILES([jp3d/codec/Makefile])
442 echo "----------------------------------------------"
443 echo " your configuration"
445 echo "--with-png-libraries: $with_libpng"
446 echo "libpng header : $png_header_found"
447 echo "--enable-tiff : $with_libtiff"
448 echo "libtiff header : $tiff_header_found"
449 echo "--enable-lcms2 : $with_liblcms2"
450 echo "lcms2 header : $lcms2_header_found"
451 echo "lcms2 version : $have_lcms2_version"
452 echo "--enable-lcms1 : $with_liblcms1"
453 echo "lcms1 header : $lcms1_header_found"
454 echo "lcms1 version : $have_lcms1_version"
455 echo "--enable-jpwl : $with_libjpwl"
456 echo "--enable-jp3d : $with_jp3d"
457 echo "--enable-shared : $with_sharedlibs"
458 echo "----------------------------------------------"