Subversion Repositories public

Rev

Rev 88 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 88 Rev 155
Line 766... Line 766...
766
   fi
766
   fi
767
 
767
 
768
   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
768
   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
769
   AC_CHECK_FUNC(shmat, ,
769
   AC_CHECK_FUNC(shmat, ,
770
     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
770
     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
771
   
771
 
772
   # more headers that need to be explicitly included on darwin
772
   # more headers that need to be explicitly included on darwin
773
   AC_CHECK_HEADERS(sys/types.h stdint.h)
773
   AC_CHECK_HEADERS(sys/types.h stdint.h)
774
 
774
 
775
   # sys/bitypes.h is needed for uint32_t and friends on Tru64
775
   # sys/bitypes.h is needed for uint32_t and friends on Tru64
776
   AC_CHECK_HEADERS(sys/bitypes.h)
776
   AC_CHECK_HEADERS(sys/bitypes.h)
Line 779... Line 779...
779
   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
779
   AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
780
 
780
 
781
   # for some image handling on Mac OS X
781
   # for some image handling on Mac OS X
782
   AC_CHECK_HEADERS(Carbon/Carbon.h)
782
   AC_CHECK_HEADERS(Carbon/Carbon.h)
783
 
783
 
-
 
784
   # Geodetic library
-
 
785
   AC_CHECK_HEADER(gdal/gdal.h, [
-
 
786
     AC_DEFINE(HAVE_GDAL, 1, [Define if you have the GDAL API])
-
 
787
   ])
-
 
788
 
-
 
789
   AC_CHECK_FUNC(GDALAllRegister, ,
-
 
790
     AC_CHECK_LIB(gdal1.5.0, GDALAllRegister, [], [ echo "ERROR: GDAL library v1.5.0 was not found!" ]))
-
 
791
 
784
   # CoreAudio framework
792
   # CoreAudio framework
785
   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
793
   AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
786
     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
794
     AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
787
     FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
795
     FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
788
   ])
796
   ])
Line 5643... Line 5651...
5643
fi
5651
fi
5644
AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5652
AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
5645
])
5653
])
5646
 
5654
 
5647
dnl ------------------------------------------------------------------------
5655
dnl ------------------------------------------------------------------------
-
 
5656
dnl Try to find the GDAL headers and libraries.
-
 
5657
dnl $(GDAL_LDFLAGS) will be -Lgdalliblocation (if needed)
-
 
5658
dnl and $(GDAL_INCLUDES) will be -Igdalhdrlocation (if needed)
-
 
5659
dnl ------------------------------------------------------------------------
-
 
