~ubuntu-branches/debian/sid/gdal/sid

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2012-05-07 15:04:42 UTC
  • mfrom: (5.5.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120507150442-2eks97loeh6rq005
Tags: 1.9.0-1
* Ready for sid, starting transition.
* All symfiles updated to latest builds.
* Added dh_numpy call in debian/rules to depend on numpy ABI.
* Policy bumped to 3.9.3, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl ***************************************************************************
2
 
dnl $Id: configure.in 18652 2010-01-24 14:44:08Z rouault $
 
2
dnl $Id: configure.in 23690 2012-01-03 18:56:17Z rouault $
3
3
dnl
4
4
dnl Project:  GDAL
5
5
dnl Purpose:  Configure source file.
34
34
dnl Process this file with autoconf to produce a configure script.
35
35
AC_INIT(GDALmake.opt.in)
36
36
AC_CONFIG_MACRO_DIR(m4)
37
 
AC_CONFIG_HEADER(port/cpl_config.h:port/cpl_config.h.in:port/cpl_config_extras.h)
 
37
AC_CONFIG_HEADERS([port/cpl_config.h:port/cpl_config.h.in])
 
38
AH_BOTTOM([#include "cpl_config_extras.h"])
38
39
 
39
40
dnl We require autoconf 2.52+ for libtool support on cygwin/mingw hosts
40
41
AC_PREREQ(2.52)
60
61
 
61
62
if test "$with_libtool" = "no"; then
62
63
AC_PROG_RANLIB
63
 
AC_COMPILER_PIC
 
64
 
 
65
dnl AC_COMPILER_PIC as expanded by autoconf-2.68 doesn't work for the C++ part with clang++ 3.0 that doesn't like compiling .c programs
 
66
dnl so we inline the expanded code and fix it at hand.
 
67
dnl AC_COMPILER_PIC
 
68
        echo 'void f(){}' > conftest.c
 
69
        if test -z "`${CC-cc} $CFLAGS -fPIC -c conftest.c 2>&1`"; then
 
70
          CFLAGS="$CFLAGS -fPIC"
 
71
        fi
 
72
        echo 'void f(){}' > conftest.cpp
 
73
        if test -z "`${CXX-g++} $CXXFLAGS -fPIC -c conftest.cpp 2>&1`"; then
 
74
          CXXFLAGS="$CXXFLAGS -fPIC"
 
75
        fi
 
76
        rm -f conftest*
 
77
 
64
78
AC_LD_SHARED
65
79
else
66
80
with_libtool=yes
132
146
dnl Check for declarations
133
147
AC_CHECK_DECLS(strtof)
134
148
 
 
149
AC_CHECK_FUNCS(readlink)
 
150
 
135
151
dnl Make sure at least these are checked under C++.  Prototypes missing on 
136
152
dnl some platforms.
137
153
 
205
221
dnl Check if user requests hidding internal symbols
206
222
dnl ---------------------------------------------------------------------------
207
223
 
208
 
AC_ARG_WITH(with_hide_internal_symbols,[  --with-hide-internal-symbols[=ARG] Try to hide internal symbols (ARG=yes/no)],,)
 
224
AC_ARG_WITH(hide_internal_symbols,[  --with-hide-internal-symbols[=ARG] Try to hide internal symbols (ARG=yes/no)],,)
209
225
 
210
226
HAVE_HIDE_INTERNAL_SYMBOLS=no
211
227
 
241
257
AC_SUBST(HAVE_HIDE_INTERNAL_SYMBOLS,$HAVE_HIDE_INTERNAL_SYMBOLS)
242
258
 
243
259
dnl ---------------------------------------------------------------------------
 
260
dnl Check if user requests renaming internal libtiff symbols
 
261
dnl ---------------------------------------------------------------------------
 
262
 
 
263
AC_ARG_WITH(rename_internal_libtiff_symbols,[  --with-rename-internal-libtiff-symbols[=ARG] Prefix internal libtiff symbols with gdal_ (ARG=yes/no)],,)
 
264
if test "$with_rename_internal_libtiff_symbols" = ""; then
 
265
    with_rename_internal_libtiff_symbols=no
 
266
fi
 
267
AC_SUBST(RENAME_INTERNAL_LIBTIFF_SYMBOLS,$with_rename_internal_libtiff_symbols)
 
268
 
 
269
dnl ---------------------------------------------------------------------------
 
270
dnl Check if user requests renaming internal libgeotiff symbols
 
271
dnl ---------------------------------------------------------------------------
 
272
 
 
273
AC_ARG_WITH(rename_internal_libgeotiff_symbols,[  --with-rename-internal-libgeotiff-symbols[=ARG] Prefix internal libgeotiff symbols with gdal_ (ARG=yes/no)],,)
 
274
if test "$with_rename_internal_libgeotiff_symbols" = ""; then
 
275
    with_rename_internal_libgeotiff_symbols=no
 
276
fi
 
277
AC_SUBST(RENAME_INTERNAL_LIBGEOTIFF_SYMBOLS,$with_rename_internal_libgeotiff_symbols)
 
278
 
 
279
 
 
280
dnl ---------------------------------------------------------------------------
244
281
dnl Check if user requests /usr/local to be included.
245
282
dnl ---------------------------------------------------------------------------
246
283
 
273
310
PTHREAD_ENABLED="no"
274
311
 
275
312
AC_ARG_WITH(threads,
276
 
[  --with-threads[=linkopt]Include thread safe support],,)
 
313
[  --with-threads[=ARG]    Include thread safe support (ARG=yes(default), no or linkopt)],,)
277
314
 
278
 
if test "$with_threads" = "yes" ; then
 
315
if test "$with_threads" = "yes" -o "$with_threads" = "" ; then
279
316
 
280
317
  AC_CHECK_LIB(pthread,pthread_create,THREAD_FLAG=CPL_MULTIPROC_PTHREAD,,,)
281
318
 
302
339
 
303
340
  PTHREAD_ENABLED="yes"
304
341
 
305
 
elif test -n "$with_threads" -a "$with_threads" != "no" ; then
 
342
elif test "$with_threads" != "no" ; then
306
343
 
307
344
  THREAD_FLAG=CPL_MULTIPROC_PTHREAD
308
345
  THREAD_LIB="$with_threads"  
379
416
AC_SUBST(LIBZ_SETTING,$LIBZ_SETTING)
380
417
 
381
418
dnl ---------------------------------------------------------------------------
 
419
dnl Check for iconv/libiconv.
 
420
dnl A rationale for this macro is described in "GNU `gettext' utilities"
 
421
dnl manual at
 
422
dnl http://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html
 
423
dnl ---------------------------------------------------------------------------
 
424
AM_ICONV
 
425
 
 
426
dnl Extra test needed for GCC 4.5 on Solaris 11, where there is
 
427
dnl a different behaviour if the tests are compiled with gcc or g++.
 
428
dnl So we introduce a ICONV_CPP_CONST that must be used instead of
 
429
dnl ICONV_CONST when used from .cpp files.
 
430
if test "$am_func_iconv" = "yes"; then
 
431
    rm -f testiconv.*
 
432
    echo '#include <iconv.h>' > testiconv.cpp
 
433
    echo 'int main(int argc, char** argv) { iconv_t cd; return iconv (cd, (const char **) 0, 0, 0, 0); } ' >> testiconv.cpp
 
434
    if test -z "`${CXX} testiconv.cpp -c 2>&1`" ; then
 
435
        AC_MSG_RESULT([using ICONV_CPP_CONST="const"])
 
436
        ICONV_CPP_CONST="const"
 
437
    else
 
438
        AC_MSG_RESULT([using ICONV_CPP_CONST=""])
 
439
        ICONV_CPP_CONST=""
 
440
    fi
 
441
    rm -f testiconv.*
 
442
 
 
443
    AC_DEFINE_UNQUOTED(ICONV_CPP_CONST,$ICONV_CPP_CONST, [For.cpp files, define as const if the declaration of iconv() needs const.])
 
444
fi
 
445
 
 
446
 
 
447
dnl ---------------------------------------------------------------------------
 
448
dnl Check if liblzma is available.
 
449
dnl ---------------------------------------------------------------------------
 
450
 
 
451
AC_ARG_WITH(liblzma,[  --with-liblzma[=ARG]       Include liblzma support (ARG=yes/no)],,)
 
452
 
 
453
if test "$with_liblzma" = "yes" ; then
 
454
  AC_CHECK_LIB(lzma,lzma_code,LIBLZMA_SETTING=yes,LIBLZMA_SETTING=no,)
 
455
 
 
456
  if test "$LIBLZMA_SETTING" = "yes" ; then
 
457
    LIBS="-llzma $LIBS"
 
458
  fi
 
459
else
 
460
    LIBLZMA_SETTING=no
 
461
fi
 
462
 
 
463
AC_SUBST(LIBLZMA_SETTING,$LIBLZMA_SETTING)
 
464
 
 
465
dnl ---------------------------------------------------------------------------
382
466
dnl Select an PostgreSQL Library to use, or disable driver.
383
467
dnl ---------------------------------------------------------------------------
384
468
 
417
501
 
418
502
  AC_MSG_RESULT([yes])
419
503
 
420
 
  ax_save_LIBS="${LIBS}"
421
 
  LIBS=-L`$PG_CONFIG --libdir`" -lpq"
422
 
  AC_CHECK_LIB(pq,PQconnectdb,HAVE_PG=yes,HAVE_PG=no,)
423
 
  LIBS="${ax_save_LIBS}"
 
504
  AC_CHECK_LIB(pq,PQconnectdb,HAVE_PG=yes,HAVE_PG=no,-L`$PG_CONFIG --libdir`)
424
505
  
425
506
  if test "${HAVE_PG}" = "yes" ; then
426
507
    LIBS=-L`$PG_CONFIG --libdir`" -lpq $LIBS"
427
508
    PG_INC=-I`$PG_CONFIG --includedir`" -I"`$PG_CONFIG --includedir-server`
428
509
 
429
510
    PG_EXTRA_DEC=""
 
511
    saved_LIBS="$LIBS"
430
512
    AC_CHECK_LIB(pq,PQputCopyData,,DEFINE_PG_PRE74=-DPG_PRE74,)
 
513
    LIBS="$saved_LIBS"
431
514
    if test "$DEFINE_PG_PRE74" != "" ; then
432
515
      echo "The PostgreSQL client version is before 7.4. You will not be able to use binary cursors."
433
516
    fi
434
517
 
 
518
    saved_LIBS="$LIBS"
435
519
    AC_CHECK_LIB(pq,PQescapeStringConn,DEFINE_PG_HAS_PQESCAPESTRINGCONN=-DPG_HAS_PQESCAPESTRINGCONN,,)
 
520
    LIBS="$saved_LIBS"
436
521
    if test "$DEFINE_PG_HAS_PQESCAPESTRINGCONN" = "" ; then
437
522
      echo "falling back to using PQescapeString. You should upgrade at least to security releases 8.1.4, 8.0.8, 7.4.13, 7.3.15."
438
523
    fi
609
694
fi
610
695
 
611
696
dnl ---------------------------------------------------------------------------
612
 
dnl Check if netcdf library is available.
613
 
dnl ---------------------------------------------------------------------------
614
 
 
615
 
AC_ARG_WITH([netcdf],[  --with-netcdf[=ARG]     Include netCDF support (ARG=no or netCDF tree prefix)],,)
616
 
 
617
 
if test "$with_netcdf" = "no" ; then
618
 
 
619
 
  NETCDF_SETTING=no
620
 
 
621
 
  echo "netCDF support disabled."
622
 
 
623
 
elif test "$with_netcdf" = "yes" -o "$with_netcdf" = "" ; then
624
 
 
625
 
  AC_CHECK_LIB([netcdf], [nc_open], [NETCDF_SETTING=yes], [NETCDF_SETTING=no],)
626
 
 
627
 
  if test "$NETCDF_SETTING" = "yes" ; then   
628
 
    LIBS="-lnetcdf $LIBS"
629
 
    echo "using pre-installed libnetcdf."
630
 
  else
631
 
    echo "libnetcdf not found - netCDF support disabled"
632
 
  fi
633
 
 
634
 
dnl Fedora has netcdf headers in /usr/include/netcdf
635
 
  if test "$NETCDF_SETTING" = "yes" -a -d /usr/include/netcdf ; then
636
 
    EXTRA_INCLUDES="-I/usr/include/netcdf $EXTRA_INCLUDES"
637
 
dnl RHEL 5 has netcdf headers in /usr/include/netcdf-3
638
 
  elif test "$NETCDF_SETTING" = "yes" -a -d /usr/include/netcdf-3 ; then
639
 
    EXTRA_INCLUDES="-I/usr/include/netcdf-3 $EXTRA_INCLUDES"
640
 
  fi
641
 
else
642
 
 
643
 
  NETCDF_SETTING=yes
644
 
  LIBS="-L$with_netcdf -L$with_netcdf/lib -lnetcdf $LIBS"
645
 
  EXTRA_INCLUDES="-I$with_netcdf -I$with_netcdf/include $EXTRA_INCLUDES"
646
 
 
647
 
  echo "using libnetcdf from $with_netcdf."
648
 
fi
649
 
 
650
 
AC_SUBST([NETCDF_SETTING], [$NETCDF_SETTING])
651
 
 
652
 
if test "$NETCDF_SETTING" != "no" ; then
653
 
  OPT_GDAL_FORMATS="netcdf $OPT_GDAL_FORMATS"
654
 
fi
655
 
 
656
 
dnl ---------------------------------------------------------------------------
657
697
dnl Select a PNG Library to use, or disable driver.
658
698
dnl ---------------------------------------------------------------------------
659
699
 
705
745
fi
706
746
 
707
747
dnl ---------------------------------------------------------------------------
 
748
dnl Check if GTA library is available.
 
749
dnl ---------------------------------------------------------------------------
 
750
 
 
751
AC_ARG_WITH([gta],[  --with-gta[=ARG]        Include GTA support (ARG=no or libgta tree prefix)],,)
 
752
 
 
753
if test "$with_gta" = "no" ; then
 
754
 
 
755
  GTA_SETTING=no
 
756
 
 
757
  echo "GTA support disabled."
 
758
 
 
759
elif test "$with_gta" = "yes" -o "$with_gta" = "" ; then
 
760
 
 
761
  AC_CHECK_LIB([gta], [gta_version], [GTA_SETTING=yes], [GTA_SETTING=no],)
 
762
 
 
763
  if test "$GTA_SETTING" = "yes" ; then
 
764
    LIBS="-lgta $LIBS"
 
765
    echo "using pre-installed libgta."
 
766
  else
 
767
    echo "libgta not found - GTA support disabled"
 
768
  fi
 
769
 
 
770
else
 
771
 
 
772
  GTA_SETTING=yes
 
773
  LIBS="-L$with_gta -L$with_gta/lib -lgta $LIBS"
 
774
  EXTRA_INCLUDES="-I$with_gta -I$with_gta/include $EXTRA_INCLUDES"
 
775
 
 
776
  echo "using libgta from $with_gta."
 
777
fi
 
778
 
 
779
AC_SUBST([GTA_SETTING], [$GTA_SETTING])
 
780
 
 
781
if test "$GTA_SETTING" != "no" ; then
 
782
  OPT_GDAL_FORMATS="gta $OPT_GDAL_FORMATS"
 
783
fi
 
784
 
 
785
dnl ---------------------------------------------------------------------------
708
786
dnl Select PCIDSK options.
709
787
dnl ---------------------------------------------------------------------------
710
788
 
749
827
 
750
828
AC_MSG_CHECKING([for libtiff])
751
829
 
752
 
if test "$with_libtiff" = "yes" -o "$with_libtiff" = "" ; then
753
 
 
754
 
  dnl We now effectively require libtiff 3.6.0.
755
 
  AC_CHECK_LIB(tiff,TIFFGetTagListCount,TIFF_SETTING=external,TIFF_SETTING=internal,)
756
 
 
757
 
  dnl Cygwin takes a somewhat restrictive view of what should be exported
758
 
  dnl from the dll, so don't use the external library if missing semi-private
759
 
  dnl functions.
 
830
if test "x${with_libtiff}" = "xyes" -o "x${with_libtiff}" = "x" ; then
 
831
 
 
832
  dnl Only automatically pick up the external libtiff if it is >= 4.0.
 
833
  AC_CHECK_LIB(tiff,TIFFScanlineSize64,TIFF_SETTING=external HAVE_BIGTIFF=yes,TIFF_SETTING=internal HAVE_BIGTIFF=yes,)
 
834
 
760
835
  if test "$TIFF_SETTING" = "external" ; then
 
836
    dnl Cygwin takes a somewhat restrictive view of what should be exported
 
837
    dnl from the dll, so don't use the external library if missing semi-private
 
838
    dnl functions.
761
839
    AC_CHECK_LIB(tiff,_TIFFsetDoubleArray,TIFF_SETTING=external,TIFF_SETTING=internal,)
762
 
    dnl Check for the BigTIFF enabled library (libtiff >= 4.0)
763
 
    AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,)
764
 
  else
765
 
    HAVE_BIGTIFF=yes
766
840
  fi
767
841
 
768
842
  if test "$TIFF_SETTING" = "external" ; then   
769
843
    LIBS="-ltiff $LIBS"
770
 
    echo "using pre-installed libtiff."
 
844
    AC_MSG_RESULT([using pre-installed libtiff.])
771
845
  else
772
 
    echo "using internal TIFF code."
 
846
    AC_MSG_RESULT([using internal TIFF code.])
773
847
  fi
774
848
 
775
 
elif test "$with_libtiff" = "internal" ; then
 
849
elif test "x${with_libtiff}" = "xinternal" ; then
776
850
 
777
851
  TIFF_SETTING=internal
778
852
  HAVE_BIGTIFF=yes
779
853
 
780
 
  echo "using internal TIFF code."
 
854
  AC_MSG_RESULT([using internal TIFF code.])
781
855
 
782
856
else
783
857
 
784
858
  TIFF_SETTING=external
785
 
  if test -r $with_libtiff/tiff.h ; then
 
859
  if test -r "$with_libtiff/tiff.h" ; then
786
860
    LIBS="-L$with_libtiff -ltiff $LIBS"
787
861
    EXTRA_INCLUDES="-I$with_libtiff $EXTRA_INCLUDES"
788
862
  else
790
864
    EXTRA_INCLUDES="-I$with_libtiff/include $EXTRA_INCLUDES"
791
865
  fi
792
866
 
793
 
  echo "using libtiff from $with_libtiff."
 
867
  AC_MSG_RESULT([using libtiff from ${with_libtiff}.])
794
868
 
795
869
  dnl Check for the BigTIFF enabled library (libtiff >= 4.0)
796
870
  AC_CHECK_LIB(tiff,TIFFScanlineSize64,HAVE_BIGTIFF=yes,HAVE_BIGTIFF=no,)
800
874
if test "${HAVE_BIGTIFF}" = "yes" ; then
801
875
  TIFF_OPTS="-DBIGTIFF_SUPPORT"
802
876
 
803
 
  echo "BigTIFF support enabled."
 
877
  LOC_MSG([BigTIFF support enabled.])
804
878
fi
805
879
 
806
880
AC_SUBST(TIFF_SETTING,${TIFF_SETTING})
983
1057
elif test "$with_gif" = "yes" -o "$with_gif" = "" ; then
984
1058
 
985
1059
  AC_CHECK_LIB(gif,DGifOpenFileName,GIF_SETTING=external,GIF_SETTING=internal,)
 
1060
  AC_CHECK_HEADERS(gif_lib.h)
986
1061
 
987
1062
  if test "$GIF_SETTING" = "external" ; then   
988
1063
    LIBS="-lgif $LIBS"
1170
1245
 
1171
1246
  if test x"$with_hdf4" = x"yes" -o x"$with_hdf4" = x"" ; then
1172
1247
dnl Fedora has hdf static libraries in /usr/lib/hdf
1173
 
    if test -d /usr/lib/hdf; then
 
1248
    if test -d /usr/lib64/hdf; then
 
1249
      HDF_LIB_DIR="/usr/lib64/hdf"
 
1250
    elif test -d /usr/lib/hdf; then
1174
1251
      HDF_LIB_DIR="/usr/lib/hdf"
1175
1252
    else
1176
1253
      HDF_LIB_DIR=""
1326
1403
fi
1327
1404
 
1328
1405
dnl ---------------------------------------------------------------------------
 
1406
dnl Check if netcdf library is available.
 
1407
dnl ---------------------------------------------------------------------------
 
1408
 
 
1409
NETCDF_SETTING=
 
1410
NETCDF_ROOT=
 
1411
NETCDF_HAS_NC4=
 
1412
NETCDF_HAS_HDF4=
 
1413
 
 
1414
AC_ARG_WITH([netcdf],[  --with-netcdf[=ARG]     Include netCDF support (ARG=no or netCDF tree prefix)],,)
 
1415
 
 
1416
if test "$with_netcdf" = "no" ; then
 
1417
 
 
1418
  NETCDF_SETTING=no
 
1419
 
 
1420
  echo "netCDF support disabled."
 
1421
 
 
1422
elif test "$with_netcdf" = "yes" -o "$with_netcdf" = "" ; then
 
1423
 
 
1424
  AC_CHECK_LIB([netcdf], [nc_open], [NETCDF_SETTING=yes], [NETCDF_SETTING=no],)
 
1425
 
 
1426
  if test "$NETCDF_SETTING" = "yes" ; then
 
1427
 
 
1428
    dnl Fedora has netcdf headers in /usr/include/netcdf
 
1429
    if test -d /usr/include/netcdf ; then
 
1430
      EXTRA_INCLUDES="-I/usr/include/netcdf $EXTRA_INCLUDES"
 
1431
      NETCDF_ROOT="/usr"
 
1432
    dnl RHEL 5 has netcdf headers in /usr/include/netcdf-3
 
1433
    elif test -d /usr/include/netcdf-3 ; then
 
1434
      EXTRA_INCLUDES="-I/usr/include/netcdf-3 $EXTRA_INCLUDES"
 
1435
      NETCDF_ROOT="/usr"
 
1436
    dnl ubuntu and fedora have netcdf headers in /usr/include
 
1437
    elif test -f /usr/include/netcdf.h ; then
 
1438
      NETCDF_ROOT="/usr"
 
1439
    dnl try /usr/local
 
1440
    elif test -f /usr/local/include/netcdf.h ; then
 
1441
      NETCDF_ROOT="/usr/local"
 
1442
    dnl print warning if include cannot be found
 
1443
    else
 
1444
      echo "using pre-installed libnetcdf."
 
1445
      echo -n "libnetcdf is installed but its location cannot be found, "
 
1446
      echo "use --with-netcdf=/path_to_netcdf for proper support"
 
1447
    fi
 
1448
 
 
1449
    LIBS="-lnetcdf $LIBS"
 
1450
    if test "$NETCDF_ROOT" != "" ; then
 
1451
      echo "using pre-installed libnetcdf from "$NETCDF_ROOT
 
1452
    fi
 
1453
 
 
1454
  else
 
1455
    echo "libnetcdf not found - netCDF support disabled"
 
1456
  fi
 
1457
 
 
1458
else
 
1459
 
 
1460
  AC_CHECK_LIB([netcdf], [nc_open], [NETCDF_SETTING=yes], [NETCDF_SETTING=no],-L$with_netcdf -L$with_netcdf/lib)
 
1461
 
 
1462
  if test "$NETCDF_SETTING" = "yes" ; then
 
1463
 
 
1464
    NETCDF_SETTING=yes
 
1465
    NETCDF_ROOT="$with_netcdf"
 
1466
 
 
1467
    if test -d $with_netcdf/lib ; then
 
1468
      LIBS="-L$with_netcdf/lib -lnetcdf $LIBS"
 
1469
      EXTRA_INCLUDES="-I$with_netcdf/include $EXTRA_INCLUDES"
 
1470
    else
 
1471
      LIBS="-L$with_netcdf -lnetcdf $LIBS"
 
1472
      EXTRA_INCLUDES="-I$with_netcdf $EXTRA_INCLUDES"
 
1473
    fi
 
1474
 
 
1475
    echo "using libnetcdf from $with_netcdf"
 
1476
 
 
1477
  else
 
1478
    echo "libnetcdf not found in "$with_netcdf" - netCDF support disabled"
 
1479
  fi
 
1480
 
 
1481
fi
 
1482
 
 
1483
dnl start new test
 
1484
 
 
1485
dnl test for NC4 and HDF4 support
 
1486
  if test "$NETCDF_SETTING" = "yes" ; then
 
1487
 
 
1488
    ncdump=$NETCDF_ROOT"/bin/ncdump" 
 
1489
    nc_config=""
 
1490
 
 
1491
    dnl test for libnetcdf v4
 
1492
    if { test -x "$ncdump"; }; then
 
1493
      AC_MSG_CHECKING([libnetcdf version with $ncdump]) 
 
1494
      netcdf_version=`$ncdump 2>&1 | grep "netcdf library version" | awk '{gsub(/"/,"");print $4}'`
 
1495
      AC_MSG_RESULT([got $netcdf_version])
 
1496
      if test "$netcdf_version" != "" -a "${netcdf_version:0:1}" == "4" ; then
 
1497
          nc_config=$NETCDF_ROOT"/bin/nc-config"
 
1498
      fi
 
1499
    fi
 
1500
 
 
1501
    dnl if nc-config is found (only for libnetcdf-4), test for netcdf-4 and HDF4 support 
 
1502
    if { test -x "$nc_config"; }; then
 
1503
      echo "checking libnetcdf config with $nc_config"
 
1504
 
 
1505
      AC_MSG_CHECKING([for netcdf-4 (and HDF5) support in libnetcdf])
 
1506
        if test "x$($nc_config --has-nc4)" = "xyes"; then :
 
1507
          AC_MSG_RESULT([yes])
 
1508
          NETCDF_HAS_NC4=yes
 
1509
        else
 
1510
          AC_MSG_RESULT([no])
 
1511
          NETCDF_HAS_NC4=no
 
1512
        fi
 
1513
 
 
1514
      AC_MSG_CHECKING([for HDF4 support in libnetcdf])
 
1515
        if test "x$($nc_config --has-hdf4)" = "xyes"; then :
 
1516
          AC_MSG_RESULT([yes])
 
1517
          NETCDF_HAS_HDF4=yes
 
1518
        else
 
1519
          AC_MSG_RESULT([no])
 
1520
          NETCDF_HAS_HDF4=no
 
1521
        fi
 
1522
 
 
1523
    else
 
1524
      AC_MSG_RESULT([ncdump and/or nc-config not found, skipping netcdf-4 tests])
 
1525
      NETCDF_HAS_NC4=no
 
1526
      NETCDF_HAS_HDF4=no
 
1527
    fi
 
1528
fi
 
1529
 
 
1530
dnl end new test
 
1531
 
 
1532
AC_SUBST([NETCDF_SETTING], [$NETCDF_SETTING])
 
1533
AC_SUBST([NETCDF_ROOT], [$NETCDF_ROOT])
 
1534
AC_SUBST([NETCDF_HAS_NC4], [$NETCDF_HAS_NC4])
 
1535
AC_SUBST([NETCDF_HAS_HDF4], [$NETCDF_HAS_HDF4])
 
1536
 
 
1537
if test "$NETCDF_SETTING" != "no" ; then
 
1538
  OPT_GDAL_FORMATS="netcdf $OPT_GDAL_FORMATS"
 
1539
fi
 
1540
 
 
1541
 
 
1542
dnl ---------------------------------------------------------------------------
1329
1543
dnl Select a JasPer Library to use, or disable driver.
1330
1544
dnl ---------------------------------------------------------------------------
1331
1545
 
1373
1587
AC_SUBST([HAVE_JASPER],$HAVE_JASPER)
1374
1588
AC_SUBST([JASPER_FLAGS],$JASPER_FLAGS)
1375
1589
 
 
1590
 
 
1591
dnl ---------------------------------------------------------------------------
 
1592
dnl Select a OpenJPEG Library to use, or disable driver.
 
1593
dnl ---------------------------------------------------------------------------
 
1594
 
 
1595
AC_ARG_WITH(openjpeg,[  --with-openjpeg[=ARG]     Include JPEG-2000 support via OpenJPEG v2 library (ARG=path)],,)
 
1596
 
 
1597
if test "$with_openjpeg" = "no" ; then
 
1598
 
 
1599
  HAVE_OPENJPEG=no
 
1600
 
 
1601
  AC_MSG_NOTICE([OpenJPEG (JPEG2000) support disabled.])
 
1602
 
 
1603
elif test "$with_openjpeg" = "yes" -o "$with_openjpeg" = "" ; then
 
1604
 
 
1605
  AC_CHECK_LIB(openjpeg,opj_decode_tile_data,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,)
 
1606
  AC_CHECK_HEADERS(openjpeg.h)
 
1607
 
 
1608
  if test "$ac_cv_header_openjpeg_h" = "no"; then
 
1609
    HAVE_OPENJPEG=no
 
1610
  fi
 
1611
 
 
1612
  if test "$HAVE_OPENJPEG" = "yes" ; then
 
1613
    LIBS="-lopenjpeg $LIBS"
 
1614
  fi
 
1615
else
 
1616
 
 
1617
  HAVE_OPENJPEG=yes
 
1618
  LIBS="-L$with_openjpeg -L$with_openjpeg/lib -lopenjpeg $LIBS"
 
1619
  if test -r $with_openjpeg/include/openjpeg-2.0/openjpeg.h ; then
 
1620
    EXTRA_INCLUDES="-I$with_openjpeg/include/openjpeg-2.0 $EXTRA_INCLUDES"
 
1621
  elif test -r $with_openjpeg/include/openjpeg.h ; then
 
1622
    EXTRA_INCLUDES="-I$with_openjpeg/include $EXTRA_INCLUDES"
 
1623
  elif test -r $with_openjpeg/openjpeg.h ; then
 
1624
    EXTRA_INCLUDES="-I$with_openjpeg $EXTRA_INCLUDES"
 
1625
  else
 
1626
    AC_MSG_ERROR([openjpeg.h not found in $with_openjpeg/include or $with_openjpeg/include/openjpeg-2.0])
 
1627
  fi
 
1628
 
 
1629
  AC_CHECK_LIB(openjpeg,opj_decode_tile_data,HAVE_OPENJPEG=yes,HAVE_OPENJPEG=no,)
 
1630
 
 
1631
  if test "$HAVE_OPENJPEG" = "yes" ; then
 
1632
    AC_MSG_NOTICE([using OpenJPEG library from $with_openjpeg.])
 
1633
  fi
 
1634
fi
 
1635
 
 
1636
if test "$HAVE_OPENJPEG" != "no" ; then
 
1637
  OPT_GDAL_FORMATS="openjpeg $OPT_GDAL_FORMATS"
 
1638
fi
 
1639
 
 
1640
AC_SUBST([HAVE_OPENJPEG],$HAVE_OPENJPEG)
 
1641
 
 
1642
 
 
1643
 
 
1644
dnl ---------------------------------------------------------------------------
 
1645
dnl Select a FGDB API to use, or disable driver.
 
1646
dnl ---------------------------------------------------------------------------
 
1647
 
 
1648
AC_ARG_WITH(fgdb,[  --with-fgdb[=ARG]        Include ESRI File Geodatabase support (ARG=FGDP API Path, yes or no)],,)
 
1649
 
 
1650
if test "$with_fgdb" = "no" ; then
 
1651
 
 
1652
  FGDB_ENABLED=no
 
1653
 
 
1654
  echo "FGDB support disabled."
 
1655
 
 
1656
elif test "$with_fgdb" = "yes" -o "$with_fgdb" = "" ; then
 
1657
 
 
1658
  AC_CHECK_LIB(FileGDBAPI,OpenGeodatabase,FGDB_ENABLED=yes,FGDB_ENABLED=no,-lFileGDBAPI -lfgdblinuxrtl)
 
1659
 
 
1660
  if test "$FGDB_ENABLED" = "yes" ; then   
 
1661
    LIBS="-lFileGDBAPI -lfgdblinuxrtl"
 
1662
  fi
 
1663
 
 
1664
else
 
1665
 
 
1666
  AC_MSG_CHECKING([for libFileGDBAPI.so in in $with_fgdb/lib])
 
1667
  FGDB_ENABLED=yes
 
1668
  if test -r $with_fgdb/lib/libFileGDBAPI.so ; then
 
1669
    AC_MSG_RESULT([found.])
 
1670
    FGDB_LIB="-L$with_fgdb/lib -lFileGDBAPI -lfgdblinuxrtl"
 
1671
  else
 
1672
    AC_MSG_ERROR([not found.])
 
1673
  fi
 
1674
 
 
1675
  AC_MSG_CHECKING([for FileGDBAPI.h in $with_fgdb/include])
 
1676
  if test -r $with_fgdb/include/FileGDBAPI.h ; then  
 
1677
    AC_MSG_RESULT([found.])
 
1678
    FGDB_INC="-I$with_fgdb/include"
 
1679
  else
 
1680
    AC_MSG_ERROR([not found.])
 
1681
  fi
 
1682
 
 
1683
fi
 
1684
 
 
1685
AC_SUBST(FGDB_ENABLED, $FGDB_ENABLED)
 
1686
AC_SUBST(FGDB_LIB, $FGDB_LIB)
 
1687
AC_SUBST(FGDB_INC, $FGDB_INC)
 
1688
 
1376
1689
dnl ---------------------------------------------------------------------------
1377
1690
dnl Select a ECW Library to use, or disable driver.
1378
1691
dnl ---------------------------------------------------------------------------
1396
1709
  AC_CHECK_LIB(NCSEcw,NCScbmOpenFileView,ECW_SETTING=yes,ECW_SETTING=no,-lNCSCnet -lNCSUtil)
1397
1710
 
1398
1711
  if test "$ECW_SETTING" = "yes" ; then   
1399
 
    LIBS="-lNCSEcw -lNCSCnet -lNCSUtil $LIBS"
 
1712
    LIBS="-lNCSEcw -lNCSEcwC -lNCSCnet -lNCSUtil $LIBS"
1400
1713
  fi
1401
1714
 
1402
1715
  if test "$ECW_SETTING" = "no" ; then
1411
1724
  AC_MSG_CHECKING([for libNCSEcw.so or libecwj2])
1412
1725
  ECW_SETTING=yes
1413
1726
  if test -r $with_ecw/lib/libNCSCnet.so -o -r $with_ecw/lib/libNCSCnet.dylib ; then
1414
 
    LIBS="-L$with_ecw/lib -lNCSEcw -lNCSCnet -lNCSUtil $LIBS"
 
1727
    LIBS="-L$with_ecw/lib -lNCSEcw -lNCSEcwC -lNCSCnet -lNCSUtil $LIBS"
1415
1728
    AC_MSG_RESULT([found in $with_ecw/lib.])
1416
1729
  elif test -r $with_ecw/lib/libNCSCNet.so -o -r $with_ecw/lib/libNCSCNet.dylib ; then
1417
 
    LIBS="-L$with_ecw/lib -lNCSEcw -lNCSCNet -lNCSUtil $LIBS"
 
1730
    LIBS="-L$with_ecw/lib -lNCSEcw -lNCSEcwC -lNCSCNet -lNCSUtil $LIBS"
1418
1731
    AC_MSG_RESULT([found in $with_ecw/lib.])
1419
1732
  elif test -r $with_ecw/bin/libNCSEcw.so -o -r $with_ecw/bin/libNCSEcw.dylib ; then
1420
 
    LIBS="-L$with_ecw/bin -lNCSEcw -lNCSCnet -lNCSUtil $LIBS"
 
1733
    LIBS="-L$with_ecw/bin -lNCSEcw -lNCSEcwC -lNCSCnet -lNCSUtil $LIBS"
1421
1734
    AC_MSG_RESULT([found in $with_ecw/bin.])
1422
1735
  elif test -r $with_ecw/lib/libecwj2.dylib ; then
1423
1736
    LIBS="-L$with_ecw/lib -lecwj2 $CARBON_FRAMEWORK $LIBS"
1459
1772
build directory.  Note that Kakadu is *not* free software.])
1460
1773
else
1461
1774
  KAKDIR=$with_kakadu
