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.
67 AC_CHECK_LIB(m,sqrt,LIB_MATH="-lm",,)
70 AC_PATH_PROG([PKGCONFIG], [pkg-config])
72 # ------------------------------
74 # ------------------------------
75 AC_MSG_CHECKING(whether to build with PNG support)
82 [ --enable-png[=[yes|no]] Build with PNG support [ [default=yes] ]],
83 test "$enable_png" = "no" && with_libpng="no")
85 if test "x$with_libpng" = xyes ; then
87 AC_PATH_PROG([LIBPNG_CONFIG], [libpng-config])
90 AC_ARG_WITH(png_includes,
91 [ --with-png-includes=DIR PNG includes in nonstandard DIR])
92 if test -n "$with_png_includes" ; then
93 pngheader="$with_png_includes"
94 pngincludes="-I$with_png_includes"
96 if test -n "$PKGCONFIG" ; then
97 pngincludes="`$PKGCONFIG --variable=includedir libpng`"
99 if test -n "$pngincludes" ; then
100 pngheader="$pngincludes"
101 pngincludes="-I$pngincludes"
104 if test -n "$pngheader" ; then
105 pngheader="$pngheader/png.h"
109 AC_CHECK_HEADER($pngheader,png_header_found="yes",,)
111 if test "$png_header_found" = "no" ; then
114 if test -n "$LIBPNG_CONFIG" ; then
115 pngincludes="`$LIBPNG_CONFIG --I_opts`"
116 pngheader="`$LIBPNG_CONFIG --I_opts | $SED 's/-I//'`"
118 if test -n "$pngheader" ; then
119 pngheader="$pngheader/png.h"
120 AC_CHECK_HEADER($pngheader,png_header_found="yes",,)
124 AC_ARG_WITH(png_libraries,
125 [ --with-png-libraries=DIR PNG library in nonstandard DIR])
126 if [[ -n "$with_png_libraries" ]] ; then
127 pnglibs="-L$with_png_libraries -lpng -lz $LIB_MATH"
129 if test -n "$LIBPNG_CONFIG" ; then
130 pnglibs="`$LIBPNG_CONFIG --ldflags` -lz $LIB_MATH"
133 if test -n "$pnglibs" ; then
134 if test -n "$pngincludes" ; then
136 png_header_found="yes"
137 AC_DEFINE(HAVE_LIBPNG, [1], [define to 1 if you have libpng])
142 AC_MSG_RESULT(png is usable:$with_libpng)
143 AM_CONDITIONAL([with_libpng], [test x$with_libpng = xyes])
144 LDLIBS="$LDLIBS $pnglibs"
145 AC_SUBST(pngincludes)
147 # -------------------------------
149 # -------------------------------
150 AC_MSG_CHECKING(whether to build with TIFF support)
154 tiff_header_found="no"
157 [ --enable-tiff[=[yes|no]] Build with TIFF support [ [default=yes] ]],
158 test "$enable_tiff" = "no" && with_libtiff="no")
160 if test "x$with_libtiff" = xyes ; then
163 AC_CHECK_LIB(tiff, TIFFOpen, tifflibs=-ltiff)
164 if test -n "$tifflibs" ; then
165 AC_CHECK_HEADER(tiff.h,tiff_header_found="yes",,)
166 if test "$tiff_header_found" = "yes" ; then
168 LIBS="$LIBS -ltiff $LIB_MATH"
169 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
173 if test "x$with_libtiff" = xno ; then
175 AC_ARG_WITH(tiff_includes,
176 [ --with-tiff-includes=DIR TIFF includes in nonstandard DIR])
177 if test -n "$with_tiff_includes" ; then
178 tiffheader="$with_tiff_includes/tiff.h"
179 AC_CHECK_HEADER($tiffheader,tiff_header_found="yes",,)
180 if test "$tiff_header_found" = "yes" ; then
181 tiffincludes="-I$with_tiff_includes"
184 AC_ARG_WITH(tiff_libraries,
185 [ --with-tiff-libraries=DIR TIFF library in nonstandard DIR])
186 if test -n "$with_tiff_libraries" ; then
187 tifflibs="-L$with_tiff_libraries"
189 tifflibs="$tifflibs -ltiff $LIB_MATH"
194 AC_CHECK_FUNC(TIFFOpen, true, tifflibs="")
196 if test -n "$tifflibs" ; then
197 if test "$tiff_header_found" = "yes" ; then
199 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
202 LIBS="$savedLIBS $tifflibs"
206 AC_MSG_RESULT(tiff is usable:$with_libtiff)
207 AM_CONDITIONAL([with_libtiff], [test x$with_libtiff = xyes])
208 LDLIBS="$tifflibs $LDLIBS"
209 AC_SUBST(tiffincludes)
211 # -------------------------------
212 # Test for LCMS version 2.x
213 # -------------------------------
214 AC_MSG_CHECKING(whether to build with LCMS support)
220 lcms1_header_found="no"
221 lcms2_header_found="no"
222 have_lcms1_version=""
223 have_lcms2_version=""
227 [ --enable-lcms2[=[yes|no]] Build with LCMS-2 support [ [default=yes] ]],
228 test "$enable_lcms2" = "no" && with_liblcms2="no")
230 if test "x$with_liblcms2" = xyes ; then
233 AC_ARG_WITH(lcms2_includes,
234 [ --with-lcms2-includes=DIR LCMS-2 includes in nonstandard DIR])
235 if test -n "$with_lcms2_includes" ; then
236 lcms2header="$with_lcms2_includes"
237 lcms2includes="-I$with_lcms2_includes"
239 if test -n "$PKGCONFIG" ; then
240 lcms2includes="`$PKGCONFIG --variable=prefix lcms2`"
242 if test -n "$lcms2includes" ; then
243 lcms2header="$lcms2_includes"
244 lcms2includes="-I$lcms2includes/include"
247 if test -n "$lcms2header" ; then
248 lcms2header="$lcms2header/lcms2.h"
250 lcms2header="lcms2.h"
252 AC_CHECK_HEADER($lcms2header,lcms2_header_found="yes",,)
254 AC_ARG_WITH(lcms2_libraries,
255 [ --with-lcms2-libraries=DIR LCMS-2 library in nonstandard DIR])
256 if test -n "$with_lcms2_libraries" ; then
257 lcms2libs="-L$with_lcms2_libraries -llcms2"
259 if test -n "$PKGCONFIG" ; then
260 lcms2libs="`$PKGCONFIG --libs lcms2`"
262 if test -z "$lcms2libs" ; then
265 lcms2libs="$lcms2libs $LIB_MATH"
271 AC_CHECK_FUNC(cmsOpenProfileFromFile, true, lcms2libs="")
273 if test -n "$lcms2libs" ; then
274 if test "$lcms2_header_found" = "yes" ; then
276 AC_DEFINE(HAVE_LIBLCMS2, [1], [define to 1 if you have lcms version 2.x])
277 if test -n "$PKGCONFIG" ; then
278 have_lcms2_version="`$PKGCONFIG --modversion lcms2`"
282 if test "$with_liblcms2" = "no" ; then
287 LIBS="$savedLIBS $lcms2libs"
290 AC_MSG_RESULT(lcms2 is usable:$with_liblcms2)
291 AM_CONDITIONAL([with_liblcms2], [test x$with_liblmcs2 = xyes])
292 LDLIBS="$lcms2libs $LDLIBS"
293 AC_SUBST(lcms2includes)
295 AC_MSG_RESULT(lcms2libs:$lcms2libs)
296 # ----------------------------
297 # Test for LCMS version 1.x
298 # ----------------------------
299 if [[ -z "$lcms2libs" ]] ; then
302 [ --enable-lcms1[=[yes|no]] Build with LCMS-1 support [ [default=yes] ]],
303 test "$enable_lcms1" = "no" && with_liblcms1="no")
305 if test "x$with_liblcms1" = xyes ; then
308 AC_ARG_WITH(lcms1_includes,
309 [ --with-lcms1-includes=DIR LCMS-1 includes in nonstandard DIR])
310 if test -n "$with_lcms1_includes" ; then
311 lcms1header="$with_lcms1_includes"
312 lcms1includes="-I$with_lcms1_includes"
314 if test -n "$PKGCONFIG" ; then
315 lcms1includes="`$PKGCONFIG --variable=includedir lcms`"
317 if test -n "$lcms1includes" ; then
318 lcms1header="$lcms1includes"
319 lcms1includes="-I$lcms1includes"
322 if test -n "$lcms1header" ; then
323 lcms1header="$lcms1header/lcms.h"
327 AC_CHECK_HEADER($lcms1header,lcms1_header_found="yes",,)
329 AC_ARG_WITH(lcms1_libraries,
330 [ --with-lcms1-libraries=DIR LCMS-1 library in nonstandard DIR])
331 if test -n "$with_lcms1_libraries" ; then
332 lcms1libs="-L$with_lcms1_libraries -llcms"
334 if test -n "$PKGCONFIG" ; then
335 lcms1libs="`$PKGCONFIG --libs lcms`"
337 if test -z "$lcms1libs" ; then
340 lcms1libs="$lcms1libs $LIB_MATH"
346 AC_CHECK_FUNC(cmsOpenProfileFromFile, true, lcms1libs="")
348 if test -n "$lcms1libs" ; then
349 if test "$lcms1_header_found" = "yes" ; then
351 AC_DEFINE(HAVE_LIBLCMS1, [1], [define to 1 if you have lcms version 1.x])
352 if test -n "$PKGCONFIG" ; then
353 have_lcms1_version="`$PKGCONFIG --modversion lcms`"
357 if test "$with_liblcms1" = "no" ; then
362 LIBS="$savedLIBS $lcms1libs"
364 AC_MSG_RESULT(lcms is usable:$with_liblcms1)
367 AM_CONDITIONAL([with_liblcms1], [test x$with_liblcms1 = xyes])
368 LDLIBS="$lcms1libs $LDLIBS"
369 AC_SUBST(lcms1includes)
372 # -------------------------------
374 # -------------------------------
375 AC_MSG_CHECKING(whether to build with JPWL support)
379 [ --enable-jpwl[=[yes|no]] Build with JPWL support [ [default=no] ]],
380 test "$enable_jpwl" = "yes" && with_libjpwl="yes")
382 AC_MSG_RESULT($with_libjpwl)
383 AM_CONDITIONAL([with_libjpwl], [test x$with_libjpwl = xyes])
384 if test "$with_libjpwl" = "yes" ; then
389 # -------------------------------
390 # Test for creating SHARED LIBS
391 # -------------------------------
393 AC_MSG_CHECKING(whether to build shared libraries)
394 AC_ARG_ENABLE(shared,
395 [ --enable-shared[=[yes|no]] Build shared libs [ [default=no] ]],
396 test "$enable_shared" = "yes" && with_sharedlibs="yes")
398 AC_MSG_RESULT($with_sharedlibs)
399 AM_CONDITIONAL([with_sharedlibs], [test x$with_sharedlibs = xyes])
401 # -------------------------------
402 # Test for creating JP3D
403 # -------------------------------
406 AC_MSG_CHECKING(whether to build the JP3D library)
408 [ --enable-jp3d[=[yes|no]] Build jp3d libs [ [default=no] ]],
409 test "$enable_jp3d" = "yes" && with_jp3d="yes")
411 AC_MSG_RESULT($with_jp3d)
412 if test "$with_jp3d" = "yes" ; then
419 AC_CHECK_PROG(with_doxygen, doxygen, [yes],[no],,)
421 if test "$with_doxygen" = "yes" ; then
426 AC_CONFIG_FILES([Makefile])
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 "jpwl support : $with_libjpwl"
451 echo "--enable-jp3d : $with_jp3d"
452 echo "----------------------------------------------"