5660
AC_DEFUN([CHECK_GDAL],
-
 
5661
[
-
 
5662
LIBGDAL="-lgdal1.5.0"
-
 
5663
AC_REQUIRE([KDE_CHECK_LIB64])
-
 
5664
 
-
 
5665
ac_gdal_includes=NO ac_gdal_libraries=NO
-
 
5666
gdal_libraries=""
-
 
5667
gdal_includes=""
-
 
5668
AC_ARG_WITH(gdal-dir,
-
 
5669
    AC_HELP_STRING([--with-gdal-dir=DIR],[where the root of GDAL is installed]),
-
 
5670
    [  ac_gdal_includes="$withval"/include
-
 
5671
       ac_gdal_libraries="$withval"/lib$kdelibstuff
-
 
5672
    ])
-
 
5673
 
-
 
5674
want_gdal=yes
-
 
5675
AC_ARG_WITH(gdal,
-
 
5676
    AC_HELP_STRING([--without-gdal],[disable GDAL checks]),
-
 
5677
    [want_gdal=$withval])
-
 
5678
 
-
 
5679
if test $want_gdal = yes; then
-
 
5680
 
-
 
5681
AC_MSG_CHECKING(for GDAL)
-
 
5682
 
-
 
5683
AC_CACHE_VAL(ac_cv_have_gdal,
-
 
5684
[#try to guess GDAL locations
-
 
5685
  
-
 
5686
  gdal_incdirs="/usr/include /usr/local/include /usr/include/gdal /usr/local/include/gdal $prefix/include $prefix/include/gdal"
-
 
5687
  gdal_incdirs="$ac_gdal_includes $gdal_incdirs"
-
 
5688
  AC_FIND_FILE(gdal/gdal_priv.h, $gdal_incdirs, gdal_incdir)
-
 
5689
  ac_gdal_includes="$gdal_incdir"
-
 
5690
 
-
 
5691
  gdal_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/gdal/lib$kdelibsuff /usr/local/gdal/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
-
 
5692
  if test ! "$ac_gdal_libraries" = "NO"; then
-
 
5693
    gdal_libdirs="$ac_gdal_libraries $gdal_libdirs"
-
 
5694
  fi
-
 
5695
 
-
 
5696
  test=NONE
-
 
5697
  gdal_libdir=NONE
-
 
5698
  for dir in $gdal_libdirs; do
-
 
5699
    try="ls -1 $dir/libgdal1.5.0*"
-
 
5700
    if test=`eval $try 2> /dev/null`; then gdal_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
-
 
5701
  done
-
 
5702
 
-
 
5703
  ac_gdal_libraries="$gdal_libdir"
-
 
5704
 
-
 
5705
  ac_ldflags_safe="$LDFLAGS"
-
 
5706
  ac_libs_safe="$LIBS"
-
 
5707
 
-
 
5708
  LDFLAGS="$LDFLAGS -L$gdal_libdir $all_libraries"
-
 
5709
  LIBS="$LIBS $LIBGDAL"
-
 
5710
 
-
 
5711
  AC_TRY_LINK(,GDALOpen ("/.", GA_ReadOnly);,
-
 
5712
  ac_gdal_test="yes"
-
 
5713
  ,
-
 
5714
  ac_gdal_test="no"
-
 
5715
  )
-
 
5716
 
-
 
5717
  LDFLAGS="$ac_ldflags_safe"
-
 
5718
  LIBS="$ac_libs_safe"
-
 
5719
 
-
 
5720
  if test "$ac_gdal_includes" = NO || test "$ac_gdal_libraries" = NO; then
-
 
5721
    have_gdal=no
-
 
5722
  else
-
 
5723
    have_gdal=yes;
-
 
5724
  fi
-
 
5725
 
-
 
5726
  ])
-
 
5727
 
-
 
5728
  eval "$ac_cv_have_gdal"
-
 
5729
 
-
 
5730
  AC_MSG_RESULT([libraries $ac_gdal_libraries, headers $ac_gdal_includes])
-
 
5731
else
-
 
5732
  have_gdal=no
-
 
5733
fi
-
 
5734
 
-
 
5735
if test "$have_gdal" = yes; then
-
 
5736
  AC_MSG_CHECKING(for GDAL version)
-
 
5737
  dnl Check for GDAL version
-
 
5738
  AC_CACHE_VAL(ac_cv_gdal_version,
-
 
5739
  [
-
 
5740
 
-
 
5741
    cat >conftest.$ac_ext <<EOF
-
 
5742
#include <gdal/gdal_priv.h>
-
 
5743
#include <stdio.h>
-
 
5744
    int main() {
-
 
5745
 
-
 
5746
#ifndef GDAL_VERSION_NUM
-
 
5747
      printf("gdal_version=\\"error\\"\n");
-
 
5748
#else
-
 
5749
      if (GDAL_VERSION_NUM < 1500)
-
 
5750
        printf("gdal_version=\\"old\\"\n");
-
 
5751
      else
-
 
5752
        printf("gdal_version=\\"ok\\"\n");
-
 
5753
#endif
-
 
5754
     return (0);
-
 
5755
    }
-
 
5756
EOF
-
 
5757
 
-
 
5758
    ac_save_CPPFLAGS=$CPPFLAGS
-
 
5759
    if test "$ac_gdal_includes" != "/usr/include"; then
-
 
5760
        CPPFLAGS="$CPPFLAGS -I$ac_gdal_includes"
-
 
5761
    fi
-
 
5762
 
-
 
5763
    if AC_TRY_EVAL(ac_link); then 
-
 
5764
 
-
 
5765
      if eval `./conftest 2>&5`; then
-
 
5766
        if test $gdal_version = error; then
-
 
5767
          AC_MSG_ERROR([$gdal_incdir/gdal/gdal_priv.h doesn't define GDAL_VERSION_NUM !])
-
 
5768
        else
-
 
5769
          if test $gdal_version = old; then
-
 
5770
            AC_MSG_WARN([GDAL version too old. Upgrade to 1.5.0 at least, see http://www.gdal.org. GDAL support disabled.])
-
 
5771
            have_gdal=no
-
 
5772
          fi
-
 
5773
        fi
-
 
5774
        ac_cv_gdal_version="gdal_version=$gdal_version"
-
 
5775
      else
-
 
5776
        AC_MSG_ERROR([Your system couldn't run a small GDAL test program.
-
 
5777
        Check config.log, and if you can't figure it out, send a mail to 
-
 
5778
        Andreas Theofilu <andreas@theosys.at>, attaching your config.log])
-
 
5779
      fi
-
 
5780
 
-
 
5781
    else
-
 
5782
      AC_MSG_ERROR([Your system couldn't link a small GDAL test program.
-
 
5783
      Check config.log, and if you can't figure it out, send a mail to 
-
 
5784
      Andreas Theofilu <andreas@theosys.at>, attaching your config.log])
-
 
5785
    fi 
-
 
5786
    CPPFLAGS=$ac_save_CPPFLAGS
-
 
5787
 
-
 
5788
  ])
-
 
5789
 
-
 
5790
  eval "$ac_cv_gdal_version"
-
 
5791
  AC_MSG_RESULT($gdal_version)
-
 
5792
fi
-
 
5793
 
-
 
5794
if test "$have_gdal" != yes; then
-
 
5795
  LIBGDAL="";
-
 
5796
else
-
 
5797
  AC_DEFINE(HAVE_GDAL, 1, [If we are going to use GDAL])
-
 
5798
  ac_cv_have_gdal="have_gdal=yes \
-
 
5799
    ac_gdal_includes=$ac_gdal_includes ac_gdal_libraries=$ac_gdal_libraries"
-
 
5800
 
-
 
5801
  gdal_libraries="$ac_gdal_libraries"
-
 
5802
  gdal_includes="$ac_gdal_includes"
-
 
5803
 
-
 
5804
  if test $gdal_version = "old"; then
-
 
5805
    AC_DEFINE(HAVE_OLD_GDAL_API, 1, [Define if you have GDAL < 1.5.0])
-
 
5806
  fi
-
 
5807
fi
-
 
5808
 
-
 
5809
GDAL_INCLUDES=
-
 
5810
 
-
 
5811
if test "$gdal_includes" = "/usr/include"; then
-
 
5812
  if test -f /usr/kerberos/include/krb5.h; then
-
 
5813
	GDAL_INCLUDES="-I/usr/kerberos/include"
-
 
5814
  fi
-
 
5815
elif test  "$gdal_includes" != "/usr/local/include" && test -n "$gdal_includes"; then
-
 
5816
  GDAL_INCLUDES="-I$gdal_includes"
-
 
5817
fi
-
 
5818
 
-
 
5819
if test "$gdal_libraries" = "/usr/lib" || test "$gdal_libraries" = "/usr/local/lib" || test -z "$gdal_libraries" || test "$gdal_libraries" = "NONE"; then
-
 
5820
 GDAL_LDFLAGS=""
-
 
5821
else
-
 
5822
 GDAL_LDFLAGS="-L$gdal_libraries -R$gdal_libraries"
-
 
5823
fi
-
 
5824
 
-
 
5825
AC_SUBST(GDAL_INCLUDES)
-
 
5826
AC_SUBST(GDAL_LDFLAGS)
-
 
5827
AC_SUBST(LIBGDAL)
-
 
5828
])
-
 
5829
 
-
 
5830
dnl ------------------------------------------------------------------------
5648
dnl Try to find the SSL headers and libraries.
5831
dnl Try to find the SSL headers and libraries.
5649
dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5832
dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
5650
dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5833
dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
5651
dnl ------------------------------------------------------------------------
5834
dnl ------------------------------------------------------------------------
5652
dnl
5835
dnl