1462
 
  OPT_GDAL_FORMATS="jp2kak $OPT_GDAL_FORMATS"
 
1775
  OPT_GDAL_FORMATS="jp2kak jpipkak $OPT_GDAL_FORMATS"
1463
1776
  LIBS="$LIBS -L$with_kakadu/lib -lkdu"
1464
1777
  AC_MSG_RESULT([requested.])
1465
1778
  HAVE_KAKADU=yes
1511
1824
 
1512
1825
  if test $HAVE_MRSID = yes ; then
1513
1826
 
1514
 
    MRSID_LIBS="-lltidsdk -lpthread"
 
1827
    MRSID_LIBS="-lpthread"
 
1828
 
 
1829
    if test -r "$with_mrsid/lib/libltiesdk.a" ; then # v8+ esdk contains dsdk
 
1830
      _LIBPART=lib
 
1831
      MRSID_LIBS="-lltiesdk $MRSID_LIBS"
 
1832
    elif test -e "$with_mrsid/lib/libltidsdk.a" \
 
1833
           -o -e "$with_mrsid/lib/libltidsdk.so" \
 
1834
           -o -e "$with_mrsid/lib/libltidsdk.dylib" ; then
 
1835
      _LIBPART=lib
 
1836
      MRSID_LIBS="-lltidsdk $MRSID_LIBS"
 
