| 1 |
dnl *************************************************************************** |
| 2 |
dnl Project: GDAL AmigoCloud Plugin |
| 3 |
dnl Purpose: Configure source file. |
| 4 |
dnl Author: Victor Chernetsky [email protected] |
| 5 |
dnl |
| 6 |
dnl *************************************************************************** |
| 7 |
dnl Copyright (c) 2015, Victor Chernetsky |
| 8 |
dnl |
| 9 |
dnl Permission is hereby granted, free of charge, to any person obtaining a |
| 10 |
dnl copy of this software and associated documentation files (the "Software"), |
| 11 |
dnl to deal in the Software without restriction, including without limitation |
| 12 |
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 13 |
dnl and/or sell copies of the Software, and to permit persons to whom the |
| 14 |
dnl Software is furnished to do so, subject to the following conditions: |
| 15 |
dnl |
| 16 |
dnl The above copyright notice and this permission notice shall be included |
| 17 |
dnl in all copies or substantial portions of the Software. |
| 18 |
dnl |
| 19 |
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 20 |
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 21 |
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 22 |
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 23 |
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 24 |
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 25 |
dnl DEALINGS IN THE SOFTWARE. |
| 26 |
dnl *************************************************************************** |
| 27 |
|
| 28 |
dnl Disable configure caching ... it causes lots of hassles. |
| 29 |
define([AC_CACHE_LOAD], ) |
| 30 |
define([AC_CACHE_SAVE], ) |
| 31 |
|
| 32 |
dnl Process this file with autoconf to produce a configure script. |
| 33 |
AC_INIT(Makefile.in) |
| 34 |
|
| 35 |
dnl We require autoconf 2.52+ for libtool support on cygwin/mingw hosts |
| 36 |
AC_PREREQ(2.52) |
| 37 |
|
| 38 |
dnl Checks for programs. |
| 39 |
AC_PROG_CC |
| 40 |
AC_PROG_CXX |
| 41 |
|
| 42 |
AC_PROG_RANLIB |
| 43 |
AC_COMPILER_PIC |
| 44 |
AC_LD_SHARED |
| 45 |
AC_COMPILER_WFLAGS |
| 46 |
|
| 47 |
dnl --------------------------------------------------------------------------- |
| 48 |
dnl Find GDAL |
| 49 |
dnl --------------------------------------------------------------------------- |
| 50 |
|
| 51 |
AC_ARG_WITH(gdal, |
| 52 |
[ --with-gdal[=PATH] GDAL (PATH is path to gdal-config)],,) |
| 53 |
|
| 54 |
if test "$with_gdal" = "yes" -o "$with_gdal" = "" ; then |
| 55 |
|
| 56 |
if test "`basename xx/$with_gdal`" = "gdal-config" ; then |
| 57 |
GDAL_CONFIG="$with_gdal" |
| 58 |
fi |
| 59 |
|
| 60 |
if test -z "$GDAL_CONFIG" ; then |
| 61 |
AC_PATH_PROG(GDAL_CONFIG, gdal-config, no) |
| 62 |
fi |
| 63 |
|
| 64 |
if test "$GDAL_CONFIG" = "no" ; then |
| 65 |
AC_MSG_ERROR([couldn't find gdal-config]) |
| 66 |
fi |
| 67 |
|
| 68 |
elif test -n "$with_gdal" -a "$with_gdal" != "no" ; then |
| 69 |
|
| 70 |
GDAL_CONFIG=$with_gdal |
| 71 |
|
| 72 |
if test -f "$GDAL_CONFIG" -a -x "$GDAL_CONFIG" ; then |
| 73 |
AC_MSG_RESULT([user supplied gdal-config ($GDAL_CONFIG)]) |
| 74 |
else |
| 75 |
AC_MSG_ERROR(['$GDAL_CONFIG' is not an executable. Make sure you use --with-gdal=/path/to/gdal-config]) |
| 76 |
fi |
| 77 |
|
| 78 |
else |
| 79 |
|
| 80 |
AC_MSG_ERROR([gdal required to build GDAL GRASS driver]) |
| 81 |
|
| 82 |
fi |
| 83 |
|
| 84 |
LIBS="`$GDAL_CONFIG --libs` $LIBS" |
| 85 |
GDAL_INC=`$GDAL_CONFIG --cflags` |
| 86 |
|
| 87 |
AC_SUBST(GDAL_INC, $GDAL_INC) |
| 88 |
|
| 89 |
dnl --------------------------------------------------------------------------- |
| 90 |
dnl Where to put driver? |
| 91 |
dnl --------------------------------------------------------------------------- |
| 92 |
AC_ARG_WITH(autoload,[ --with-autoload[=DIR] Directory for autoload drivers],,) |
| 93 |
|
| 94 |
if test "$with_autoload" != "" ; then |
| 95 |
AUTOLOAD_DIR=$with_autoload |
| 96 |
else |
| 97 |
if $GDAL_CONFIG --autoload > /dev/null 2>&1 ; then |
| 98 |
AUTOLOAD_DIR=`$GDAL_CONFIG --autoload` |
| 99 |
else |
| 100 |
AUTOLOAD_DIR=`$GDAL_CONFIG --prefix`/lib/gdalplugins |
| 101 |
fi |
| 102 |
fi |
| 103 |
|
| 104 |
AC_MSG_RESULT(using $AUTOLOAD_DIR as GDAL shared library autoload directory) |
| 105 |
AC_SUBST(AUTOLOAD_DIR,$AUTOLOAD_DIR) |
| 106 |
|
| 107 |
|
| 108 |
rm -f conftest* |
| 109 |
|
| 110 |
AC_OUTPUT(Makefile) |
| 111 |
|
| 112 |
|
| 113 |
|