Changeset: 5ef55bfc9049 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5ef55bfc9049
Modified Files:
        configure.ag
Branch: sciql
Log Message:

libgeotiff: partially undo 272c4c4773b2, there is no libgeotiff.pc

Fedora/RedHat developers have added a .pc file, but upstream doesn't
provide it, so cannot rely on it either, since it is missing by default
on many places where it is installed.


diffs (83 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -179,13 +179,6 @@ 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],
@@ -2114,6 +2107,49 @@ 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_LIBS)
+AM_CONDITIONAL(HAVE_GEOTIFF, test x"$have_geotiff" != xno)
+
 # geos, only used in geom module
 have_geos=auto
 GEOS_INCS=''
@@ -2186,15 +2222,6 @@ 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
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to