1837
    else
 
1838
      _LIBPART=lib/Release
 
1839
      MRSID_LIBS="-lltidsdk $MRSID_LIBS"
 
1840
    fi
1515
1841
 
1516
1842
    AC_MSG_CHECKING([for MG3ImageWriter.h in $with_mrsid/include/mrsid_writers])
1517
1843
    if test -r "$with_mrsid/include/mrsid_writers/MG3ImageWriter.h" ; then
1532
1858
      AC_MSG_ERROR([MrSID JPEG2000 support requested, but this is incompatible with use of standalone Kakadu])
1533
1859
    fi
1534
1860
 
1535
 
    MRSID_KAKADU_LIB=no
 
1861
    MRSID_KAKADU_LIB=""
1536
1862
    if test "$HAVE_KAKADU" = "no" ; then
1537
1863
      if test x"$with_jp2mrsid" = x"" -o x"$with_jp2mrsid" = x"yes" ; then
1538
 
        if test -r $with_mrsid/3rd-party/lib/Release/libltikdu.a ; then 
 
1864
        if test -r "$with_mrsid/3rd-party/$_LIBPART/libltikdu.a" ; then 
1539
1865
          with_jp2mrsid=yes
1540
1866
          MRSID_KAKADU_LIB=-lltikdu
1541
 
        elif test -r $with_mrsid/3rd-party/lib/Release/liblt_kakadu.a ; then 
 
