| 39 | | LIBS="$LIBS" |
| 40 | | |
| 41 | | AC_ARG_ENABLE([debug], [ --enable-debug=[no/yes] turn on debugging [default=$debug_default]],, enable_debug=$debug_default) |
| | 51 | |
| | 52 | LIBS="${LIBS}" |
| | 53 | |
| | 54 | |
| | 55 | dnl ######################################################################### |
| | 56 | dnl Build mode configuration (debug/optimized) |
| | 57 | dnl ######################################################################### |
| | 58 | |
| | 59 | AC_ARG_ENABLE([debug], |
| | 60 | AC_HELP_STRING([--enable-debug=ARG], [Enable debug compilation mode [yes or no, default=${debug_default}]]),,) |
| 59 | | AC_MSG_CHECKING([for 64bit integer type]) |
| 60 | | |
| 61 | | echo 'int main() { long long off=0; }' >> conftest.c |
| 62 | | if test -z "`${CC} -o conftest conftest.c 2>&1`" ; then |
| 63 | | AC_DEFINE(HAVE_LONG_LONG, 1, [Define to 1, if your compiler supports long long data type]) |
| 64 | | AC_MSG_RESULT([long long]) |
| 65 | | else |
| 66 | | AC_MSG_RESULT([no]) |
| 67 | | fi |
| 68 | | rm -f conftest* |
| | 82 | AC_MSG_CHECKING([for 64bit integer type]) |
| | 83 | |
| | 84 | echo 'int main() { long long off=0; }' >> conftest.c |
| | 85 | if test -z "`${CC} -o conftest conftest.c 2>&1`" ; then |
| | 86 | AC_DEFINE(HAVE_LONG_LONG, 1, [Define to 1, if your compiler supports long long data type]) |
| | 87 | AC_MSG_RESULT([long long]) |
| | 88 | else |
| | 89 | AC_MSG_RESULT([no]) |
| | 90 | fi |
| | 91 | rm -f conftest* |
| 83 | | if test "`basename xx/$with_gdal`" = "gdal-config" ; then |
| 84 | | AC_MSG_RESULT([GDAL enabled with provided gdal-config]) |
| 85 | | GDAL_CONFIG="$with_gdal" |
| 86 | | else |
| 87 | | AC_MSG_ERROR([--with-gdal should have yes or a path to gdal-config]) |
| 88 | | fi |
| 89 | | fi |
| | 107 | |
| | 108 | dnl Check if full path to gdal-config provided |
| | 109 | if test "`basename xx/$with_gdal`" = "gdal-config" ; then |
| | 110 | AC_MSG_RESULT([GDAL enabled with provided gdal-config]) |
| | 111 | GDAL_CONFIG="$with_gdal" |
| | 112 | else |
| | 113 | dnl --with-gdal=yes given, so try to find gdal-config in PATH |
| | 114 | GDAL_CONFIG_TMP=`which gdal-config` |
| | 115 | if test "`basename xx/${GDAL_CONFIG_TMP}`" = "gdal-config" ; then |
| | 116 | AC_MSG_RESULT([GDAL enabled with gdal-config found in PATH]) |
| | 117 | GDAL_CONFIG=${GDAL_CONFIG_TMP} |
| | 118 | else |
| | 119 | AC_MSG_ERROR([--with-gdal should have yes or a path to gdal-config]) |
| | 120 | fi |
| | 121 | fi |
| | 122 | fi |
| | 123 | |
| 91 | | VERSION=`$GDAL_CONFIG --version` |
| 92 | | AC_MSG_RESULT([$GDAL_CONFIG reports version $VERSION]) |
| 93 | | LIBS="`$GDAL_CONFIG --libs` $LIBS" |
| 94 | | GDAL_INC=`$GDAL_CONFIG --cflags` |
| 95 | | GDAL_PREFIX=`$GDAL_CONFIG --prefix` |
| 96 | | OGR=`$GDAL_CONFIG --ogr-enabled` |
| 97 | | if test "$OGR" != "yes" ; then |
| 98 | | AC_MSG_ERROR([$GDAL_CONFIG says OGR is not enabled]) |
| 99 | | fi |
| 100 | | |
| 101 | | HAVE_GDAL="yes" |
| 102 | | fi |
| | 125 | VERSION=`$GDAL_CONFIG --version` |
| | 126 | AC_MSG_RESULT([$GDAL_CONFIG reports version $VERSION]) |
| | 127 | LIBS="`$GDAL_CONFIG --libs` $LIBS" |
| | 128 | GDAL_INC=`$GDAL_CONFIG --cflags` |
| | 129 | GDAL_PREFIX=`$GDAL_CONFIG --prefix` |
| | 130 | OGR=`$GDAL_CONFIG --ogr-enabled` |
| | 131 | if test "$OGR" != "yes" ; then |
| | 132 | AC_MSG_ERROR([$GDAL_CONFIG says OGR is not enabled]) |
| | 133 | fi |
| | 134 | HAVE_GDAL="yes" |
| | 135 | fi |
| | 136 | |
| 107 | | dnl --------------------------------------------------------------------------- |
| 108 | | dnl Select a libgeotiff library to use. |
| 109 | | dnl --------------------------------------------------------------------------- |
| 110 | | |
| 111 | | AC_ARG_WITH(geotiff,[ --with-geotiff=ARG Libgeotiff library to use (yes or path)],,) |
| | 141 | dnl ######################################################################### |
| | 142 | dnl Determine GeoTIFF Support |
| | 143 | dnl ######################################################################### |
| | 144 | |
| | 145 | AC_ARG_WITH([geotiff], |
| | 146 | AC_HELP_STRING([--with-geotiff=ARG], [libgeotiff library to use (yes or path)]),,) |
| 122 | | GEOTIFF_CONFIG=external |
| 123 | | dnl We now require libgeotiff 1.2.1 (for XTIFFClientOpen). |
| 124 | | dnl first check if $with_geotiff/lib has the library: |
| 125 | | AC_CHECK_LIB([geotiff], [XTIFFClientOpen], |
| 126 | | [GEOTIFF_CONFIG=external], |
| 127 | | [GEOTIFF_CONFIG=no], |
| 128 | | [-L$with_geotiff/lib]) |
| 129 | | fi |
| 130 | | |
| 131 | | if test "$GEOTIFF_CONFIG" != "no" ; then |
| 132 | | |
| 133 | | if test $GEOTIFF_CONFIG = "external" ; then |
| 134 | | LIBS="-L$with_geotiff/lib -lgeotiff $LIBS" |
| 135 | | if test -d $with_geotiff/include ; then |
| 136 | | GEOTIFF_INC="-I$with_geotiff/include" |
| 137 | | AC_MSG_RESULT([using libgeotiff from $with_geotiff/include]) |
| 138 | | fi |
| 139 | | fi |
| 140 | | |
| 141 | | HAVE_GEOTIFF="yes" |
| 142 | | |
| 143 | | fi |
| 144 | | |
| 145 | | AC_SUBST(GEOTIFF_INC GEOTIFF_PREFIX) |
| | 156 | GEOTIFF_CONFIG=external |
| | 157 | |
| | 158 | dnl We now require libgeotiff 1.2.1 (for XTIFFClientOpen). |
| | 159 | dnl first check if $with_geotiff/lib has the library: |
| | 160 | AC_CHECK_LIB([geotiff], [XTIFFClientOpen], |
| | 161 | [GEOTIFF_CONFIG=external], [GEOTIFF_CONFIG=no], |
| | 162 | [-L$with_geotiff/lib]) |
| | 163 | fi |
| | 164 | |
| | 165 | if test "${GEOTIFF_CONFIG}" != "no" ; then |
| | 166 | |
| | 167 | if test "${GEOTIFF_CONFIG}" = "external" ; then |
| | 168 | LIBS="-L$with_geotiff/lib -lgeotiff $LIBS" |
| | 169 | if test -d ${with_geotiff}/include ; then |
| | 170 | dnl Second path is for Debian using $prefix/include/geotiff/geotiff.h |
| | 171 | GEOTIFF_INC="-I$with_geotiff/include -I$with_geotiff/include/geotiff" |
| | 172 | AC_MSG_RESULT([using libgeotiff from $with_geotiff/include]) |
| | 173 | fi |
| | 174 | fi |
| | 175 | HAVE_GEOTIFF="yes" |
| | 176 | fi |
| | 177 | |
| | 178 | AC_SUBST([GEOTIFF_INC]) |
| | 179 | AC_SUBST([GEOTIFF_PREFIX]) |