TRUNK: fixed autotools for new indexer option
[openjpeg.git] / configure.ac
index 23aa6827f55ed2a9c4ed33730bf6f83dd194719f..60223ee6dd3c86b3466e551880d32f30f4acf81a 100644 (file)
@@ -1,14 +1,16 @@
 
+# According to http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info :
+#
+# 1) when bugs are fixed or internal code is changed: increase MICRO
+# 2) if API is added, increase MINOR and set MICRO to 0
+# 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
+
 m4_define([OPJ_MAJOR], [1])
 m4_define([OPJ_MINOR], [4])
 m4_define([OPJ_MICRO], [0])
 
-m4_define([JP3D_MAJOR], [1])
-m4_define([JP3D_MINOR], [3])
-m4_define([JP3D_MICRO], [0])
-
-m4_define([lt_rev], m4_eval(OPJ_MAJOR + OPJ_MINOR))
-m4_define([lt_cur], OPJ_MICRO)
+m4_define([lt_cur], m4_eval(OPJ_MAJOR + OPJ_MINOR))
+m4_define([lt_rev], OPJ_MICRO)
 m4_define([lt_age], OPJ_MINOR)
 
 AC_PREREQ([2.62])
@@ -24,7 +26,7 @@ AC_CONFIG_HEADERS([opj_config.h])
 AC_CANONICAL_SYSTEM
 AC_CANONICAL_HOST
 
-AM_INIT_AUTOMAKE(1.11 foreign dist-bzip2)
+AM_INIT_AUTOMAKE([1.11 foreign dist-bzip2])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 MAJOR_NR=OPJ_MAJOR
@@ -34,17 +36,10 @@ AC_SUBST(MAJOR_NR)
 AC_SUBST(MINOR_NR)
 AC_SUBST(MICRO_NR)
 
-JP3D_MAJOR_NR=JP3D_MAJOR
-JP3D_MINOR_NR=JP3D_MINOR
-JP3D_MICRO_NR=JP3D_MICRO
-AC_SUBST(JP3D_MAJOR_NR)
-AC_SUBST(JP3D_MINOR_NR)
-AC_SUBST(JP3D_MICRO_NR)
-
 LT_PREREQ([2.0])
 LT_INIT([win32-dll])
 
-lt_version=lt_rev:lt_cur:lt_age
+lt_version=lt_cur:lt_rev:lt_age
 AC_SUBST(lt_version)
 
 
@@ -127,27 +122,21 @@ fi
 
 AM_CONDITIONAL([WANT_JPWL], [test "x${want_jpwl}" = "xyes"])
 
-# JP3D
+# JPIP
 
-AC_ARG_ENABLE([jp3d],
-   [AC_HELP_STRING([--enable-jp3d], [build jp3d library @<:@default=disabled@:>@])],
+AC_ARG_ENABLE([jpip],
+   [AC_HELP_STRING([--enable-jpip], [build jpip library @<:@default=disabled@:>@])],
    [
     if test "x${enableval}" = "xyes" ; then
-       want_jp3d="yes"
+       want_jpip="yes"
     else
-       want_jp3d="no"
+       want_jpip="no"
     fi
    ],
-   [want_jp3d="no"])
+   [want_jpip="no"])
 
-AC_MSG_CHECKING([whether to build the JP3D library])
-AC_MSG_RESULT([${want_jp3d}])
-
-if test "x${want_jp3d}" = "xyes" ; then
-   AC_DEFINE(USE_JP3D, [1], [define to 1 if you use jp3d])
-fi
-
-AM_CONDITIONAL([WANT_JP3D], [test "x${want_jp3d}" = "xyes"])
+AC_MSG_CHECKING([whether to build the JPIP library])
+AC_MSG_RESULT([${want_jpip}])
 
 
 ### Checks for programs
@@ -165,6 +154,7 @@ else
    pkgconfig_requires_private="Requires"
 fi
 AC_SUBST(pkgconfig_requires_private)
+AC_SUBST(requirements)
 
 # doxygen
 
@@ -179,6 +169,8 @@ AC_PROG_LN_S
 
 # libpng
 
+have_libpng="no"
+
 AC_ARG_ENABLE([png],
    [AC_HELP_STRING([--disable-png], [disable PNG support @<:@default=enabled@:>@])],
    [
@@ -212,26 +204,7 @@ if test "x${want_png}" = "xyes" ; then
       ])
 
    if ! test "x${have_libpng}" = "xyes" ; then