1867
        elif test -r "$with_mrsid/3rd-party/$_LIBPART/liblt_kakadu.a" ; then 
1542
1868
          with_jp2mrsid=yes
1543
1869
          MRSID_KAKADU_LIB=-llt_kakadu
1544
 
        else
 
1870
        elif test -e "$with_mrsid/lib/libltidsdk.so" \
 
1871
               -o -e "$with_mrsid/lib/libltidsdk.dylib"; then # v8+ .so has kdu
 
1872
          with_jp2mrsid=yes
 
1873
        elif test x"$with_jp2mrsid" = x"yes" ; then
1545
1874
          AC_MSG_ERROR([MrSID JPEG2000 support requested, but libltikdu.a not found.])
 
1875
        else
 
1876
          with_jp2mrsid=no
1546
1877
        fi
1547
1878
      fi
1548
1879
    fi
1555
1886
      AC_MSG_RESULT([disabled])
1556
1887
    fi
1557
1888
 
1558
 
    if test -r "$with_mrsid/lib/libltidsdk.a" ; then
1559
 
      MRSID_LIBS="-L$with_mrsid/lib -L$with_mrsid/3rd-party/lib $MRSID_LIBS"
1560
 
    else
1561
 
      MRSID_LIBS="-L$with_mrsid/lib/Release -L$with_mrsid/3rd-party/lib/Release $MRSID_LIBS"
1562
 
    fi
 
1889
    MRSID_LIBS="-L$with_mrsid/$_LIBPART $MRSID_LIBS"
 
1890
    MRSID_LIBS="-L$with_mrsid/3rd-party/$_LIBPART $MRSID_LIBS"
1563
1891
 
1564
1892
  else
1565
1893
    HAVE_MRSID=no
1577
1905
  OPT_GDAL_FORMATS="mrsid $OPT_GDAL_FORMATS"
1578
1906
fi
1579
1907
 
 
1908
dnl ---------------------------------------------------------------------------
 
1909
dnl Select MrSID/MG4 Lidar library or disable driver.
 
1910
dnl ---------------------------------------------------------------------------
 
1911
 
 
1912
MRSID_LIDAR_FLAGS=
 
1913
HAVE_MRSID_LIDAR=no
 
1914
 
 
1915
AC_ARG_WITH(mrsid_lidar,[  --with-mrsid_lidar[=ARG]      Include MrSID/MG4 LiDAR support (ARG=path to LizardTech LiDAR SDK or no)],,)
 
1916
 
 
1917
if test "x$with_mrsid_lidar" = "xno"  -o "x$with_mrsid_lidar" = "x" ; then
 
1918
  HAVE_MRSID_LIDAR=no
 
1919
  AC_MSG_NOTICE([MrSID/MG4 Lidar support disabled.])
 
1920
else
 
1921
  MRSID_LIDAR_BASE="$with_mrsid_lidar"
 
1922
 
 
1923
  if test -r "$MRSID_LIDAR_BASE/include/lidar/Version.h" ; then
 
1924
    AC_MSG_RESULT([found LizardTech LiDAR SDK 1.1 or newer.])
 
1925
    HAVE_MRSID_LIDAR=yes
 
1926
  else
 
1927
    HAVE_MRSID_LIDAR=no
 
1928
    AC_MSG_RESULT([not found.])
 
1929
    AC_MSG_ERROR([  MrSID/MG4 Lidar requested, but components not found.])
 
1930
  fi
 
1931
 
 
1932
  if test $HAVE_MRSID_LIDAR = yes ; then
 
1933
    if test -e "$MRSID_LIDAR_BASE/lib/liblti_lidar_dsdk.so" \
 
1934
         -o -e "$MRSID_LIDAR_BASE/lib/liblti_lidar_dsdk.dylib"; then
 
1935
      MRSID_LIDAR_LIBS="-L$MRSID_LIDAR_BASE/lib -llti_lidar_dsdk"
 
1936
      MRSID_LIDAR_INCLUDE="-I$MRSID_LIDAR_BASE/include"
 
1937
    else
 
1938
      MRSID_LIDAR_LIBS="-L$MRSID_LIDAR_BASE/lib/Release -llti_lidar_dsdk"
 
1939
      MRSID_LIDAR_INCLUDE="-I$MRSID_LIDAR_BASE/include"
 
1940
    fi
 
1941
  fi
 
1942
fi
 
1943
 
 
1944
AC_SUBST(MRSID_LIDAR_INCLUDE,$MRSID_LIDAR_INCLUDE)
 
1945
AC_SUBST(MRSID_LIDAR_LIBS,$MRSID_LIDAR_LIBS)
 
1946
 
 
1947
if test "$HAVE_MRSID_LIDAR" != "no" ; then
 
1948
  OPT_GDAL_FORMATS="mrsid_lidar $OPT_GDAL_FORMATS"
 
1949
fi
1580
1950
 
1581
1951
dnl ---------------------------------------------------------------------------
1582
1952
dnl Enable MSG format if EUMETSAT Wavelet Transform Software
1784
2154
AC_SUBST([XERCES_INCLUDE], $XERCES_CFLAGS)
1785
2155
  
1786
2156
dnl ---------------------------------------------------------------------------
1787
 
dnl Enable NAS if we have Xerces, and a nas directory.
 
2157
dnl Enable NAS if we have Xerces.
1788
2158
dnl ---------------------------------------------------------------------------
1789
2159
 
1790
 
if test "$HAVE_XERCES" = "yes" -a -d ogr/ogrsf_frmts/nas ; then
 
2160
if test "$HAVE_XERCES" = "yes" ; then
1791
2161
  HAVE_NAS=yes
1792
2162
else
1793
2163
  HAVE_NAS=no
1808
2178
 
1809
2179
AC_SUBST([HAVE_EXPAT], $HAVE_EXPAT)
1810
2180
AC_SUBST([EXPAT_INCLUDE], $EXPAT_CFLAGS)
1811
 
 
 
2181
 
 
2182
dnl ---------------------------------------------------------------------------
 
2183
dnl Check for Google libkml support.
 
2184
dnl ---------------------------------------------------------------------------
 
2185
 
 
2186
LIBKML_REQ_VERSION="1.3.0"
 
2187
AX_LIB_LIBKML($LIBKML_REQ_VERSION)
 
2188
 
 
2189
if test "$HAVE_LIBKML" = "yes"; then
 
2190
    LIBS="$LIBKML_LDFLAGS $LIBS"
 
2191
fi
 
2192
 
 
2193
AC_SUBST([HAVE_LIBKML], $HAVE_LIBKML)
 
2194
AC_SUBST([LIBKML_INCLUDE], $LIBKML_CFLAGS)
 
2195
  
1812
2196
dnl ---------------------------------------------------------------------------
1813
2197
dnl Check for ODBC support.
1814
2198
dnl ---------------------------------------------------------------------------
1885
2269
    DODS_INC="-I$with_dods_root/include -I$with_dods_root/include/libdap -I$with_dods_root/include/dap"
1886
2270
    DODS_BIN=$with_dods_root/bin
1887
2271
 
1888
 
dnl Test if we have libdap < 3.9
1889
 
dnl Before libdap < 3.9, DAS derived from AttrTable class
1890
 
dnl I wish they had defines with version numbers instead of this test !
1891
 
rm -f islibdappre39.*
1892
 
echo '#include "DAS.h"' > islibdappre39.cpp
1893
 
echo '#include "AttrTable.h"' >> islibdappre39.cpp
1894
 
echo 'using namespace libdap;' >> islibdappre39.cpp
1895
 
echo 'int main(int argc, char** argv) { DAS oDAS; AttrTable& oAttrTable = oDAS; } ' >> islibdappre39.cpp
1896
 
if test -z "`${CXX} islibdappre39.cpp -c ${DODS_INC} 2>&1`" ; then
1897
 
dnl yes, libdap < 3.9
1898
 
    AC_MSG_RESULT([libdap < 3.9])
 
2272
dnl Test if we have libdap >= 3.10
 
2273
dnl From libdap 3.10, AISConnect.h has been renamed as Connect.h
 
2274
rm -f islibdappost310.*
 
2275
echo '#include "Connect.h"' > islibdappost310.cpp
 
2276
echo 'int main(int argc, char** argv) { return 0; } ' >> islibdappost310.cpp
 
2277
if test -z "`${CXX} islibdappost310.cpp -c ${DODS_INC} 2>&1`" ; then
 
2278
dnl yes, libdap >= 3.10
 
2279
    DODS_INC="$DODS_INC -DLIBDAP_310 -DLIBDAP_39"
 
2280
    AC_MSG_RESULT([libdap >= 3.10])
1899
2281
else
1900
 
    DODS_INC="$DODS_INC -DLIBDAP_39"
1901
 
    AC_MSG_RESULT([libdap >= 3.9])
 
2282
    AC_MSG_RESULT([libdap < 3.10])
 
2283
 
 
2284
    dnl Test if we have libdap < 3.9
 
2285
    dnl Before libdap < 3.9, DAS derived from AttrTable class
 
2286
    dnl I wish they had defines with version numbers instead of this test !
 
2287
    rm -f islibdappre39.*
 
2288
    echo '#include "DAS.h"' > islibdappre39.cpp
 
2289
    echo '#include "AttrTable.h"' >> islibdappre39.cpp
 
2290
    echo 'using namespace libdap;' >> islibdappre39.cpp
 
