Fix jp3dvm version
[openjpeg.git] / configure.ac
index 55ab6498f010d91e5dfe35397677bd7bbd440ee9..51e91f4fcfb1f7ed18e3632deee1fdfd6cc74511 100644 (file)
@@ -38,7 +38,6 @@ AC_SUBST(JP3D_BUILD_NR)
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_CXX
-AC_PROG_RANLIB
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_SED
@@ -128,6 +127,10 @@ if test "x$with_libpng" = xyes ; then
   else
     if test -n "$LIBPNG_CONFIG" ; then
      pnglibs="`$LIBPNG_CONFIG --ldflags` -lz $LIB_MATH"
+    else
+      if test -n "$PKGCONFIG" ; then
+        pnglibs="`$PKGCONFIG --libs libpng` $LIB_MATH"
+      fi
     fi
   fi
   if test -n "$pnglibs" ; then
@@ -191,7 +194,7 @@ if test "x$with_libtiff" = xyes ; then
   LIBS="$tifflibs"
   with_libtiff="no"
 #
-  AC_CHECK_FUNC(TIFFOpen, true, tifflibs="")
+  AC_CHECK_LIB(tiff, TIFFOpen, , tifflibs="",)
 #
   if test -n "$tifflibs" ; then
    if test "$tiff_header_found" = "yes" ; then
@@ -268,7 +271,7 @@ if test "x$with_liblcms2" = xyes ; then
   LIBS="$lcms2libs"
   with_liblcms2="no"
 #
-  AC_CHECK_FUNC(cmsOpenProfileFromFile, true, lcms2libs="")
+  AC_CHECK_LIB(lcms2, cmsOpenProfileFromFile, ,lcms2libs="",)
 #
   if test -n "$lcms2libs" ; then
    if test "$lcms2_header_found" = "yes" ; then
@@ -343,7 +346,7 @@ if [[ -z "$lcms2libs" ]] ; then
    LIBS="$lcms1libs"
    with_liblcms1="no"
 #
-   AC_CHECK_FUNC(cmsOpenProfileFromFile, true, lcms1libs="")
+   AC_CHECK_LIB(lcms, cmsOpenProfileFromFile, ,lcms1libs="",)
 #
    if test -n "$lcms1libs" ; then
     if test "$lcms1_header_found" = "yes" ; then
@@ -389,11 +392,11 @@ AC_SUBST(jpwl_dir)
 # -------------------------------
 # Test for creating SHARED LIBS
 # -------------------------------
-with_sharedlibs="no"
+with_sharedlibs="yes"
 AC_MSG_CHECKING(whether to build shared libraries)
 AC_ARG_ENABLE(shared,
- [  --enable-shared[=[yes|no]]       Build shared libs [ [default=no] ]],
- test "$enable_shared" = "yes" && with_sharedlibs="yes")
+ [  --enable-shared[=[yes|no]]       Build shared libs [ [default=yes] ]],
+ test "$enable_shared" = "no" && with_sharedlibs="no")
 #
 AC_MSG_RESULT($with_sharedlibs)
 AM_CONDITIONAL([with_sharedlibs], [test x$with_sharedlibs = xyes])
@@ -417,13 +420,10 @@ AC_SUBST(jp3d_dir)
 AC_SUBST(LDLIBS)
 #
 AC_CHECK_PROG(with_doxygen, doxygen, [yes],[no],,)
-doxy_dir=""
-if test "$with_doxygen" = "yes" ; then
- dox_dir="doc"
-fi
-AC_SUBST(doxy_dir)
+AM_CONDITIONAL([with_doxygen], [test x$with_doxygen = xyes])
 #
 AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([libopenjpeg.pc])
 AC_CONFIG_FILES([libopenjpeg/Makefile])
 AC_CONFIG_FILES([jpwl/Makefile])
 AC_CONFIG_FILES([codec/Makefile])
@@ -447,6 +447,7 @@ echo "lcms2 version       : $have_lcms2_version"
 echo "--enable-lcms1      : $with_liblcms1"
 echo "lcms1 header        : $lcms1_header_found"
 echo "lcms1 version       : $have_lcms1_version"
-echo "jpwl support        : $with_libjpwl"
+echo "--enable-jpwl       : $with_libjpwl"
 echo "--enable-jp3d       : $with_jp3d"
+echo "--enable-shared     : $with_sharedlibs"
 echo "----------------------------------------------"