[trunk] Backport toplevel files from 1.5
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 2 Mar 2012 09:26:15 +0000 (09:26 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 2 Mar 2012 09:26:15 +0000 (09:26 +0000)
CMake/CTestCustom.cmake.in
LICENSE
Makefile.am
NEWS
README
configure.ac
libopenjpeg1.pc.cmake
libopenjpeg1.pc.in
opj_config.h.cmake.in

index b3c4931e3f03f4825ebba208fee0889f4a02caef..487f8b99523ff7c1a75028f419b73395756fecd7 100644 (file)
@@ -29,4 +29,6 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
   ".*warning,.* is deprecated"
   # supress warnings caused by 3rd party libs:
   ".*/thirdparty/.*"
+  "libtiff.*has no symbols"
+  "libpng.*has no symbols"
   )
diff --git a/LICENSE b/LICENSE
index 48469dff45e2f8b5a4b743e6d6850ad558b7c12f..f7b3b66286d9293fafdd23d28496384058841a36 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- * Copyright (c) 2002-2011, Professor Benoit Macq
- * Copyright (c) 2003-2011, Antonin Descampe
+ * Copyright (c) 2002-2012, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2012, Professor Benoit Macq
+ * Copyright (c) 2003-2012, Antonin Descampe
  * Copyright (c) 2003-2009, Francois-Olivier Devaux
  * Copyright (c) 2005, Herve Drolon, FreeImage Team
  * Copyright (c) 2002-2003, Yannick Verschueren
@@ -28,4 +28,4 @@
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
- */
\ No newline at end of file
+ */
index 7e5dc5c82522404fab5324390a1ef4d3f478c0fe..6ed452f52b761659e6a5ee486150a5a35742df70 100644 (file)
@@ -1,4 +1,4 @@
-DISTCHECK_CONFIGURE_FLAGS = --enable-jpip=yes --enable-jpwl=yes --enable-mj2=yes
+DISTCHECK_CONFIGURE_FLAGS = --enable-jpip=yes --enable-jpip-server=yes --enable-jpwl=yes --enable-mj2=yes
 
 ACLOCAL_AMFLAGS = -I m4
 
@@ -12,7 +12,6 @@ pkgconfig_DATA += libopenjpeg-jpwl.pc
 endif
 
 
-
 MAINTAINERCLEANFILES = \
 Makefile.in \
 aclocal.m4 \
@@ -66,6 +65,9 @@ else
 endif
        @echo -e " (PC)\t$(pkgconfigdir)/libopenjpeg1.pc" >> $(top_builddir)/report.txt
        @echo -e " (LN)\t$(pkgconfigdir)/libopenjpeg.pc" >> $(top_builddir)/report.txt
+if WANT_JPWL
+       @echo -e " (PC)\t$(pkgconfigdir)/libopenjpeg-jpwl.pc" >> $(top_builddir)/report.txt
+endif
        @cat $(top_builddir)/report.txt
        @rm $(top_builddir)/report.txt
 