2291
    echo 'int main(int argc, char** argv) { DAS oDAS; AttrTable& oAttrTable = oDAS; } ' >> islibdappre39.cpp
 
2292
    if test -z "`${CXX} islibdappre39.cpp -c ${DODS_INC} 2>&1`" ; then
 
2293
    dnl yes, libdap < 3.9
 
2294
        AC_MSG_RESULT([libdap < 3.9])
 
2295
    else
 
2296
        DODS_INC="$DODS_INC -DLIBDAP_39"
 
2297
        AC_MSG_RESULT([libdap >= 3.9])
 
2298
    fi
 
2299
    rm -f islibdappre39.*
 
2300
 
1902
2301
fi
1903
 
rm -f islibdappre39.*
 
2302
rm -f islibdappost310.*
1904
2303
 
1905
2304
 
1906
2305
    dnl Add the DODS libraries to LIBS
1944
2343
dnl ---------------------------------------------------------------------------
1945
2344
dnl Check for curl (ie. for wcs).
1946
2345
dnl ---------------------------------------------------------------------------
 
2346
CURL_SETTING=no
 
2347
CURL_INC=
 
2348
CURL_LIB=
 
2349
 
1947
2350
AC_ARG_WITH(curl,
1948
2351
    [  --with-curl[=ARG]       Include curl (ARG=path to curl-config.)],,,)
1949
2352
 
1965
2368
 
1966
2369
  AC_MSG_RESULT([        found libcurl version $CURL_VER])
1967
2370
  
 
2371
  AC_CHECK_LIB(curl,curl_global_init,CURL_SETTING=yes,CURL_SETTING=no,`$LIBCURL_CONFIG --libs`)
 
2372
 
 
2373
fi
 
2374
 
 
2375
if test "$CURL_SETTING" = "yes" ; then
 
2376
  
1968
2377
  CURL_INC=`$LIBCURL_CONFIG --cflags`
1969
2378
  CURL_LIB=`$LIBCURL_CONFIG --libs`
1970
 
  CURL_SETTING=yes
1971
 
 
1972
2379
  OPT_GDAL_FORMATS="wcs wms $OPT_GDAL_FORMATS"
1973
 
else
1974
 
  CURL_SETTING=no
1975
 
  CURL_INC=
1976
 
  CURL_LIB=
 
2380
 
1977
2381
fi
1978
2382
 
1979
2383
AC_SUBST(CURL_SETTING,$CURL_SETTING)
1985
2389
dnl ---------------------------------------------------------------------------
1986
2390
 
1987
2391
AC_ARG_WITH(spatialite,
1988
 
    [  --with-spatialite=ARG Include SpatiaLite support (ARG=no or path)],
 
2392
    [  --with-spatialite=ARG Include SpatiaLite support (ARG=no(default), yes or path)],
1989
2393
    ,,)
1990
2394
 
 
2395
HAVE_SPATIALITE=no
 
2396
SPATIALITE_AMALGAMATION=no
 
2397
 
1991
2398
if test -z "$with_spatialite" -o "$with_spatialite" = "no"; then
1992
2399
    AC_MSG_RESULT(disabled)
1993
 
    HAVE_SPATIALITE=no
 
2400
elif test "$with_spatialite" = "yes"; then
 
2401
    AC_CHECK_HEADERS(sqlite3.h)
 
2402
    if test "$ac_cv_header_sqlite3_h" = "yes"; then
 
2403
        AC_MSG_CHECKING([for spatialite.h in /usr/include or /usr/local/include])
 
2404
        if test -f "/usr/include/spatialite.h" -o -f "/usr/local/include/spatialite.h"; then
 
2405
            AC_MSG_RESULT(found)
 
2406
            AC_CHECK_LIB(spatialite,spatialite_init,SPATIALITE_INIT_FOUND=yes,SPATIALITE_INIT_FOUND=no,)
 
2407
            if test "$SPATIALITE_INIT_FOUND" = "yes"; then
 
2408
                HAVE_SPATIALITE=yes
 
2409
                LIBS="$LIBS -lspatialite"
 
2410
                HAVE_SQLITE3=yes
 
2411
            fi
 
2412
        else
 
2413
            AC_MSG_RESULT(not found : spatialite support disabled)
 
2414
        fi
 
2415
    fi
1994
2416
else
1995
 
    AC_MSG_CHECKING(for SpatiaLite)
1996
2417
    AC_CHECK_LIB(spatialite,spatialite_init,SPATIALITE_INIT_FOUND=yes,SPATIALITE_INIT_FOUND=no,-L$with_spatialite/lib -lspatialite)
1997
2418
    if test -f "$with_spatialite/include/spatialite.h" -a \
1998
2419
        -f "$with_spatialite/include/spatialite/sqlite3.h" -a \
2000
2421
 
2001
2422
        AC_MSG_RESULT(enabled)
2002
2423
        HAVE_SPATIALITE=yes
 
2424
        SPATIALITE_AMALGAMATION=yes
2003
2425
 
2004
 
        # SpatiaLite availability implies SQLite availability
 
2426
        # SpatiaLite amalgamation availability implies SQLite availability
2005
2427
        # Caution : don't include the include/spatialite subdir in the include dir
2006
2428
        # as there's a spatialite.h file in it, which we don't want to include.
2007
2429
        # We want to include include/spatialite.h instead !
2008
2430
        SQLITE3_CFLAGS="-I$with_spatialite/include"
2009
2431
        LIBS="$LIBS -L$with_spatialite/lib -lspatialite"
2010
2432
        HAVE_SQLITE3=yes
 
2433
 
 
2434
    elif test -f "$with_spatialite/include/spatialite.h" -a \
 
2435
        "$SPATIALITE_INIT_FOUND" = "yes"; then
 
2436
        AC_CHECK_HEADERS(sqlite3.h)
 
2437
        if test "$ac_cv_header_sqlite3_h" = "yes"; then
 
2438
            AC_MSG_RESULT(enabled)
 
2439
            SPATIALITE_INC="-I$with_spatialite/include"
 
2440
            HAVE_SPATIALITE=yes
 
2441
            LIBS="$LIBS -L$with_spatialite/lib -lspatialite"
 
2442
            HAVE_SQLITE3=yes
 
2443
        fi
2011
2444
    else
2012
2445
        AC_MSG_RESULT(disabled)
2013
 
        HAVE_SPATIALITE=no
2014
2446
    fi
2015
2447
fi
2016
2448
 
2017
2449
AC_SUBST([HAVE_SPATIALITE], $HAVE_SPATIALITE)
 
2450
AC_SUBST([SPATIALITE_INC], $SPATIALITE_INC)
 
2451
AC_SUBST([SPATIALITE_AMALGAMATION], $SPATIALITE_AMALGAMATION)
2018
2452
 
2019
2453
dnl ---------------------------------------------------------------------------
2020
2454
dnl Check for SQLite (only if SpatiaLite is not detected)
2168
2602
      AC_MSG_ERROR("Could not find sdetype.h or libsde$SDE_VERSION.a/libsde$SDE_VERSION.so in $SDE_DIR.")
2169
2603
  fi
2170
2604
 
 
2605
  if test "`arch`" = "x86_64" ; then
 
2606
    AC_MSG_RESULT([        Adding -DSDE64 for 64bit platform.])
 
2607
    SDE_INC="$SDE_INC -DSDE64"
 
2608
  fi
 
2609
 
2171
2610
  SDE_ENABLED=yes
2172
2611
  OPT_GDAL_FORMATS="sde $OPT_GDAL_FORMATS"
2173
2612
  AC_MSG_RESULT([        using ESRI SDE from $SDE_DIR.])
2189
2628
 
2190
2629
AC_ARG_WITH(vfk,[  --without-vfk         Disable VFK support],,)
2191
2630
 
 
2631
HAVE_VFK=no
 
2632
 
2192
2633
if test "$with_vfk" = "no"; then
2193
2634
  AC_MSG_RESULT([no])
2194
 
  HAVE_VFK=no
2195
2635
else
2196
 
  AC_MSG_RESULT([yes])
2197
 
  HAVE_VFK=yes
 
2636
 
 
2637
    # Check that C++ compiler isn't too broken
 
2638
    rm -f testrlist.*
 
2639
    echo '#include <vector>' > testrlist.cpp
 
2640
    echo 'int main(int argc, char** argv) { std::vector<int> a, b; a.insert(a.begin(), b.rbegin(), b.rend()); return 0; } ' >> testrlist.cpp
 
2641
    if test -z "`${CXX} testrlist.cpp -c 2>&1`" ; then
 
2642
        AC_MSG_RESULT([yes])
 
2643
        HAVE_VFK=yes
 
2644
    else
 
2645
        AC_MSG_RESULT([disabled, broken C++ compiler])
 
2646
    fi
 
2647
    rm -f testrlist.*
2198
2648
fi
2199
2649
 
2200
2650
AC_SUBST(HAVE_VFK)
2235
2685
fi
2236
2686
 
2237
2687
dnl ---------------------------------------------------------------------------
 
2688
dnl Check if webp library is available.
 
2689
dnl ---------------------------------------------------------------------------
 
2690
 
 
2691
AC_ARG_WITH(webp,[  --with-webp[=ARG]    Include WEBP support (ARG=no, yes or libwebp install root path)],,)
 
2692
 
 
2693
WEBP_SETTING=no
 
2694
 
 
2695
if test "$with_webp" = "yes" ; then
 
2696
 
 
2697
  AC_CHECK_LIB(webp,WebPDecodeRGB,WEBP_SETTING=yes,WEBP_SETTING=no,)
 
2698
 
 
2699
  if test "$WEBP_SETTING" = "yes" ; then
 
2700
    LIBS="-lwebp $LIBS"
 
2701
  else
 
2702
    echo "libwebp not found - WEBP support disabled"
 
2703
  fi
 
2704
 
 
2705
elif test "$with_webp" != "no" -a "$with_webp" != ""; then
 
2706
 
 
2707
  AC_CHECK_LIB(webp,WebPDecodeRGB,WEBP_SETTING=yes,WEBP_SETTING=no,-L$with_webp/lib -lwebp)
 
2708
 
 
2709
  if test "$WEBP_SETTING" = "yes" ; then
 
2710
    LIBS="-L$with_webp/lib -lwebp $LIBS"
 
2711
    EXTRA_INCLUDES="-I$with_webp/include $EXTRA_INCLUDES"
 
2712
  else
 
2713
    echo "libwebp not found - WEBP support disabled"
 
2714
  fi
 
2715
 
 
2716
fi
 
2717
 
 
2718
if test "$WEBP_SETTING" != "no" ; then
 
2719
  OPT_GDAL_FORMATS="webp $OPT_GDAL_FORMATS"
 
2720
fi
 
2721
 
 
2722
dnl ---------------------------------------------------------------------------
2238
2723
dnl Check if geos library is available.
2239
2724
dnl ---------------------------------------------------------------------------
2240
2725
 
2248
2733
fi
2249
2734
 
2250
2735
dnl ---------------------------------------------------------------------------
2251
 
dnl Check if geos library is available.
 
2736
dnl Check if opencl library is available.
 
2737
dnl ---------------------------------------------------------------------------
 
2738
 
 
2739
OPENCL_SETTING=no
 
2740
OPENCL_FLAGS=
 
2741
OPENCL_LIB=
 
2742
 
 
2743
AC_ARG_WITH(opencl,
 
2744
    [  --with-opencl[=ARG]       Include OpenCL (GPU) support],,,)
 
2745
 
 
2746
AC_MSG_CHECKING([for OpenCL support])
 
2747
 
 
2748
if test "$with_opencl" = "yes" ; then
 
2749
 
 
2750
  AC_ARG_WITH(opencl-include,
 
2751
      [  --with-opencl-include=ARG OpenCL Include directory (with a CL subdirectory)],,,)
 
2752
 
 
2753
  OPENCL_SETTING=yes
 
2754
 
 
2755
  if test "x$with_opencl_include" = "x" ; then
 
2756
    OPENCL_FLAGS=-DHAVE_OPENCL
 
2757
  else
 
2758
    OPENCL_FLAGS="-I$with_opencl_include -DHAVE_OPENCL"
 
2759
  fi
 
