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], [5])
10 m4_define([OPJ_MICRO], [2])
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 dist-xz dist-zip])
30 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
42 lt_version=lt_cur:lt_rev:lt_age
43 AC_SUBST([lt_version])
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 AM_CONDITIONAL([WANT_JPWL], [test "x${want_jpwl}" = "xyes"])
123 AC_ARG_ENABLE([jpip],
124 [AC_HELP_STRING([--enable-jpip], [build jpip library @<:@default=disabled@:>@])],
126 if test "x${enableval}" = "xyes" ; then
134 AC_MSG_CHECKING([whether to build the JPIP library])
135 AC_MSG_RESULT([${want_jpip}])
137 AC_ARG_ENABLE([jpip-server],
138 [AC_HELP_STRING([--enable-jpip-server], [build jpip server @<:@default=disabled@:>@])],
140 if test "x${enableval}" = "xyes" ; then
141 want_jpip_server="yes"
143 want_jpip_server="no"
146 [want_jpip_server="no"])
148 AC_MSG_CHECKING([whether to build the JPIP server])
149 AC_MSG_RESULT([${want_jpip_server}])
152 ### Checks for programs
160 # Check whether pkg-config supports Requires.private
161 if $PKG_CONFIG --atleast-pkgconfig-version 0.22 ; then
162 pkgconfig_requires_private="Requires.private"
164 pkgconfig_requires_private="Requires"
166 AC_SUBST([pkgconfig_requires_private])
167 AC_SUBST([requirements])
178 ### Checks for libraries
185 [AC_HELP_STRING([--disable-png], [disable PNG support @<:@default=enabled@:>@])],
187 if test "x${enableval}" = "xyes" ; then
195 AC_MSG_CHECKING([whether to build with PNG support])
196 AC_MSG_RESULT([${want_png}])
198 if test "x${want_png}" = "xyes" ; then
200 PKG_CHECK_MODULES([PNG], [libpng15 zlib],
203 PKG_CHECK_MODULES([PNG], [libpng14 zlib],
206 PKG_CHECK_MODULES([PNG], [libpng12 zlib],
209 PKG_CHECK_MODULES([PNG], [libpng zlib],
216 if ! test "x${have_libpng}" = "xyes" ; then
218 OPJ_CHECK_LIB([zlib.h],
222 OPJ_CHECK_LIB([png.h],
224 [png_access_version_number],
227 PNG_CFLAGS="${PNG_CFLAGS} ${Z_CFLAGS}"
228 PNG_LIBS="${PNG_LIBS} ${Z_LIBS}"
236 if test "x${have_libpng}" = "xno" ; then
237 AC_MSG_WARN([Can not find a usuable PNG library. Make sure that CPPFLAGS and LDFLAGS are correctly set.])
242 AC_MSG_CHECKING([whether PNG is available])
243 AC_MSG_RESULT([${have_libpng}])
245 if test "x${have_libpng}" = "xyes" ; then
246 AC_DEFINE(HAVE_LIBPNG, [1], [define to 1 if you have libpng])
249 AM_CONDITIONAL([with_libpng], [test x${have_libpng} = "xyes"])
255 AC_ARG_ENABLE([tiff],
256 [AC_HELP_STRING([--disable-tiff], [disable TIFF support @<:@default=enabled@:>@])],
258 if test "x${enableval}" = "xyes" ; then
266 AC_MSG_CHECKING([whether to build with TIFF support])
267 AC_MSG_RESULT([${want_tiff}])
269 if test "x${want_tiff}" = "xyes" ; then
275 [have_libtiff="yes"],
278 if test "x${have_libtiff}" = "xno" ; then
279 AC_MSG_WARN([Can not find a usuable TIFF library. Make sure that CPPFLAGS and LDFLAGS are correctly set.])
283 AC_MSG_CHECKING([whether TIFF is available])
284 AC_MSG_RESULT([${have_libtiff}])
286 if test "x${have_libtiff}" = "xyes" ; then
287 AC_DEFINE(HAVE_LIBTIFF, [1], [define to 1 if you have libtiff])
290 AM_CONDITIONAL([with_libtiff], [test "x${have_libtiff}" = "xyes"])
297 AC_ARG_ENABLE([lcms2],
298 [AC_HELP_STRING([--disable-lcms2], [disable LCMS-2 support @<:@default=enabled@:>@])],
300 if test "x${enableval}" = "xyes" ; then
308 AC_MSG_CHECKING([whether to build with LCMS-2 support])
309 AC_MSG_RESULT([${want_lcms2}])
311 if test "x${want_lcms2}" = "xyes" ; then
312 PKG_CHECK_MODULES([LCMS2], [lcms2],
317 AC_MSG_CHECKING([whether LCMS-2 is available])
318 AC_MSG_RESULT([${have_lcms2}])
320 if test "x${have_lcms2}" = "xyes" ; then
321 AC_DEFINE(HAVE_LIBLCMS2, [1], [define to 1 if you have lcms version 2.x])
322 lcms_output="lcms version 2.x"
327 AC_ARG_ENABLE([lcms1],
328 [AC_HELP_STRING([--disable-lcms1], [disable LCMS-1 support @<:@default=enabled@:>@])],
330 if test "x${enableval}" = "xyes" ; then
338 AC_MSG_CHECKING([whether to build with LCMS-1 support])
339 AC_MSG_RESULT([${want_lcms1}])
341 if test "x${have_lcms2}" = "xno" ; then
343 if test "x${want_lcms1}" = "xyes" ; then
344 PKG_CHECK_MODULES([LCMS1], [lcms1],
346 [PKG_CHECK_MODULES([LCMS1], [lcms],
351 AC_MSG_CHECKING([whether LCMS-1 is available])
352 AC_MSG_RESULT([${have_lcms1}])
354 if test "x${have_lcms1}" = "xyes" ; then
355 AC_DEFINE(HAVE_LIBLCMS1, [1], [define to 1 if you have lcms version 1.x])
356 lcms_output="lcms version 1.x"
363 if test "x${want_jpip_server}" = "xyes" ; then
365 if test "x${have_win32}" = "xno" ; then
367 SAVE_CFLAGS=${CFLAGS}
368 CFLAGS="${CFLAGS} -pthread"
370 LIBS="${LIBS} -pthread"
379 [have_pthread="yes"],
381 CFLAGS=${SAVE_CFLAGS}
384 AC_MSG_CHECKING([whether Pthread library is available])
385 AC_MSG_RESULT([${have_pthread}])
387 if ! test "x${have_pthread}" = "xyes" ; then
388 AC_MSG_WARN([Pthread library not found. OpenJPIP server will not be compiled.])
389 want_jpip_server="no"
391 THREAD_CFLAGS="-pthread"
392 THREAD_LIBS="-pthread"
396 THREAD_LIBS="-lws2_32"
401 AC_ARG_VAR([THREAD_CFLAGS], [compiler flag for the thread library])
402 AC_SUBST([THREAD_CFLAGS])
403 AC_ARG_VAR([THREAD_LIBS], [linker flags for thread library])
404 AC_SUBST([THREAD_LIBS])
408 if test "x${want_jpip_server}" = "xyes" ; then
418 if ! test "x${have_fcgi}" = "xyes" ; then
419 AC_MSG_WARN([FastCGI library not found. OpenJPIP server will not be compiled.])
420 want_jpip_server="no"
427 if test "x${want_jpip_server}" = "xyes" ; then
429 PKG_CHECK_MODULES([LIBCURL], [libcurl],
430 [have_libcurl="yes"],
433 if ! test "x${have_libcurl}" = "xyes" ; then
434 AC_MSG_WARN([libcurl library not found. OpenJPIP server will not be compiled.])
435 want_jpip_server="no"
440 if test "x${want_jpip}" = "xyes" ; then
441 AC_DEFINE(USE_JPIP, [1], [define to 1 if you use jpip])
444 AM_CONDITIONAL([WANT_JPIP], [test "x${want_jpip}" = "xyes"])
446 if test "x${want_jpip_server}" = "xyes" ; then
447 AC_DEFINE(USE_JPIP_SERVER, [1], [define to 1 if you use jpip server])
450 AM_CONDITIONAL([WANT_JPIP_SERVER], [test "x${want_jpip_server}" = "xyes"])
452 AM_CONDITIONAL([WANT_JPIP_CODE], [test "x${want_jpip}" = "xyes" || test "x${want_jpip_server}" = "xyes"])
454 ### Checks for header files
456 ## FIXME: declarations must be fixed in source code. See autoconf manual
463 ### Checks for structures
466 ### Checks for compiler characteristics
471 #OPJ_COMPILER_FLAG([-Wall])
472 #OPJ_COMPILER_FLAG([-Wextra])
473 #OPJ_COMPILER_FLAG([-Wshadow])
474 #OPJ_COMPILER_FLAG([-Wpointer-arith])
475 OPJ_COMPILER_FLAG([-Wno-unused-result])
477 if test "x${want_debug}" = "xyes" ; then
478 OPJ_COMPILER_FLAG([-g])
479 OPJ_COMPILER_FLAG([-O0])
481 OPJ_COMPILER_FLAG([-O3])
485 ### Checks for linker characteristics
488 ### Checks for library functions
491 ### Post configuration
493 AM_CONDITIONAL([BUILD_SHARED], [test "x${enable_shared}" = "xyes"])
494 AM_CONDITIONAL([BUILD_STATIC], [test "x${enable_static}" = "xyes"])
502 libopenjpeg/jpwl/Makefile
503 applications/Makefile
504 applications/codec/Makefile
505 applications/mj2/Makefile
506 applications/jpip/Makefile
507 applications/jpip/libopenjpip/Makefile
508 applications/jpip/util/Makefile
519 echo "------------------------------------------------------------------------"
520 echo "$PACKAGE $VERSION"
521 echo "------------------------------------------------------------------------"
524 echo "Configuration Options Summary:"
526 echo " Debug...............: ${want_debug}"
528 echo " Optional support:"
529 echo " libpng............: ${have_libpng}"
530 echo " libtiff...........: ${have_libtiff}"
531 echo " libcms............: ${lcms_output}"
533 echo " Documentation.......: ${opj_have_doxygen}"
534 echo " Build.............: make doc"
536 echo " mj2.................: ${want_mj2}"
537 echo " jpwl................: ${want_jpwl}"
538 echo " jpip................: ${want_jpip}"
539 echo " jpip server.........: ${want_jpip_server}"