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.
64 AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,)
66 AC_CHECK_LIB(z,inflate,LIB_Z="-lz",,)
68 AC_PATH_PROG([PKGCONFIG], [pkg-config])
70 # ------------------------------
72 # ------------------------------
73 AC_MSG_CHECKING(whether to build with PNG support)
80 [ --enable-png[=[yes|no]] Build with PNG support [ [default=yes] ]],
81 test "$enable_png" = "no" && with_libpng="no")
83 if test "x$with_libpng" = xyes ; then
85 AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])
88 AC_ARG_WITH(png_includes,
89 [ --with-png-includes=DIR PNG includes in nonstandard DIR])
90 if test -n "$with_png_includes" ; then
91 pngheader="$with_png_includes"
92 pngincludes="-I$with_png_includes"
94 if test -n "$PKGCONFIG" ; then
95 pngincludes="`$PKGCONFIG --variable=includedir libpng`"
96 if test -n "$pngincludes" ; then
97 pngheader="$pngincludes"
98 pngincludes="-I$pngincludes"
101 if test -n "$LIBPNG_CONFIG" ; then
102 pngincludes="`$LIBPNG_CONFIG --I_opts`"
103 pngheader="`$LIBPNG_CONFIG --I_opts | $SED 's/-I//'`"
107 if test -n "$pngheader" ; then
108 pngheader="$pngheader/png.h"
113 AC_CHECK_HEADER($pngheader,png_header_found="yes",,)
115 AC_ARG_WITH(png_libraries,
116 [ --with-png-libraries=DIR PNG library in nonstandard DIR])
117 if [[ -n "$with_png_libraries" ]] ; then
118 pnglibs="-L$with_png_libraries -lpng $LIB_Z $LIB_MATH"
120 if test -n "$LIBPNG_CONFIG" ; then
121 pnglibs="`$LIBPNG_CONFIG --ldflags` $LIB_Z $LIB_MATH"
123 if test -n "$PKGCONFIG" ; then
124 pnglibs="`$PKGCONFIG --libs libpng` $LIB_Z $LIB_MATH"
131 AC_CHECK_LIB(png,png_read_png,,pnglibs="",)
134 if test -n "$pnglibs" ; then
135 if test -n "$pngincludes" ; then
137 png_header_found="yes"
138 LIBS="$LIBS $pnglibs"
139 AC_DEFINE(HAVE_LIBPNG, [1], [define to 1 if you have libpng])
144 AC_MSG_RESULT(png is usable:$with_libpng)
145 AM_CONDITIONAL([with_libpng], [test x$with_libpng = xyes])
146 AC_SUBST(pngincludes)
148 # -------------------------------
150 # -------------------------------
151 AC_MSG_CHECKING(whether to build with TIFF support)
155 tiff_header_found="no"
158 [ --enable-tiff[=[yes|no]] Build with TIFF support [ [default=yes] ]],
159 test "$enable_tiff" = "no" && with_libtiff="no")
161 if test "x$with_libtiff" = xyes ; then
162 #TIFF compiled with JPEG and JBIG support?
164 AC_CHECK_LIB(jpeg,jpeg_read_header,libjpeg=-ljpeg,,)
166 AC_CHECK_LIB(jbig,jbg_enc_init,libjbig=-ljbig,,)
168 AC_CHECK_LIB(jbig85,jbg85_enc_init,libjbig85=-ljbig85,,)
172 LIBS="-ltiff $libjpeg $libjbig $libjbig85 $LIB_Z $LIB_MATH"
173 AC_CHECK_LIB(tiff, TIFFOpen, tifflibs=-ltiff)
175 if test -n "$tifflibs" ; then
176 AC_CHECK_HEADER(tiff.h,tiff_header_found="yes",,)
177 if test "$tiff_header_found" = "yes" ; then
179 LIBS="$LIBS -ltiff $libjpeg $libjbig $libjbig85 $LIB_Z $LIB_MATH"
180 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
184 if test "x$with_libtiff" = xno ; then
186 AC_ARG_WITH(tiff_includes,
187 [ --with-tiff-includes=DIR TIFF includes in nonstandard DIR])
188 if test -n "$with_tiff_includes" ; then
189 tiffheader="$with_tiff_includes/tiff.h"
190 AC_CHECK_HEADER($tiffheader,tiff_header_found="yes",,)
191 if test "$tiff_header_found" = "yes" ; then
192 tiffincludes="-I$with_tiff_includes"
195 AC_ARG_WITH(tiff_libraries,
196 [ --with-tiff-libraries=DIR TIFF library in nonstandard DIR])
197 if test -n "$with_tiff_libraries" ; then
198 tifflibs="-L$with_tiff_libraries"
200 tifflibs="$tifflibs -ltiff $LIB_MATH"
205 AC_CHECK_LIB(tiff, TIFFOpen, , tifflibs="",)
207 if test -n "$tifflibs" ; then
208 if test "$tiff_header_found" = "yes" ; then
210 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
213 LIBS="$savedLIBS $tifflibs"
217 AC_MSG_RESULT(tiff is usable:$with_libtiff)
218 AM_CONDITIONAL([with_libtiff], [test x$with_libtiff = xyes])
219 AC_SUBST(tiffincludes)
221 # -------------------------------
222 # Test for LCMS version 2.x
223 # -------------------------------
224 AC_MSG_CHECKING(whether to build with LCMS support)
230 lcms1_header_found="no"
231 lcms2_header_found="no"
232 have_lcms1_version=""
233 have_lcms2_version=""
237 [ --enable-lcms2[=[yes|no]] Build with LCMS-2 support [ [default=yes] ]],
238 test "$enable_lcms2" = "no" && with_liblcms2="no")
240 if test "x$with_liblcms2" = xyes ; then
243 AC_ARG_WITH(lcms2_includes,
244 [ --with-lcms2-includes=DIR LCMS-2 includes in nonstandard DIR])
245 if test -n "$with_lcms2_includes" ; then
246 lcms2header="$with_lcms2_includes"
247 lcms2includes="-I$with_lcms2_includes"
249 if test -n "$PKGCONFIG" ; then
250 lcms2includes="`$PKGCONFIG --variable=prefix lcms2`"
252 if test -n "$lcms2includes" ; then
253 lcms2header="$lcms2_includes"
254 lcms2includes="-I$lcms2includes/include"
257 if test -n "$lcms2header" ; then
258 lcms2header="$lcms2header/lcms2.h"
260 lcms2header="lcms2.h"
262 AC_CHECK_HEADER($lcms2header,lcms2_header_found="yes",,)
264 AC_ARG_WITH(lcms2_libraries,
265 [ --with-lcms2-libraries=DIR LCMS-2 library in nonstandard DIR])
266 if test -n "$with_lcms2_libraries" ; then
267 lcms2libs="-L$with_lcms2_libraries -llcms2"
269 if test -n "$PKGCONFIG" ; then
270 lcms2libs="`$PKGCONFIG --libs lcms2`"
272 if test -z "$lcms2libs" ; then
275 lcms2libs="$lcms2libs $LIB_MATH"
281 AC_CHECK_LIB(lcms2, cmsOpenProfileFromFile, ,lcms2libs="",)
283 if test -n "$lcms2libs" ; then
284 if test "$lcms2_header_found" = "yes" ; then
286 AC_DEFINE(HAVE_LIBLCMS2, [1], [define to 1 if you have lcms version 2.x])
287 if test -n "$PKGCONFIG" ; then
288 have_lcms2_version="`$PKGCONFIG --modversion lcms2`"
292 if test "$with_liblcms2" = "no" ; then
297 LIBS="$savedLIBS $lcms2libs"
300 AC_MSG_RESULT(lcms2 is usable:$with_liblcms2)
301 AM_CONDITIONAL([with_liblcms2], [test x$with_liblmcs2 = xyes])
302 AC_SUBST(lcms2includes)
304 AC_MSG_RESULT(lcms2libs:$lcms2libs)
305 # ----------------------------
306 # Test for LCMS version 1.x
307 # ----------------------------
308 if [[ -z "$lcms2libs" ]] ; then
311 [ --enable-lcms1[=[yes|no]] Build with LCMS-1 support [ [default=yes] ]],
312 test "$enable_lcms1" = "no" && with_liblcms1="no")
314 if test "x$with_liblcms1" = xyes ; then
317 AC_ARG_WITH(lcms1_includes,
318 [ --with-lcms1-includes=DIR LCMS-1 includes in nonstandard DIR])
319 if test -n "$with_lcms1_includes" ; then
320 lcms1header="$with_lcms1_includes"
321 lcms1includes="-I$with_lcms1_includes"
323 if test -n "$PKGCONFIG" ; then
324 lcms1includes="`$PKGCONFIG --variable=includedir lcms`"
326 if test -n "$lcms1includes" ; then
327 lcms1header="$lcms1includes"
328 lcms1includes="-I$lcms1includes"
331 if test -n "$lcms1header" ; then
332 lcms1header="$lcms1header/lcms.h"
336 AC_CHECK_HEADER($lcms1header,lcms1_header_found="yes",,)
338 AC_ARG_WITH(lcms1_libraries,
339 [ --with-lcms1-libraries=DIR LCMS-1 library in nonstandard DIR])
340 if test -n "$with_lcms1_libraries" ; then
341 lcms1libs="-L$with_lcms1_libraries -llcms"
343 if test -n "$PKGCONFIG" ; then
344 lcms1libs="`$PKGCONFIG --libs lcms`"
346 if test -z "$lcms1libs" ; then
349 lcms1libs="$lcms1libs $LIB_MATH"
355 AC_CHECK_LIB(lcms, cmsOpenProfileFromFile, ,lcms1libs="",)
357 if test -n "$lcms1libs" ; then
358 if test "$lcms1_header_found" = "yes" ; then
360 AC_DEFINE(HAVE_LIBLCMS1, [1], [define to 1 if you have lcms version 1.x])
361 if test -n "$PKGCONFIG" ; then
362 have_lcms1_version="`$PKGCONFIG --modversion lcms`"
366 if test "$with_liblcms1" = "no" ; then
371 LIBS="$savedLIBS $lcms1libs"
373 AC_MSG_RESULT(lcms is usable:$with_liblcms1)
376 AM_CONDITIONAL([with_liblcms1], [test x$with_liblcms1 = xyes])
377 AC_SUBST(lcms1includes)
380 # -------------------------------
382 # -------------------------------
383 AC_MSG_CHECKING(whether to build with JPWL support)
387 [ --enable-jpwl[=[yes|no]] Build with JPWL support [ [default=no] ]],
388 test "$enable_jpwl" = "yes" && with_libjpwl="yes")
390 AC_MSG_RESULT($with_libjpwl)
391 AM_CONDITIONAL([with_libjpwl], [test x$with_libjpwl = xyes])
392 if test "$with_libjpwl" = "yes" ; then
397 # -------------------------------
398 # Test for creating SHARED LIBS
399 # -------------------------------
400 with_sharedlibs="yes"
401 AC_MSG_CHECKING(whether to build shared libraries)
402 AC_ARG_ENABLE(shared,
403 [ --enable-shared[=[yes|no]] Build shared libs [ [default=yes] ]],
404 test "$enable_shared" = "no" && with_sharedlibs="no")
406 AC_MSG_RESULT($with_sharedlibs)
407 AM_CONDITIONAL([with_sharedlibs], [test x$with_sharedlibs = xyes])
409 # -------------------------------
410 # Test for creating JP3D
411 # -------------------------------
414 AC_MSG_CHECKING(whether to build the JP3D library)
416 [ --enable-jp3d[=[yes|no]] Build jp3d libs [ [default=no] ]],
417 test "$enable_jp3d" = "yes" && with_jp3d="yes")
419 AC_MSG_RESULT($with_jp3d)
420 if test "$with_jp3d" = "yes" ; then
425 AC_CHECK_PROG(with_doxygen, doxygen, [yes],[no],,)
426 AM_CONDITIONAL([with_doxygen], [test x$with_doxygen = xyes])
428 AC_CONFIG_FILES([Makefile])
429 AC_CONFIG_FILES([libopenjpeg.pc])
430 AC_CONFIG_FILES([libopenjpeg/Makefile])
431 AC_CONFIG_FILES([jpwl/Makefile])
432 AC_CONFIG_FILES([codec/Makefile])
433 AC_CONFIG_FILES([mj2/Makefile])
434 AC_CONFIG_FILES([doc/Makefile])
435 AC_CONFIG_FILES([jp3d/Makefile])
436 AC_CONFIG_FILES([jp3d/libjp3dvm/Makefile])
437 AC_CONFIG_FILES([jp3d/codec/Makefile])
440 echo "----------------------------------------------"
441 echo " your configuration"
443 echo "--with-png-libraries: $with_libpng"
444 echo "libpng header : $png_header_found"
445 echo "--enable-tiff : $with_libtiff"
446 echo "libtiff header : $tiff_header_found"
447 echo "--enable-lcms2 : $with_liblcms2"
448 echo "lcms2 header : $lcms2_header_found"
449 echo "lcms2 version : $have_lcms2_version"
450 echo "--enable-lcms1 : $with_liblcms1"
451 echo "lcms1 header : $lcms1_header_found"
452 echo "lcms1 version : $have_lcms1_version"
453 echo "--enable-jpwl : $with_libjpwl"
454 echo "--enable-jp3d : $with_jp3d"
455 echo "--enable-shared : $with_sharedlibs"
456 echo "----------------------------------------------"