diff --git a/NEWS b/NEWS
index e774c75b612eae60fb023c4ef82d56f5a54b73ab..462ff2db35e71a7241801af18b5bfb5e2908ea37 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -30,4 +30,5 @@ Misc:
      - results are submitted to the OpenJPEG dashboard (http://my.cdash.org/index.php?project=OPENJPEG)
      - images are located in 'http://openjpeg.googlecode.com/svn/data' folder.
      - configuration files and utilities are located in 'tests' folder.
-    * Many bug fixes. See CHANGES for details.
\ No newline at end of file
+    * OPJViewer re-activated (need wxWidgets)
+    * Huge amount of bug fixes. See CHANGES for details.
diff --git a/README b/README
index 05a280c29ebe64301cecd48bc6066b4f2e8346b5..018ba2dadedd784299c7b2f7df1057503b36e2c9 100644 (file)
--- a/README
+++ b/README
@@ -13,7 +13,7 @@ Details on folders hierarchy:
     * JavaOpenJPEG: java jni to use openjpeg in a java program
     * jpip: complete client-server architecture for remote browsing of jpeg 2000 images. See corresponding README for more details.
     * OPJViewer: gui for displaying j2k files (based on wxWidget)
-* thirdparty: thirdparty libraries used by some applications. These libraries will be build only if there are not found on the system. Note that libopenjpeg itself does not have any dependency.
+* thirdparty: thirdparty libraries used by some applications. These libraries will be built only if there are not found on the system. Note that libopenjpeg itself does not have any dependency.
 * doc: doxygen documentation setup file and man pages
 * tests: configuration files and utilities for the openjpeg test suite. All test images are located in 'http://openjpeg.googlecode.com/svn/data' folder.
 * CMake: cmake related files
@@ -22,4 +22,4 @@ Details on folders hierarchy:
 see LICENSE for license and copyright information.
 see INSTALL for installation procedures.
 see NEWS for user visible changes in successive releases.
-see CHANGES for per-revision changes.
\ No newline at end of file
+see CHANGES for per-revision changes.
index 142e31f8d77f70728fef4eeb6ec4285135ef468d..283123e3e35a97d2ec6e0669aa7139051affd588 100644 (file)
@@ -26,21 +26,21 @@ 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 dist-xz dist-zip])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 MAJOR_NR=OPJ_MAJOR
 MINOR_NR=OPJ_MINOR
 MICRO_NR=OPJ_MICRO
-AC_SUBST(MAJOR_NR)
-AC_SUBST(MINOR_NR)
-AC_SUBST(MICRO_NR)
+AC_SUBST([MAJOR_NR])
+AC_SUBST([MINOR_NR])
+AC_SUBST([MICRO_NR])
 
 LT_PREREQ([2.0])
 LT_INIT([win32-dll])
 
 lt_version=lt_cur:lt_rev:lt_age
-AC_SUBST(lt_version)
+AC_SUBST([lt_version])
 
 
 ### Needed information
@@ -60,14 +60,6 @@ AM_CONDITIONAL([HAVE_WIN32], [test "x${have_win32}" = "xyes"])
 AM_CONDITIONAL([HAVE_DARWIN], [test "x${have_darwin}" = "xyes"])
 
 
-# Define the necessary macros to make off_t a 64 bits type
-AC_SYS_LARGEFILE
-
-# If the `fseeko' function is available, define `HAVE_FSEEKO'. Define
-# `_LARGEFILE_SOURCE' if necessary.
-AC_FUNC_FSEEKO
-
-
 ### Additional options to configure
 
 # debug
