浏览代码

configure: add check for libLAS

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46416 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 14 年之前
父节点
当前提交
7dff4b9fe5
共有 2 个文件被更改,包括 907 次插入737 次删除
  1. 850 737
      configure
  2. 57 0
      configure.in

文件差异内容过多而无法显示
+ 850 - 737
configure


+ 57 - 0
configure.in

@@ -267,6 +267,12 @@ AC_ARG_WITH(gdal,
                           enable GDAL/OGR support (gdal-config with path,
                           e.g. '--with-gdal=/usr/local/bin/gdal-config')])
 
+AC_ARG_WITH(liblas,
+[  --with-liblas[=path/liblas-config]
+                          enable libLAS support (liblas-config with path,
+                          e.g. '--with-liblas=/usr/local/bin/liblas-config',
+                          default: no)],, with_liblas="no")
+
 AC_ARG_WITH(wxwidgets,
 [  --with-wxwidgets[=path/wx-config]
                           enable wxWidgets support (wx-config with path,
@@ -797,6 +803,56 @@ AC_SUBST(GDAL_CFLAGS)
 AC_SUBST(USE_GDAL)
 AC_SUBST(USE_OGR)
 
+# libLAS option
+
+AC_MSG_CHECKING(whether to use libLAS)
+
+LIBLAS_LIBS=
+LIBLAS_CFLAGS=
+USE_LIBLAS=
+
+if test "`basename xx/$with_liblas`" = "liblas-config" ; then
+  LIBLAS_CONFIG="$with_liblas"
+fi
+
+if test "$with_liblas" = "no" ; then
+  AC_MSG_RESULT(no)
+else
+  AC_MSG_RESULT(yes)
+  AC_PATH_PROG(LIBLAS_CONFIG, liblas-config, no)
+
+  if test "$LIBLAS_CONFIG" = "no" ; then
+    AC_MSG_ERROR([*** couldn't find liblas-config])
+  fi
+
+  if test "$LIBLAS_CONFIG" != "" ; then
+    LIBLAS_LIBS=`"$LIBLAS_CONFIG" --libs`
+    LIBLAS_CFLAGS=`"$LIBLAS_CONFIG" --cflags`
+    LIBLAS_INC=`"$LIBLAS_CONFIG" --includes`
+    USE_LIBLAS=1
+  fi
+
+  LIBLAS=
+  ac_save_libs="$LIBS"
+  ac_save_cflags="$CFLAGS"
+  LIBS="$LIBS $LIBLAS_LIBS"
+  CFLAGS="$CFLAGS $LIBLAS_CFLAGS"
+  AC_TRY_LINK([#include <liblas/capi/liblas.h>],[LASReader_Create("foo");],,[
+  AC_TRY_LINK([#include <liblas/capi/liblas.h>],[LASReader_Create("foo");],LAS_LIBS="$LAS_LIBS",[
+  AC_MSG_ERROR([*** Unable to locate libLAS library.])
+  ])
+  ])
+  LIBS=${ac_save_libs}
+  CFLAGS=${ac_save_cflags}
+
+  AC_DEFINE(HAVE_LIBLAS)
+fi
+
+AC_SUBST(LIBLAS_LIBS)
+AC_SUBST(LIBLAS_CFLAGS)
+AC_SUBST(LIBLAS_INC)
+AC_SUBST(USE_LIBLAS)
+
 # GEOS option
 
 AC_MSG_CHECKING(whether to use GEOS)
@@ -1890,6 +1946,7 @@ LOC_MSG_USE(GEOS support,USE_GEOS)
 LOC_MSG_USE(JPEG support,USE_JPEG)
 LOC_MSG_USE(LAPACK support,USE_LAPACK)
 LOC_MSG_USE(Large File support (LFS), USE_LARGEFILES)
+LOC_MSG_USE(LIBLAS support,USE_LIBLAS)
 LOC_MSG_USE(MySQL support,USE_MYSQL)
 LOC_MSG_USE(NLS support,USE_NLS)
 LOC_MSG_USE(ODBC support,USE_ODBC)