2760
    
 
2761
  AC_ARG_WITH(opencl-lib,
 
2762
      [  --with-opencl-lib=ARG   OpenCL Link Flags (ie. -L/xxx -lOpenCL)],,,)
 
2763
     
 
2764
  if test "x$with_opencl_lib" = "x" ; then
 
2765
    if test ! -z "`uname | grep Darwin`" ; then
 
2766
      OPENCL_LIB="-framework OpenCL"
 
2767
    else
 
2768
      OPENCL_LIB=-lOpenCL
 
2769
    fi
 
2770
  else
 
2771
    OPENCL_LIB="$with_opencl_lib"
 
2772
  fi
 
2773
 
 
2774
fi
 
2775
 
 
2776
AC_MSG_RESULT([$OPENCL_SETTING])
 
2777
 
 
2778
AC_SUBST(OPENCL_FLAGS,  $OPENCL_FLAGS)
 
2779
AC_SUBST(OPENCL_LIB,    $OPENCL_LIB)
 
2780
 
 
2781
 
 
2782
dnl ---------------------------------------------------------------------------
 
2783
dnl Check if FreeXL library is available.
 
2784
dnl ---------------------------------------------------------------------------
 
2785
 
 
2786
AC_ARG_WITH(freexl,[  --with-freexl[=ARG]    Include freexl support (ARG=no, yes (default) or libfreexl install path)],,)
 
2787
 
 
2788
AC_MSG_CHECKING([for FreeXL support])
 
2789
 
 
2790
HAVE_FREEXL=no
 
2791
FREEXL_INCLUDE=
 
2792
 
 
2793
if test "$with_freexl" = "" -o "$with_freexl" = "yes" ; then
 
2794
  AC_CHECK_HEADERS(freexl.h)
 
2795
  AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-lfreexl",FREEXL_LIBS=missing)
 
2796
 
 
2797
  if test "$FREEXL_LIBS" = "missing"; then
 
2798
    unset ac_cv_lib_freexl_freexl_open
 
2799
    AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-lfreexl -liconv",FREEXL_LIBS=missing,-liconv)
 
2800
  fi
 
2801
 
 
2802
  if test "$FREEXL_LIBS" = "missing"; then
 
2803
    unset ac_cv_lib_freexl_freexl_open
 
2804
    AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-lfreexl -liconv -lcharset",FREEXL_LIBS=missing,-liconv -lcharset)
 
2805
  fi
 
2806
 
 
2807
  if test "$FREEXL_LIBS" != "missing" -a "$ac_cv_header_freexl_h" = "yes" ; then
 
2808
 
 
2809
    # Check that freexl is recent enough
 
2810
    rm -f testrlist.*
 
2811
    echo '#include <freexl.h>' > testfreexl.c
 
2812
    echo 'int main(int argc, char** argv) { FreeXL_CellValue s; freexl_get_cell_value (0,0,0,&s); return 0; } ' >> testfreexl.c
 
2813
    if test -z "`${CC} testfreexl.c -c 2>&1`" ; then
 
2814
        HAVE_FREEXL=yes
 
2815
        LIBS="$FREEXL_LIBS $LIBS"
 
2816
    else
 
2817
        HAVE_FREEXL=no
 
2818
        AC_MSG_RESULT([freexl too old. Needs freexl >= 1.0])
 
2819
    fi
 
2820
    rm -f testfreexl.*
 
2821
 
 
2822
  else
 
2823
    HAVE_FREEXL=no
 
2824
    echo "libfreexl not found - FreeXL support disabled"
 
2825
  fi
 
2826
 
 
2827
elif test "$with_freexl" != "no"; then
 
2828
 
 
2829
  AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-L$with_freexl/lib -lfreexl",FREEXL_LIBS=missing,-L$with_freexl/lib)
 
2830
 
 
2831
  if test "$FREEXL_LIBS" = "missing"; then
 
2832
    unset ac_cv_lib_freexl_freexl_open
 
2833
    AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-L$with_freexl/lib -lfreexl -liconv",FREEXL_LIBS=missing,-L$with_freexl/lib -liconv)
 
2834
  fi
 
2835
 
 
2836
  if test "$FREEXL_LIBS" = "missing"; then
 
2837
    unset ac_cv_lib_freexl_freexl_open
 
2838
    AC_CHECK_LIB(freexl,freexl_open,FREEXL_LIBS="-L$with_freexl/lib -lfreexl -liconv -lcharset",FREEXL_LIBS=missing,-L$with_freexl/lib -liconv -lcharset)
 
2839
  fi
 
2840
 
 
2841
  if test "FREEXL_LIBS" != "missing" -a -f "$with_freexl/include/freexl.h" ; then
 
2842
 
 
2843
    # Check that freexl is recent enough
 
2844
    rm -f testrlist.*
 
2845
    echo '#include <freexl.h>' > testfreexl.c
 
2846
    echo 'int main(int argc, char** argv) { FreeXL_CellValue s; freexl_get_cell_value (0,0,0,&s); return 0; } ' >> testfreexl.c
 
2847
    if test -z "`${CC} -I$with_freexl/include testfreexl.c -c 2>&1`" ; then
 
2848
        HAVE_FREEXL=yes
 
2849
        LIBS="$FREEXL_LIBS $LIBS"
 
2850
        FREEXL_INCLUDE="-I$with_freexl/include"
 
2851
    else
 
2852
        HAVE_FREEXL=no
 
2853
        AC_MSG_RESULT([freexl too old. Needs freexl >= 1.0])
 
2854
    fi
 
2855
    rm -f testfreexl.*
 
2856
 
 
2857
  else
 
2858
    HAVE_FREEXL=no
 
2859
    echo "libfreexl not found - FreeXL support disabled"
 
2860
  fi
 
2861
 
 
2862
fi
 
2863
 
 
2864
AC_SUBST(HAVE_FREEXL,  $HAVE_FREEXL)
 
2865
AC_SUBST(FREEXL_INCLUDE,  $FREEXL_INCLUDE)
 
2866
 
 
2867
dnl ---------------------------------------------------------------------------
 
2868
dnl Check if we must enable PAM
2252
2869
dnl ---------------------------------------------------------------------------
2253
2870
 
2254
2871
AC_MSG_CHECKING([whether to enable PAM])
2267
2884
AC_SUBST(PAM_SETTING, $PAM_SETTING)
2268
2885
 
2269
2886
dnl ---------------------------------------------------------------------------
 
2887
dnl Check if libpoppler is available
 
2888
dnl ---------------------------------------------------------------------------
 
2889
 
 
2890
AC_ARG_WITH(poppler,[  --with-poppler[=ARG]    Include poppler(for PDF) support (ARG=no(default), yes or poppler install path)],,)
 
2891
 
 
2892
HAVE_POPPLER=no
 
2893
POPPLER_HAS_OPTCONTENT=no
 
2894
POPPLER_BASE_STREAM_HAS_TWO_ARGS=no
 
2895
 
 
2896
AC_MSG_CHECKING([for poppler])
 
2897
 
 
2898
if test "$with_poppler" != "no" -a "$with_poppler" != ""; then
 
2899
 
 
2900
    if test "$with_poppler" = "yes" ; then
 
2901
        TEST_POPPLER_INC="-I/usr/include -I/usr/include/poppler"
 
2902
        TEST_POPPLER_LIB="-lpoppler"
 
2903
    else
 
2904
        TEST_POPPLER_INC="-I$with_poppler/include -I$with_poppler/include/poppler"
 
2905
        TEST_POPPLER_LIB="-L$with_poppler/lib -lpoppler"
 
2906
    fi
 
2907
 
 
2908
    # Check that we can accept Page::pageObj private member
 
2909
    rm -f testpoppler.*
 
2910
    echo '#define private public' > testpoppler.cpp
 
2911
    echo '#include <poppler/Page.h>' >> testpoppler.cpp
 
2912
    echo '#include <poppler/splash/SplashBitmap.h>' >> testpoppler.cpp
 
2913
    echo 'int main(int argc, char** argv) { return &(((Page*)0x8000)->pageObj) == 0; } ' >> testpoppler.cpp
 
2914
    if test -z "`${CXX} testpoppler.cpp -o testpoppler ${TEST_POPPLER_INC} ${TEST_POPPLER_LIB} 2>&1`" ; then
 
2915
        HAVE_POPPLER=yes
 
2916
        LIBS="${TEST_POPPLER_LIB} ${LIBS}"
 
2917
        OPT_GDAL_FORMATS="pdf $OPT_GDAL_FORMATS"
 
2918
        AC_MSG_RESULT([yes])
 
2919
        POPPLER_INC=$TEST_POPPLER_INC
 
2920
 
 
2921
        # And now try another dirty thing, but this one is
 
2922
        # optional.
 
2923
        AC_MSG_CHECKING([if Catalog::optContent exists])
 
2924
        rm -f testpoppler.*
 
2925
        echo '#define private public' > testpoppler.cpp
 
2926
        echo '#include <poppler/Object.h>' >> testpoppler.cpp
 
2927
        echo '#include <poppler/Catalog.h>' >> testpoppler.cpp
 
2928
        echo 'int main(int argc, char** argv) { return &(((Catalog*)0x8000)->optContent) == 0; }' >> testpoppler.cpp
 
2929
        if test -z "`${CXX} testpoppler.cpp -c ${POPPLER_INC} 2>&1`" ; then
 
2930
            POPPLER_HAS_OPTCONTENT=yes
 
2931
            AC_MSG_RESULT([yes])
 
2932
        else
 
2933
            AC_MSG_RESULT([no])
 
2934
        fi
 
2935
 
 
2936
        # And now we check if we have Poppler >= 0.16.0
 
2937
        AC_MSG_CHECKING([if BaseStream constructor needs 2 arguments])
 
2938
        rm -f testpoppler.*
 
2939
        echo '#include <poppler/Object.h>' > testpoppler.cpp
 
2940
        echo '#include <poppler/Stream.h>' >> testpoppler.cpp
 
2941
        echo 'class TestStream: public BaseStream {' >> testpoppler.cpp
 
2942
        echo 'public:' >> testpoppler.cpp
 
2943
        echo '  TestStream() : BaseStream(0,0) {}' >> testpoppler.cpp
 
2944
        echo '  ~TestStream() {}' >> testpoppler.cpp
 
2945
        echo '  virtual Stream *makeSubStream(Guint start, GBool limited, Guint length, Object *dict) { return 0; }' >> testpoppler.cpp
 
2946
        echo '  virtual void setPos(Guint pos, int dir = 0) { }' >> testpoppler.cpp
 
2947
        echo '  virtual Guint getStart() { return 0; }' >> testpoppler.cpp
 
2948
        echo '  virtual void moveStart(int delta) { }' >> testpoppler.cpp
 
2949
        echo '};' >> testpoppler.cpp
 
2950
        echo 'int main(int argc, char** argv) { return 0; }' >> testpoppler.cpp
 
2951
        if test -z "`${CXX} testpoppler.cpp -c ${POPPLER_INC} 2>&1`" ; then
 
2952
            POPPLER_BASE_STREAM_HAS_TWO_ARGS=yes
 
2953
            AC_MSG_RESULT([yes])
 
2954
        else
 
2955
            AC_MSG_RESULT([no])
 
2956
        fi
 
2957
    else
 
2958
        AC_MSG_RESULT([no])
 
2959
    fi
 
2960
    rm -f testpoppler.*
 
2961
    rm -f testpoppler
 
2962
else
 
2963
    AC_MSG_RESULT([disabled])
 
2964
fi
 
2965
 
 
2966
AC_SUBST(HAVE_POPPLER, $HAVE_POPPLER)
 
2967
AC_SUBST(POPPLER_HAS_OPTCONTENT, $POPPLER_HAS_OPTCONTENT)
 
2968
AC_SUBST(POPPLER_BASE_STREAM_HAS_TWO_ARGS, $POPPLER_BASE_STREAM_HAS_TWO_ARGS)
 
2969
AC_SUBST(POPPLER_INC, $POPPLER_INC)
 
2970
 
 
2971
dnl ---------------------------------------------------------------------------
 
2972
dnl Check if libpodofo is available
 
2973
dnl ---------------------------------------------------------------------------
 