-      OPJ_CHECK_LIB([/usr],
-         [png.h],
-         [png],
-         [png_create_write_struct],
-         [have_libpng="yes"],
-         [have_libpng="no"])
-   fi
-
-   if ! test "x${have_libpng}" = "xyes" ; then
-      OPJ_CHECK_LIB([/usr/local],
-         [png.h],
-         [png],
-         [png_create_write_struct],
-         [have_libpng="yes"],
-         [have_libpng="no"])
-   fi
-
-   if ! test "x${have_libpng}" = "xyes" ; then
-      OPJ_CHECK_LIB([/opt],
-         [png.h],
+      OPJ_CHECK_LIB([png.h],
          [png],
          [png_create_write_struct],
          [have_libpng="yes"],
@@ -253,7 +226,9 @@ fi
 
 AM_CONDITIONAL([with_libpng], [test x${have_libpng} = "xyes"])
 
-#libtiff
+# libtiff
+
+have_libtiff="no"
 
 AC_ARG_ENABLE([tiff],
    [AC_HELP_STRING([--disable-tiff], [disable TIFF support @<:@default=enabled@:>@])],
@@ -271,31 +246,13 @@ AC_MSG_RESULT([${want_tiff}])
 
 if test "x${want_tiff}" = "xyes" ; then
 
-   OPJ_CHECK_LIB([/usr],
+   OPJ_CHECK_LIB(
       [tiff.h],
       [tiff],
       [TIFFOpen],
       [have_libtiff="yes"],
       [have_libtiff="no"])
 
-   if ! test "x${have_libtiff}" = "xyes" ; then
-      OPJ_CHECK_LIB([/usr/local],
-         [tiff.h],
-         [tiff],
-         [TIFFOpen],
-         [have_libtiff="yes"],
-         [have_libtiff="no"])
-   fi
-
-   if ! test "x${have_libtiff}" = "xyes" ; then
-      OPJ_CHECK_LIB([/opt],
-         [tiff.h],
-         [tiff],
-         [TIFFOpen],
-         [have_libtiff="yes"],
-         [have_libtiff="no"])
-   fi
-
    if test "x${have_libtiff}" = "xno" ; then
       AC_MSG_WARN([Can not find a usuable TIFF library. Make sure that CPPFLAGS and LDFLAGS are correctly set.])
    fi
@@ -310,14 +267,10 @@ fi
 
 AM_CONDITIONAL([with_libtiff], [test "x${have_libtiff}" = "xyes"])
 
-AC_ARG_VAR([TIFF_CFLAGS], [preprocessor flags for libtiff])
-AC_SUBST(TIFF_CFLAGS)
-AC_ARG_VAR([TIFF_LIBS], [linker flags for libtiff])
-AC_SUBST(TIFF_LIBS)
-
 # libcms2
 
 lcms_output="no"
+have_lcms2="no"
 
 AC_ARG_ENABLE([lcms2],
    [AC_HELP_STRING([--disable-lcms2], [disable LCMS-2 support @<:@default=enabled@:>@])],
@@ -392,7 +345,30 @@ if test "x${have_lcms2}" = "xno" ; then
 
 fi
 
+# libfcgi
+
+if test "x${want_jpip}" = "xyes" ; then
+
+   have_fcgi="no"
+   OPJ_CHECK_LIB(
+      [fcgi_stdio.h],
+      [fcgi],
+      [FCGI_Accept],
+      [have_fcgi="yes"],
+      [have_fcgi="no"])
+
+   if ! test "x${have_fcgi}" = "xyes" ; then
+      AC_MSG_WARN([FastCGI library not found. OpenJPIP will not be compiled.])
+      want_jpip="no"
+   fi
+
+fi
+
+if test "x${want_jpip}" = "xyes" ; then
+   AC_DEFINE(USE_JPIP, [1], [define to 1 if you use jpip])
+fi
 
+AM_CONDITIONAL([WANT_JPIP], [test "x${want_jpip}" = "xyes"])
 
 ### Checks for header files
 
@@ -408,6 +384,7 @@ AC_HEADER_DIRENT
 
 ### Checks for compiler characteristics
 
+AM_PROG_CC_C_O
 AC_C_BIGENDIAN
 
 #OPJ_COMPILER_FLAG([-Wall])
@@ -433,13 +410,18 @@ AC_CONFIG_FILES([
 Makefile
 libopenjpeg1.pc
 libopenjpeg/Makefile
-jpwl/Makefile
-codec/Makefile
-mj2/Makefile
+libopenjpeg/jpwl/Makefile
+applications/Makefile
+applications/codec/Makefile
+applications/mj2/Makefile
+applications/jpip/Makefile
+applications/jpip/libopenjpip/Makefile
+applications/jpip/opj_server/Makefile
+applications/jpip/opj_client/Makefile
+applications/jpip/opj_client/opj_dec_server/Makefile
+applications/jpip/tools/Makefile
+applications/jpip/tools/indexer/Makefile
 doc/Makefile
-jp3d/Makefile
-jp3d/libjp3dvm/Makefile
-jp3d/codec/Makefile
 ])
 
 AC_OUTPUT
@@ -468,5 +450,5 @@ echo "    Build.............: make doc"
 echo
 echo "  mj2.................: ${want_mj2}"
 echo "  jpwl................: ${want_jpwl}"
-echo "  jp3d................: ${want_jp3d}"
+echo "  jpip................: ${want_jpip}"
 echo