@@ -142,6 +134,20 @@ AC_ARG_ENABLE([jpip],
 AC_MSG_CHECKING([whether to build the JPIP library])
 AC_MSG_RESULT([${want_jpip}])
 
+AC_ARG_ENABLE([jpip-server],
+   [AC_HELP_STRING([--enable-jpip-server], [build jpip server @<:@default=disabled@:>@])],
+   [
+    if test "x${enableval}" = "xyes" ; then
+       want_jpip_server="yes"
+    else
+       want_jpip_server="no"
+    fi
+   ],
+   [want_jpip_server="no"])
+
+AC_MSG_CHECKING([whether to build the JPIP server])
+AC_MSG_RESULT([${want_jpip_server}])
+
 
 ### Checks for programs
 
@@ -157,8 +163,8 @@ if $PKG_CONFIG --atleast-pkgconfig-version 0.22 ; then
 else
    pkgconfig_requires_private="Requires"
 fi
-AC_SUBST(pkgconfig_requires_private)
-AC_SUBST(requirements)
+AC_SUBST([pkgconfig_requires_private])
+AC_SUBST([requirements])
 
 # doxygen
 
@@ -191,16 +197,16 @@ AC_MSG_RESULT([${want_png}])
 
 if test "x${want_png}" = "xyes" ; then
 
-   PKG_CHECK_MODULES([PNG], [libpng15],
+   PKG_CHECK_MODULES([PNG], [libpng15 zlib],
       [have_libpng="yes"],
       [
-       PKG_CHECK_MODULES([PNG], [libpng14],
+       PKG_CHECK_MODULES([PNG], [libpng14 zlib],
           [have_libpng="yes"],
           [
-           PKG_CHECK_MODULES([PNG], [libpng12],
+           PKG_CHECK_MODULES([PNG], [libpng12 zlib],
               [have_libpng="yes"],
               [
-               PKG_CHECK_MODULES([PNG], [libpng],
+               PKG_CHECK_MODULES([PNG], [libpng zlib],
                   [have_libpng="yes"],
                   [have_libpng="no"])
               ])
@@ -208,11 +214,23 @@ if test "x${want_png}" = "xyes" ; then
       ])
 
    if ! test "x${have_libpng}" = "xyes" ; then
-      OPJ_CHECK_LIB([png.h],
-         [png],
-         [png_create_write_struct],
-         [have_libpng="yes"],
+
+      OPJ_CHECK_LIB([zlib.h],
+         [z],
+         [zlibVersion],
+         [
+          OPJ_CHECK_LIB([png.h],
+             [png],
+             [png_access_version_number],
+             [
+              have_libpng="yes"
+              PNG_CFLAGS="${PNG_CFLAGS} ${Z_CFLAGS}"
+              PNG_LIBS="${PNG_LIBS} ${Z_LIBS}"
+             ],
+             [have_libpng="no"])
+         ],
          [have_libpng="no"])
+
    fi
 
    if test "x${have_libpng}" = "xno" ; then
@@ -340,9 +358,54 @@ if test "x${have_lcms2}" = "xno" ; then
 
 fi
 
+# threads
+
+if test "x${want_jpip_server}" = "xyes" ; then
+
+   if test "x${have_win32}" = "xno" ; then
+
+      SAVE_CFLAGS=${CFLAGS}
+      CFLAGS="${CFLAGS} -pthread"
+      SAVE_LIBS=${LIBS}
+      LIBS="${LIBS} -pthread"
+      AC_LINK_IFELSE(
+         [AC_LANG_PROGRAM([[
+#include <pthread.h>
+                          ]],
+                          [[
+pthread_t id;
+id = pthread_self();
+                          ]])],
+         [have_pthread="yes"],
+         [have_pthread="no"])
+      CFLAGS=${SAVE_CFLAGS}
+      LIBS=${SAVE_LIBS}
+
+      AC_MSG_CHECKING([whether Pthread library is available])
+      AC_MSG_RESULT([${have_pthread}])
+
+      if ! test "x${have_pthread}" = "xyes" ; then
+         AC_MSG_WARN([Pthread library not found. OpenJPIP server will not be compiled.])
+         want_jpip_server="no"
+      else
+         THREAD_CFLAGS="-pthread"
+         THREAD_LIBS="-pthread"
+      fi
+
+   else
+      THREAD_LIBS="-lws2_32"
+   fi
+
+fi
+
+AC_ARG_VAR([THREAD_CFLAGS], [compiler flag for the thread library])
+AC_SUBST([THREAD_CFLAGS])
+AC_ARG_VAR([THREAD_LIBS], [linker flags for thread library])
+AC_SUBST([THREAD_LIBS])
+
 # libfcgi
 
-if test "x${want_jpip}" = "xyes" ; then
+if test "x${want_jpip_server}" = "xyes" ; then
 
    have_fcgi="no"
    OPJ_CHECK_LIB(
@@ -353,8 +416,23 @@ if test "x${want_jpip}" = "xyes" ; then
       [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"
+      AC_MSG_WARN([FastCGI library not found. OpenJPIP server will not be compiled.])
+      want_jpip_server="no"
+   fi
+
+fi
+
+# libcurl
+
+if test "x${want_jpip_server}" = "xyes" ; then
+
+   PKG_CHECK_MODULES([LIBCURL], [libcurl],
+      [have_libcurl="yes"],
+      [have_libcurl="no"])
+
+   if ! test "x${have_libcurl}" = "xyes" ; then
+      AC_MSG_WARN([libcurl library not found. OpenJPIP server will not be compiled.])
+      want_jpip_server="no"
    fi
 
 fi
@@ -365,6 +443,14 @@ fi
 
 AM_CONDITIONAL([WANT_JPIP], [test "x${want_jpip}" = "xyes"])
 
+if test "x${want_jpip_server}" = "xyes" ; then
+   AC_DEFINE(USE_JPIP_SERVER, [1], [define to 1 if you use jpip server])
+fi
+
+AM_CONDITIONAL([WANT_JPIP_SERVER], [test "x${want_jpip_server}" = "xyes"])
+
+AM_CONDITIONAL([WANT_JPIP_CODE], [test "x${want_jpip}" = "xyes" || test "x${want_jpip_server}" = "xyes"])
+
 ### Checks for header files
 
 ## FIXME: declarations must be fixed in source code. See autoconf manual
@@ -450,4 +536,5 @@ echo
 echo "  mj2.................: ${want_mj2}"
 echo "  jpwl................: ${want_jpwl}"
 echo "  jpip................: ${want_jpip}"
+echo "  jpip server.........: ${want_jpip_server}"
 echo
index 9da820b55b1e92fa8df2df06e930b55e2ca6505c..962d8b212c30a20fdd030c85542444929aea60be 100644 (file)
@@ -1,8 +1,8 @@
 prefix=@CMAKE_INSTALL_PREFIX@
-bindir=@OPENJPEG_INSTALL_BIN_DIR@
-datadir=@OPENJPEG_INSTALL_DATA_DIR@
-libdir=@OPENJPEG_INSTALL_LIB_DIR@
-includedir=@OPENJPEG_INSTALL_INCLUDE_DIR@
+bindir=${prefix}/@OPENJPEG_INSTALL_BIN_DIR@
+datadir=${prefix}/@OPENJPEG_INSTALL_DATA_DIR@
+libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@
+includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@
 
 Name: openjpeg
 Description: JPEG2000 files library
index 2951608f7f67b99d5a1a32b24eefec5005fbaf0e..a8205fc833d487cd30cc4d15c26b37473c4ad44c 100644 (file)
@@ -1,12 +1,13 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
-includedir=@includedir@
+includedir=@includedir@/openjpeg-@MAJOR_NR@.@MINOR_NR@
 
 Name: openjpeg
-Description: JPEG2000 files library
+Description: JPEG2000 library
 URL: http://www.openjpeg.org/
 Version: @VERSION@
-pkgconfig_requires_private: @requirements@
+@pkgconfig_requires_private@: @requirements@
 Libs: -L${libdir} -lopenjpeg
+Libs.private: -lm
 Cflags: -I${includedir}
index 9cb485f107217ef18961adcdc410c7f850e17478..e64b5e8f3a5f422502368f06b26c986c4e9f0d61 100644 (file)
@@ -9,9 +9,9 @@
 #cmakedefine HAVE_STRING_H
 #cmakedefine HAVE_SYS_STAT_H
 #cmakedefine HAVE_SYS_TYPES_H
-#cmakedefine HAVE_UNISTD_H 
-#cmakedefine HAVE_LIBPNG 
-#cmakedefine HAVE_PNG_H 
+#cmakedefine HAVE_UNISTD_H
+#cmakedefine HAVE_LIBPNG
+#cmakedefine HAVE_PNG_H
 #cmakedefine HAVE_LIBTIFF
 #cmakedefine HAVE_TIFF_H