2974
 
 
2975
AC_ARG_WITH(podofo,[  --with-podofo[=ARG]    Include podofo(for PDF) support (ARG=no(default), yes or podofo install path)],,)
 
2976
 
 
2977
HAVE_PODOFO=no
 
2978
 
 
2979
AC_MSG_CHECKING([for podofo])
 
2980
 
 
2981
if test "$with_podofo" != "no" -a "$with_podofo" != ""; then
 
2982
 
 
2983
    AC_ARG_WITH(podofo-lib,
 
2984
      [  --with-podofo-lib=ARG   podofo Link Flags (ie. -L/xxx -lpodofo ...). Mainly for static libpodofo],,,)
 
2985
 
 
2986
    if test "$HAVE_POPPLER" = "yes"; then
 
2987
        AC_MSG_ERROR([--with-podofo and --with-poppler cannot be specified at the same time])
 
2988
    fi
 
2989
 
 
2990
    if test "$with_podofo" = "yes" ; then
 
2991
        TEST_PODOFO_INC="-I/usr/include -I/usr/include/podofo"
 
2992
        PODOFO_LIB="-lpodofo"
 
2993
    else
 
2994
        TEST_PODOFO_INC="-I$with_podofo/include -I$with_podofo/include/podofo"
 
2995
        PODOFO_LIB="-L$with_podofo/lib -lpodofo"
 
2996
    fi
 
2997
 
 
2998
    if test "x$with_podofo_lib" = "x" ; then
 
2999
        rm -f testpodofo.*
 
3000
        echo '#include <podofo.h>' > testpodofo.cpp
 
3001
        echo 'int main(int argc, char** argv) { PoDoFo::PdfError::EnableDebug( 0 ); return 0; } ' >> testpodofo.cpp
 
3002
        if test -z "`${CXX} testpodofo.cpp -o testpodofo ${TEST_PODOFO_INC} ${PODOFO_LIB}  2>&1`" ; then
 
3003
            HAVE_PODOFO=yes
 
3004
            LIBS="${PODOFO_LIB} ${LIBS}"
 
3005
            OPT_GDAL_FORMATS="pdf $OPT_GDAL_FORMATS"
 
3006
            PODOFO_INC=$TEST_PODOFO_INC
 
3007
            AC_MSG_RESULT([yes])
 
3008
        fi
 
3009
        rm -f testpodofo.*
 
3010
        rm -f testpodofo
 
3011
    fi
 
3012
 
 
3013
    if test "$HAVE_PODOFO" = "no"; then
 
3014
        if test "x$with_podofo_lib" != "x" ; then
 
3015
            PODOFO_LIB="$with_podofo_lib"
 
3016
        else
 
3017
            # This may be a static libpodofo.a, so add dependant libraries
 
3018
            PODOFO_LIB="$PODOFO_LIB -lfreetype -lfontconfig -lpthread"
 
3019
        fi
 
3020
 
 
3021
        AC_ARG_WITH(podofo-extra-lib-for-test,
 
3022
          [  --with-podofo-extra-lib-for-test=ARG   Additional libraries to pass the detection test, but not used for libgdal linking (ie. -ljpeg ...). Mainly for static libpodofo],,,)
 
3023
 
 
3024
        if test "x$with_podofo_extra_lib_for_test" = "x" ; then
 
3025
            TEST_PODOFO_LIB="$PODOFO_LIB"
 
3026
        else
 
3027
            TEST_PODOFO_LIB="$PODOFO_LIB $with_podofo_extra_lib_for_test"
 
3028
        fi
 
3029
 
 
3030
        rm -f testpodofo.*
 
3031
        echo '#include <podofo.h>' > testpodofo.cpp
 
3032
        echo 'int main(int argc, char** argv) { PoDoFo::PdfError::EnableDebug( 0 ); return 0; } ' >> testpodofo.cpp
 
3033
        if test -z "`${CXX} testpodofo.cpp -o testpodofo ${TEST_PODOFO_INC} ${TEST_PODOFO_LIB} 2>&1`" ; then
 
3034
            HAVE_PODOFO=yes
 
3035
            LIBS="${PODOFO_LIB} ${LIBS}"
 
3036
            OPT_GDAL_FORMATS="pdf $OPT_GDAL_FORMATS"
 
3037
            PODOFO_INC=$TEST_PODOFO_INC
 
3038
            AC_MSG_RESULT([yes])
 
3039
        else
 
3040
            AC_MSG_RESULT([no])
 
3041
        fi
 
3042
        rm -f testpodofo.*
 
3043
        rm -f testpodofo
 
3044
    fi
 
3045
else
 
3046
    AC_MSG_RESULT([disabled])
 
3047
fi
 
3048
 
 
3049
AC_SUBST(HAVE_PODOFO, $HAVE_PODOFO)
 
3050
AC_SUBST(PODOFO_INC, $PODOFO_INC)
 
3051
 
 
3052
dnl ---------------------------------------------------------------------------
2270
3053
dnl PROJ.4 related stuff.
2271
3054
dnl ---------------------------------------------------------------------------
2272
3055
 
2542
3325
AC_SUBST([PY_HAVE_SETUPTOOLS])
2543
3326
AC_SUBST([BINDINGS])
2544
3327
 
2545
 
 
 
3328
dnl ---------------------------------------------------------------------------
 
3329
dnl Java support
 
3330
dnl ---------------------------------------------------------------------------
 
3331
 
 
3332
AC_ARG_WITH(java,[  --with-java       Include Java support (ARG=yes, no or JDK home path)  [[default=no]]],,)
 
3333
 
 
3334
AC_MSG_CHECKING([whether we should include Java support])
 
3335
 
 
3336
JAVA_HOME=""
 
3337
JAVA_INC=""
 
3338
 
 
3339
if test "x$with_java" = "xyes"; then
 
3340
 
 
3341
dnl Ubuntu
 
3342
    if test -d /usr/lib/jvm/java-6-openjdk; then
 
3343
        with_java="/usr/lib/jvm/java-6-openjdk"
 
3344
 
 
3345
dnl RHEL6
 
3346
    elif test -d /usr/lib/jvm/java-openjdk; then
 
3347
        with_java="/usr/lib/jvm/java-openjdk"
 
3348
 
 
3349
dnl    elif test -d /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers; then
 
3350
dnl        JAVA_INC="-I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers"
 
3351
 
 
3352
dnl OpenSolaris
 
3353
    elif test -d /usr/java; then
 
3354
        with_java="/usr/java"
 
3355
    else
 
3356
        AC_MSG_ERROR("cannot find JDK root directory.")
 
3357
    fi
 
3358
 
 
3359
    if test \! -d "$with_java/include" ; then
 
3360
        AC_MSG_ERROR("$with_java is not a valid JDK.")
 
3361
    fi
 
3362
fi
 
3363
 
 
3364
if test "x$JAVA_INC" != "x"; then
 
3365
    AC_MSG_RESULT([yes])
 
3366
elif test "x$with_java" != "x" -a "x$with_java" != "xno"; then
 
3367
 
 
3368
    if test -d "$with_java/include"; then
 
3369
        if test -d "$with_java/include/linux"; then
 
3370
            JAVA_HOME="$with_java"
 
3371
            JAVA_INC="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
 
3372
            AC_MSG_RESULT([yes])
 
3373
        elif test -d "$with_java/include/solaris"; then
 
3374
            JAVA_HOME="$with_java"
 
3375
            JAVA_INC="-I$JAVA_HOME/include -I$JAVA_HOME/include/solaris"
 
3376
            AC_MSG_RESULT([yes])
 
3377
        elif test -d "$with_java/include/freebsd"; then
 
3378
            JAVA_HOME="$with_java"
 
3379
            JAVA_INC="-I$JAVA_HOME/include -I$JAVA_HOME/include/freebsd"
 
3380
            AC_MSG_RESULT([yes])
 
3381
        else
 
3382
            AC_MSG_ERROR("Cannot find $with_java/include/linux or solaris or freebsd directory.")
 
3383
        fi
 
3384
    else
 
3385
        AC_MSG_ERROR("Cannot find $with_java/include directory.")
 
3386
    fi
 
3387
 
 
3388
else
 
3389
    AC_MSG_RESULT([no])
 
3390
fi
 
3391
 
 
3392
AC_SUBST(JAVA_HOME,$JAVA_HOME)
 
3393
AC_SUBST(JAVA_INC,$JAVA_INC)
 
3394
 
 
3395
dnl ---------------------------------------------------------------------------
 
3396
dnl MDB driver
 
3397
dnl ---------------------------------------------------------------------------
 
3398
 
 
3399
AC_ARG_WITH(mdb,[  --with-mdb       Include MDB driver],,)
 
3400
 
 
3401
AC_MSG_CHECKING([whether we should include MDB support])
 
3402
 
 
3403
MDB_ENABLED=no
 
3404
JVM_LIB=""
 
3405
 
 
3406
if test "$with_mdb" = "yes" ; then
 
3407
    if test "x$JAVA_INC" = "x"; then
 
3408
        AC_MSG_ERROR("--with-java must be specified.")
 
3409
    fi
 
3410
 
 
3411
    AC_ARG_WITH(jvm-lib,          [  --with-jvm-lib=[ARG]        ARG points to Java libjvm path],,)
 
3412
 
 
3413
    AC_ARG_WITH(jvm-lib-add-rpath,[  --with-jvm-lib-add-rpath    Add the libjvm path to the RPATH (no by default)],,)
 
3414
 
 
3415
    if test "x$with_jvm_lib" != "x"; then
 
3416
        if test -d "$with_jvm_lib"; then
 
3417
            saved_LDFLAGS="$LDFLAGS"
 
3418
            LDFLAGS="$LDFLAGS -L$with_jvm_lib"
 
3419
            AC_CHECK_LIB(jvm,JNI_CreateJavaVM,HAS_LIB_JVM=yes,HAS_LIB_JVM=no,)
 
3420
            LDFLAGS="$saved_LDFLAGS"
 
3421
            if test "$HAS_LIB_JVM" = "yes"; then
 
3422
                JVM_LIB="-L$with_jvm_lib -ljvm"
 
3423
                if test "x$with_jvm_lib_add_rpath" = "xyes"; then
 
3424
                    JVM_LIB="-Wl,-rpath=$with_jvm_lib $JVM_LIB"
 
3425
                fi
 
3426
            else
 
3427
                AC_MSG_ERROR("--with-jvm-lib must point to a directory with a libjvm.")
 
3428
            fi
 
3429
        else
 
3430
            AC_MSG_ERROR("--with-jvm-lib must point to a directory.")
 
3431
        fi
 
3432
    elif test "x$JAVA_HOME" != "x"; then
 
3433
        TEST_DIR="$JAVA_HOME/jre/lib/amd64/server"
 
3434
        if test "x$JVM_LIB" = "x" -a -d "$TEST_DIR"; then
 
3435
            unset ac_cv_lib_jvm_JNI_CreateJavaVM
 
3436
            saved_LDFLAGS="$LDFLAGS"
 
3437
            LDFLAGS="$LDFLAGS -L$TEST_DIR"
 
3438
            AC_CHECK_LIB(jvm,JNI_CreateJavaVM,HAS_LIB_JVM=yes,HAS_LIB_JVM=no,)
 
3439
            LDFLAGS="$saved_LDFLAGS"
 
3440
            if test "$HAS_LIB_JVM" = "yes"; then
 
3441
                JVM_LIB="-L$TEST_DIR -ljvm"
 
3442
                if test "x$with_jvm_lib_add_rpath" = "xyes"; then
 
3443
                    JVM_LIB="-Wl,-rpath=$TEST_DIR $JVM_LIB"
 
3444
                fi
 
3445
            fi
 
3446
        fi
 
3447
 
 
3448
        TEST_DIR="$JAVA_HOME/jre/lib/i386/server"
 
3449
        if test "x$JVM_LIB" = "x" -a -d "$TEST_DIR"; then
 
3450
            unset ac_cv_lib_jvm_JNI_CreateJavaVM
 
3451
            saved_LDFLAGS="$LDFLAGS"
 
3452
            LDFLAGS="$LDFLAGS -L$TEST_DIR"
 
