Changeset: 272c4c4773b2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=272c4c4773b2
Modified Files:
        configure.ag
        sql/backends/monet5/vaults/geotiff/Makefile.ag
Branch: sciql
Log Message:

use pgk-config to find (default) installation of libgeotiff


diffs (111 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -186,6 +186,13 @@ AC_ARG_ENABLE(fits,
        enable_fits=$enableval,
        enable_fits=$dft_fits)
 
+dft_geotiff=auto
+AC_ARG_ENABLE(geotiff,
+       AS_HELP_STRING([--enable-geotiff],
+               [enable support for GeoTIFF (default=auto)]),
+       enable_geotiff=$enableval,
+       enable_geotiff=$dft_geotiff)
+
 dft_sql=auto
 AC_ARG_ENABLE(sql,
        AS_HELP_STRING([--enable-sql],
@@ -2268,49 +2275,6 @@ AC_SUBST(MSEED_LIBS, $MSEED_LIBS)
 AM_CONDITIONAL(HAVE_MSEED, test x"$have_mseed" != xno)
 
 
-# geotiff
-have_geotiff="auto"
-AC_ARG_WITH(geotiff,
-    AS_HELP_STRING([--with-geotiff=DIR],[geotiff library is installed in DIR]),
-    [have_geotiff="$withval"], [have_geotiff="auto"])
-if test "x$have_geotiff" != xno; then
-
-       case "$have_geotiff" in
-       auto|yes)
-           ;;
-       *)
-           GEOTIFF_CFLAGS="-I$have_geotiff/include"
-           GEOTIFF_LDFLAGS="-L$have_geotiff/lib"
-           ;;
-       esac
-
-       save_CPPFLAGS="$CPPFLAGS"
-       save_LDFLAGS="$LDFLAGS"
-    save_LIBS="$LIBS"
-       CPPFLAGS="$CPPFLAGS $GEOTIFF_CFLAGS"
-       LDFLAGS="$LDFLAGS $GEOTIFF_LDFLAGS"
-    LIBS=""
-    AC_CHECK_HEADER(tiffio.h, AC_CHECK_LIB(tiff, TIFFOpen))
-       AC_CHECK_HEADER(xtiffio.h,
-               AC_CHECK_LIB(geotiff, XTIFFOpen,
-                       [AC_DEFINE(HAVE_GEOTIFF, 1, [Define if you have the 
geotiff library])
-            have_geotiff=yes
-            LIBS="$LIBS -lgeotiff"],
-                       [ if test "x$have_geotiff" != xauto; then 
AC_MSG_ERROR([-lgeotiff library not found]); fi; have_geotiff=no ], 
[$MATH_LIBS]),
-               [ if test "x$have_geotiff" != xauto; then 
AC_MSG_ERROR([xtiffio.h header not found]); fi; have_geotiff=no ])
-    GEOTIFF_LDFLAGS="$GEOTIFF_LDFLAGS $LIBS"
-       LDFLAGS="$save_LDFLAGS"
-       CPPFLAGS="$save_CPPFLAGS"
-    LIBS="$save_LIBS"
-  if test "x$have_geotiff" != "xyes"; then
-           GEOTIFF_CFLAGS=
-           GEOTIFF_LIBS=""
-  fi
-fi
-AC_SUBST(GEOTIFF_CFLAGS, $GEOTIFF_CFLAGS)
-AC_SUBST(GEOTIFF_LIBS, $GEOTIFF_LDFLAGS)
-AM_CONDITIONAL(HAVE_GEOTIFF, test x"$have_geotiff" != xno)
-
 # geos, only used in geom module
 have_geos=auto
 GEOS_INCS=''
@@ -2383,6 +2347,15 @@ if test "x$enable_fits" != xno; then
 fi
 AM_CONDITIONAL(HAVE_CFITSIO, test x"$have_cfitsio" != xno)
 
+have_geotiff=no
+if test "x$enable_geotiff" != xno; then
+       PKG_CHECK_MODULES([geotiff], [libgeotiff],
+               [have_geotiff=yes; AC_DEFINE(HAVE_GEOTIFF, 1, [Define if you 
have the geotiff library])],
+               [have_geotiff=no; if test "x$enable_geotiff" = xyes; then 
AC_MSG_ERROR([geotiff library required for GeoTIFF support]); fi;
+                enable_geotiff=no; disable_geotiff="(geotiff library not 
found)"])
+fi
+AM_CONDITIONAL(HAVE_GEOTIFF, test x"$have_geotiff" != xno)
+
 dnl     checks for header files
 AC_HEADER_STDBOOL
 AC_HEADER_STDC
@@ -3173,6 +3146,7 @@ for comp in \
        jaql \
        geom \
        fits \
+       geotiff \
        rdf \
        crackers \
        datacell \
diff --git a/sql/backends/monet5/vaults/geotiff/Makefile.ag 
b/sql/backends/monet5/vaults/geotiff/Makefile.ag
--- a/sql/backends/monet5/vaults/geotiff/Makefile.ag
+++ b/sql/backends/monet5/vaults/geotiff/Makefile.ag
@@ -30,14 +30,14 @@ INCLUDES =  ../.. \
                        ../../../../../ \
                        ../../../../../common/stream \
                        ../../../../../common/options \
-                       $(GEOTIFF_CFLAGS)
+                       $(geotiff_CFLAGS)
 
 lib__geotiff = {
        MODULE
        DIR = libdir/monetdb5
        SOURCES = geotiff.c geotiff.h
 
-       LIBS = ../../../../../monetdb5/tools/libmonetdb5 $(GEOTIFF_LIBS)
+       LIBS = ../../../../../monetdb5/tools/libmonetdb5 $(geotiff_LIBS)
 }
 
 headers_geotiff_mal = {
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to