2 # According to http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info :
4 # 1) when bugs are fixed or internal code is changed: increase MICRO
5 # 2) if API is added, increase MINOR and set MICRO to 0
6 # 3) if API or ABI is broken (this case should (must) never happen as it's very bad for a library), or a new designed library, increase MAJOR and set MINOR and MICRO to 0
8 m4_define([OPJ_MAJOR], [1])
9 m4_define([OPJ_MINOR], [4])
10 m4_define([OPJ_MICRO], [0])
12 m4_define([lt_cur], m4_eval(OPJ_MAJOR + OPJ_MINOR))
13 m4_define([lt_rev], OPJ_MICRO)
14 m4_define([lt_age], OPJ_MINOR)
18 [OPJ_MAJOR.OPJ_MINOR.OPJ_MICRO],
19 [openjpeg@googlegroups.com],
21 [http://www.openjpeg.org])
22 AC_CONFIG_SRCDIR([configure.ac])
23 AC_CONFIG_MACRO_DIR([m4])
24 AC_CONFIG_HEADERS([opj_config.h])
29 AM_INIT_AUTOMAKE(1[.11 foreign dist-bzip2])
30 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
42 lt_version=lt_cur:lt_rev:lt_age
46 ### Needed information
59 AM_CONDITIONAL([HAVE_WIN32], [test "x${have_win32}" = "xyes"])
60 AM_CONDITIONAL([HAVE_DARWIN], [test "x${have_darwin}" = "xyes"])
63 ### Additional options to configure
67 AC_ARG_ENABLE([debug],
68 [AC_HELP_STRING([--enable-debug], [build with debug symbols @<:@default=disabled@:>@])],
70 if test "x${enableval}" = "xyes" ; then
78 AC_MSG_CHECKING([whether to build in debug mode])
79 AC_MSG_RESULT([${want_debug}])
84 [AC_HELP_STRING([--enable-mj2], [build mj2 binaries @<:@default=disabled@:>@])],
86 if test "x${enableval}" = "xyes" ; then
94 AC_MSG_CHECKING([whether to build the MJ2 binaries])
95 AC_MSG_RESULT([${want_mj2}])
97 if test "x${want_mj2}" = "xyes" ; then
98 AC_DEFINE(USE_MJ2, [1], [define to 1 if you use mj2])
101 AM_CONDITIONAL([WANT_MJ2], [test "x${want_mj2}" = "xyes"])
105 AC_ARG_ENABLE([jpwl],
106 [AC_HELP_STRING([--enable-jpwl], [build JPWL library @<:@default=disabled@:>@])],
108 if test "x${enableval}" = "xyes" ; then
116 AC_MSG_CHECKING([whether to build the JPWL library])
117 AC_MSG_RESULT([${want_jpwl}])
119 if test "x${want_jpwl}" = "xyes" ; then
120 AC_DEFINE(USE_JPWL, [1], [define to 1 if you use jpwl])
123 AM_CONDITIONAL([WANT_JPWL], [test "x${want_jpwl}" = "xyes"])
127 AC_ARG_ENABLE([jpip],
128 [AC_HELP_STRING([--enable-jpip], [build jpip library @<:@default=disabled@:>@])],
130 if test "x${enableval}" = "xyes" ; then
138 AC_MSG_CHECKING([whether to build the JPIP library])
139 AC_MSG_RESULT([${want_jpip}])
142 ### Checks for programs
150 # Check whether pkg-config supports Requires.private
151 if $PKG_CONFIG --atleast-pkgconfig-version 0.22 ; then
152 pkgconfig_requires_private="Requires.private"
154 pkgconfig_requires_private="Requires"
156 AC_SUBST(pkgconfig_requires_private)
157 AC_SUBST(requirements)
168 ### Checks for libraries
175 [AC_HELP_STRING([--disable-png], [disable PNG support @<:@default=enabled@:>@])],
177 if test "x${enableval}" = "xyes" ; then
185 AC_MSG_CHECKING([whether to build with PNG support])
186 AC_MSG_RESULT([${want_png}])
188 if test "x${want_png}" = "xyes" ; then
190 PKG_CHECK_MODULES([PNG], [libpng14],
193 PKG_CHECK_MODULES([PNG], [libpng12],
196 PKG_CHECK_MODULES([PNG], [libpng10],
199 PKG_CHECK_MODULES([PNG], [libpng],
206 if ! test "x${have_libpng}" = "xyes" ; then
207 OPJ_CHECK_LIB([png.h],
209 [png_create_write_struct],
214 if test "x${have_libpng}" = "xno" ; then
215 AC_MSG_WARN([Can not find a usuable PNG library. Make sure that CPPFLAGS and LDFLAGS are correctly set.])
220 AC_MSG_CHECKING([whether PNG is available])
221 AC_MSG_RESULT([${have_libpng}])
223 if test "x${have_libpng}" = "xyes" ; then
224 AC_DEFINE(HAVE_LIBPNG, [1], [define to 1 if you have libpng])
227 AM_CONDITIONAL([with_libpng], [test x${have_libpng} = "xyes"])
233 AC_ARG_ENABLE([tiff],
234 [AC_HELP_STRING([--disable-tiff], [disable TIFF support @<:@default=enabled@:>@])],
236 if test "x${enableval}" = "xyes" ; then
244 AC_MSG_CHECKING([whether to build with TIFF support])
245 AC_MSG_RESULT([${want_tiff}])
247 if test "x${want_tiff}" = "xyes" ; then
253 [have_libtiff="yes"],
256 if test "x${have_libtiff}" = "xno" ; then
257 AC_MSG_WARN([Can not find a usuable TIFF library. Make sure that CPPFLAGS and LDFLAGS are correctly set.])
261 AC_MSG_CHECKING([whether TIFF is available])
262 AC_MSG_RESULT([${have_libtiff}])
264 if test "x${have_libtiff}" = "xyes" ; then
265 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
268 AM_CONDITIONAL([with_libtiff], [test "x${have_libtiff}" = "xyes"])
275 AC_ARG_ENABLE([lcms2],
276 [AC_HELP_STRING([--disable-lcms2], [disable LCMS-2 support @<:@default=enabled@:>@])],
278 if test "x${enableval}" = "xyes" ; then
286 AC_MSG_CHECKING([whether to build with LCMS-2 support])
287 AC_MSG_RESULT([${want_lcms2}])
289 if test "x${want_lcms2}" = "xyes" ; then
290 PKG_CHECK_MODULES([LCMS2], [lcms2],
298 AC_MSG_CHECKING([whether LCMS-2 is available])
299 AC_MSG_RESULT([${have_lcms2}])
301 if test "x${have_lcms2}" = "xyes" ; then
302 AC_DEFINE(HAVE_LIBLCMS2, [1], [define to 1 if you have lcms version 2.x])
303 lcms_output="lcms version 2.x"
308 AC_ARG_ENABLE([lcms1],
309 [AC_HELP_STRING([--disable-lcms1], [disable LCMS-1 support @<:@default=enabled@:>@])],
311 if test "x${enableval}" = "xyes" ; then
319 AC_MSG_CHECKING([whether to build with LCMS-1 support])
320 AC_MSG_RESULT([${want_lcms1}])
322 if test "x${have_lcms2}" = "xno" ; then
324 if test "x${want_lcms1}" = "xyes" ; then
325 PKG_CHECK_MODULES([LCMS1], [lcms1],
330 [PKG_CHECK_MODULES([LCMS1], [lcms],
338 AC_MSG_CHECKING([whether LCMS-1 is available])
339 AC_MSG_RESULT([${have_lcms1}])
341 if test "x${have_lcms1}" = "xyes" ; then
342 AC_DEFINE(HAVE_LIBLCMS1, [1], [define to 1 if you have lcms version 1.x])
343 lcms_output="lcms version 1.x"
350 if test "x${want_jpip}" = "xyes" ; then
360 if ! test "x${have_fcgi}" = "xyes" ; then
361 AC_MSG_WARN([FastCGI library not found. OpenJPIP will not be compiled.])
367 if test "x${want_jpip}" = "xyes" ; then
368 AC_DEFINE(USE_JPIP, [1], [define to 1 if you use jpip])
371 AM_CONDITIONAL([WANT_JPIP], [test "x${want_jpip}" = "xyes"])
373 ### Checks for header files
375 ## FIXME: declarations must be fixed in source code. See autoconf manual
382 ### Checks for structures
385 ### Checks for compiler characteristics
390 #OPJ_COMPILER_FLAG([-Wall])
391 #OPJ_COMPILER_FLAG([-Wextra])
392 #OPJ_COMPILER_FLAG([-Wshadow])
393 #OPJ_COMPILER_FLAG([-Wpointer-arith])
394 OPJ_COMPILER_FLAG([-Wno-unused-result])
396 if test "x${want_debug}" = "xyes" ; then
397 OPJ_COMPILER_FLAG([-g])
398 OPJ_COMPILER_FLAG([-O0])
400 OPJ_COMPILER_FLAG([-O3])
404 ### Checks for linker characteristics
407 ### Checks for library functions
413 libopenjpeg/jpwl/Makefile
414 applications/Makefile
415 applications/codec/Makefile
416 applications/mj2/Makefile
417 applications/jpip/Makefile
418 applications/jpip/libopenjpip/Makefile
419 applications/jpip/opj_server/Makefile
420 applications/jpip/opj_client/Makefile
421 applications/jpip/opj_client/opj_dec_server/Makefile
422 applications/jpip/tools/Makefile
423 applications/jpip/tools/indexer/Makefile
434 echo "------------------------------------------------------------------------"
435 echo "$PACKAGE $VERSION"
436 echo "------------------------------------------------------------------------"
439 echo "Configuration Options Summary:"
441 echo " Debug...............: ${want_debug}"
443 echo " Optional support:"
444 echo " libpng............: ${have_libpng}"
445 echo " libtiff...........: ${have_libtiff}"
446 echo " libcms............: ${lcms_output}"
448 echo " Documentation.......: ${opj_have_doxygen}"
449 echo " Build.............: make doc"
451 echo " mj2.................: ${want_mj2}"
452 echo " jpwl................: ${want_jpwl}"
453 echo " jpip................: ${want_jpip}"