3453
            AC_CHECK_LIB(jvm,JNI_CreateJavaVM,HAS_LIB_JVM=yes,HAS_LIB_JVM=no,)
 
3454
            LDFLAGS="$saved_LDFLAGS"
 
3455
            if test "$HAS_LIB_JVM" = "yes"; then
 
3456
                JVM_LIB="-L$TEST_DIR -ljvm"
 
3457
                if test "x$with_jvm_lib_add_rpath" = "xyes"; then
 
3458
                    JVM_LIB="-Wl,-rpath=$TEST_DIR $JVM_LIB"
 
3459
                fi
 
3460
            fi
 
3461
        fi
 
3462
 
 
3463
        if test "x$JVM_LIB" = "x"; then
 
3464
            AC_MSG_ERROR("--with-jvm-lib must be specified.")
 
3465
        fi
 
3466
dnl    elif test -f /System/Library/Frameworks/JavaVM.framework/Versions/Current/JavaVM; then
 
3467
dnl        JVM_LIB="-framework /System/Library/Frameworks/JavaVM.framework/Versions/Current/JavaVM"
 
3468
    else
 
3469
        AC_MSG_ERROR("--with-jvm-lib must be specified.")
 
3470
    fi
 
3471
 
 
3472
    MDB_ENABLED=yes
 
3473
    AC_MSG_RESULT([yes])
 
3474
 
 
3475
else
 
3476
    AC_MSG_RESULT([no])
 
3477
fi
 
3478
 
 
3479
AC_SUBST(MDB_ENABLED,$MDB_ENABLED)
 
3480
AC_SUBST(JVM_LIB,$JVM_LIB)
 
3481
 
 
3482
 
 
3483
dnl ---------------------------------------------------------------------------
 
3484
dnl Select Rasdaman or disable driver.
 
3485
dnl ---------------------------------------------------------------------------
 
3486
 
 
3487
RASDAMAN_ENABLED=no
 
3488
 
 
3489
AC_CHECKING(whether we should include rasdaman support)
 
3490
AC_ARG_WITH(rasdaman,
 
3491
[  --with-rasdaman[=DIR]        Include rasdaman support (DIR is rasdaman's install dir).],,)
 
3492
 
 
3493
if test "$with_rasdaman" = "yes" ; then
 
3494
 
 
3495
  AC_CHECK_LIB(raslib,main,RASDAMAN_ENABLED=yes,,,)
 
3496
 
 
3497
  if test -n "$RASDAMAN_ENABLED" ; then
 
3498
      RASDAMAN_LIB="-lrasodmg -lclientcomm -lcompression -lnetwork -lraslib"
 
3499
      OPT_GDAL_FORMATS="rasdaman $OPT_GDAL_FORMATS"
 
3500
      AC_MSG_RESULT([        using rasdaman from system libs.])
 
3501
  else
 
3502
      AC_MSG_WARN([        rasdaman not found in system libs... use --with-rasdaman=DIR.])
 
3503
  fi
 
3504
 
 
3505
elif test -n "$with_rasdaman" -a "$with_rasdaman" != "no" ; then
 
3506
 
 
3507
  RASDAMAN_DIR=$with_rasdaman
 
3508
 
 
3509
  if test -f $RASDAMAN_DIR/include/rasdaman.hh -a -d$RASDAMAN_DIR/lib ; then
 
3510
      RASDAMAN_INC=-I$RASDAMAN_DIR/include
 
3511
      RASDAMAN_LIB="-L$RASDAMAN_DIR/lib -lrasodmg -lclientcomm -lcompression -lnetwork -lraslib"
 
3512
  else
 
3513
      AC_MSG_ERROR("Could not find rasdaman.hh or libraslib.a in $RASDAMAN_DIR.")
 
3514
  fi
 
3515
 
 
3516
  RASDAMAN_ENABLED=yes
 
3517
  OPT_GDAL_FORMATS="rasdaman $OPT_GDAL_FORMATS"
 
3518
  AC_MSG_RESULT([        using rasdaman from $RASDAMAN_DIR.])
 
3519
 
 
3520
else
 
3521
 
 
3522
  AC_MSG_RESULT([        rasdaman support not requested.])
 
3523
fi
 
3524
 
 
3525
AC_SUBST(RASDAMAN_ENABLED,$RASDAMAN_ENABLED)
 
3526
AC_SUBST(RASDAMAN_INC,    $RASDAMAN_INC)
 
3527
AC_SUBST(RASDAMAN_LIB,    $RASDAMAN_LIB)
 
3528
 
 
3529
dnl ---------------------------------------------------------------------------
 
3530
dnl Armadillo support
 
3531
dnl ---------------------------------------------------------------------------
 
3532
 
 
3533
AC_ARG_WITH(armadillo,[  --with-armadillo=ARG       Include Armadillo support for faster TPS transform computation (ARG=yes/no) [[default=no]]],,)
 
3534
 
 
3535
AC_MSG_CHECKING([whether we should include Armadillo support])
 
3536
 
 
3537
HAVE_ARMADILLO=no
 
3538
 
 
3539
if test "$with_armadillo" = "yes" ; then
 
3540
    rm -f testarmadillo.*
 
3541
    rm -f testarmadillo
 
3542
    echo '#include <armadillo>' > testarmadillo.cpp
 
3543
    echo 'int main(int argc, char** argv) { arma::mat matInput(2,2); const arma::mat& matInv = arma::inv(matInput); return 0; } ' >> testarmadillo.cpp
 
3544
    if test -z "`${CXX} testarmadillo.cpp -o testarmadillo -larmadillo 2>&1`" ; then
 
3545
        HAVE_ARMADILLO=yes
 
3546
        LIBS="-larmadillo ${LIBS}"
 
3547
        AC_MSG_RESULT([yes])
 
3548
    else
 
3549
        AC_MSG_RESULT([no])
 
3550
    fi
 
3551
    rm -f testarmadillo.*
 
3552
    rm -f testarmadillo
 
3553
else
 
3554
    AC_MSG_RESULT([no])
 
3555
fi
 
3556
 
 
3557
AC_SUBST(HAVE_ARMADILLO,$HAVE_ARMADILLO)
2546
3558
 
2547
3559
 
2548
3560
AC_OUTPUT(GDALmake.opt)
2561
3573
LOC_MSG([  LIBTOOL support:           ${with_libtool}])
2562
3574
LOC_MSG()
2563
3575
LOC_MSG([  LIBZ support:              ${LIBZ_SETTING}])
 
3576
LOC_MSG([  LIBLZMA support:           ${LIBLZMA_SETTING}])
2564
3577
LOC_MSG([  GRASS support:             ${GRASS_SETTING}])
2565
3578
LOC_MSG([  CFITSIO support:           ${FITS_SETTING}])
2566
3579
LOC_MSG([  PCRaster support:          ${PCRASTER_SETTING}])
2567
 
LOC_MSG([  NetCDF support:            ${NETCDF_SETTING}])
2568
3580
LOC_MSG([  LIBPNG support:            ${PNG_SETTING}])
 
3581
LOC_MSG([  GTA support:               ${GTA_SETTING}]) 
2569
3582
LOC_MSG([  LIBTIFF support:           ${TIFF_SETTING} (BigTIFF=${HAVE_BIGTIFF})])
2570
3583
LOC_MSG([  LIBGEOTIFF support:        ${GEOTIFF_SETTING}])
2571
3584
LOC_MSG([  LIBJPEG support:           ${JPEG_SETTING}])
2574
3587
LOC_MSG([  OGDI support:              ${HAVE_OGDI}])
2575
3588
LOC_MSG([  HDF4 support:              ${HAVE_HDF4}])
2576
3589
LOC_MSG([  HDF5 support:              ${HAVE_HDF5}])
 
3590
LOC_MSG([  NetCDF support:            ${NETCDF_SETTING}])
2577
3591
LOC_MSG([  Kakadu support:            ${HAVE_KAKADU}])
2578
3592
if test "x$HAVE_JASPER_UUID" != "x" ; then
2579
3593
  LOC_MSG([  JasPer support:            ${HAVE_JASPER} (GeoJP2=${HAVE_JASPER_UUID})])
2580
3594
else
2581
3595
  LOC_MSG([  JasPer support:            ${HAVE_JASPER}])
2582
3596
fi
 
3597
LOC_MSG([  OpenJPEG support:          ${HAVE_OPENJPEG}])
2583
3598
LOC_MSG([  ECW support:               ${ECW_SETTING}])
2584
3599
LOC_MSG([  MrSID support:             ${HAVE_MRSID}])
 
3600
LOC_MSG([  MrSID/MG4 Lidar support:   ${HAVE_MRSID_LIDAR}])
2585
3601
LOC_MSG([  MSG support:               ${HAVE_MSG}])
2586
3602
LOC_MSG([  GRIB support:              ${HAVE_GRIB}])
2587
3603
LOC_MSG([  EPSILON support:           ${EPSILON_SETTING}])
 
3604
LOC_MSG([  WebP support:              ${WEBP_SETTING}])
2588
3605
LOC_MSG([  cURL support (wms/wcs/...):${CURL_SETTING}])
2589
3606
LOC_MSG([  PostgreSQL support:        ${HAVE_PG}])
2590
3607
LOC_MSG([  MySQL support:             ${HAVE_MYSQL}])
2592
3609
LOC_MSG([  Xerces-C support:          ${HAVE_XERCES}])
2593
3610
LOC_MSG([  NAS support:               ${HAVE_NAS}])
2594
3611
LOC_MSG([  Expat support:             ${HAVE_EXPAT}])
 
3612
LOC_MSG([  Google libkml support:     ${HAVE_LIBKML}])
2595
3613
LOC_MSG([  ODBC support:              ${ODBC_SETTING}])
2596
3614
LOC_MSG([  PGeo support:              ${ODBC_SETTING}])
 
3615
LOC_MSG([  FGDB support:              ${FGDB_ENABLED}])
 
3616
LOC_MSG([  MDB support:               ${MDB_ENABLED}])
2597
3617
LOC_MSG([  PCIDSK support:            ${PCIDSK_SETTING}])
2598
3618
LOC_MSG([  OCI support:               ${HAVE_OCI}])
2599
3619
LOC_MSG([  GEORASTER support:         ${HAVE_GEORASTER}])
2600
3620
LOC_MSG([  SDE support:               ${SDE_ENABLED}])
 
3621
LOC_MSG([  Rasdaman support:          ${RASDAMAN_ENABLED}])
2601
3622
LOC_MSG([  DODS support:              ${HAVE_DODS}])
2602
3623
LOC_MSG([  SQLite support:            ${HAVE_SQLITE}])
2603
3624
LOC_MSG([  SpatiaLite support:        ${HAVE_SPATIALITE}])
2605
3626
LOC_MSG([  INFORMIX DataBlade support:${HAVE_IDB}])
2606
3627
LOC_MSG([  GEOS support:              ${HAVE_GEOS_RESULT}])
2607
3628
LOC_MSG([  VFK support:               ${HAVE_VFK}])
 
3629
LOC_MSG([  Poppler support:           ${HAVE_POPPLER}])
 
3630
LOC_MSG([  Podofo support:            ${HAVE_PODOFO}])
 
3631
LOC_MSG([  OpenCL support:            ${OPENCL_SETTING}])
 
3632
LOC_MSG([  Armadillo support:         ${HAVE_ARMADILLO}])
 
3633
LOC_MSG([  FreeXL support:            ${HAVE_FREEXL}])
2608
3634
LOC_MSG()
2609
3635
if test ! -z "`uname | grep Darwin`" ; then
2610
3636
  LOC_MSG([  Mac OS X Framework :       ${MACOSX_FRAMEWORK}])
2620
3646
LOC_MSG([  Statically link PROJ.4:    ${PROJ_STATIC}])
2621
3647
LOC_MSG([  enable OGR building:       ${OGR_ENABLED}])
2622
3648
LOC_MSG([  enable pthread support:    ${PTHREAD_ENABLED}])
 
3649
LOC_MSG([  enable POSIX iconv support:${am_cv_func_iconv}])
2623
3650
LOC_MSG([  hide internal symbols:     ${HAVE_HIDE_INTERNAL_SYMBOLS}])
2624
3651
LOC_MSG()
2625
3652