[cig-commits] r18077 - short/3D/PyLith/branches/v1.5-stable

brad at geodynamics.org brad at geodynamics.org
Tue Mar 8 09:48:08 PST 2011


Author: brad
Date: 2011-03-08 09:48:07 -0800 (Tue, 08 Mar 2011)
New Revision: 18077

Modified:
   short/3D/PyLith/branches/v1.5-stable/configure.ac
Log:
Use new m4 macros. Improve configure switches.

Modified: short/3D/PyLith/branches/v1.5-stable/configure.ac
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/configure.ac	2011-03-08 17:47:44 UTC (rev 18076)
+++ short/3D/PyLith/branches/v1.5-stable/configure.ac	2011-03-08 17:48:07 UTC (rev 18077)
@@ -27,18 +27,12 @@
 # PYTHON
 AC_ARG_VAR(PYTHON, [Python interpreter])
 AC_ARG_VAR(PYTHONPATH, [Python module search path])
-AC_ARG_WITH([embedding],
-    [AC_HELP_STRING([--with-embedding],
-        [embed Python with PyLith in a single executable @<:@default=yes@:>@])],
-    [want_embedding="$withval"],
-    [want_embedding=no])
-AM_CONDITIONAL([COND_EMBEDDING], [test "$want_embedding" = yes])
 
 # SWIG
 AC_ARG_ENABLE([swig],
     [AC_HELP_STRING([--enable-swig],
         [enable generating modules with SWIG) @<:@default=no@:>@])],
-	[enable_swig=yes],
+	[if test "$enableval" = yes ; then enable_swig=yes; else enable_swig=no; fi],
 	[enable_swig=no])
 AM_CONDITIONAL([ENABLE_SWIG], [test "$enable_swig" = yes])
 
@@ -46,7 +40,7 @@
 AC_ARG_ENABLE([testing],
     [AC_HELP_STRING([--enable-testing],
         [enable unit testing with cppunit (requires cppunit) @<:@default=no@:>@])],
-	[enable_testing=yes],
+	[if test "$enableval" = yes ; then enable_testing=yes; else enable_testing=no; fi],
 	[enable_testing=no])
 AM_CONDITIONAL([ENABLE_TESTING], [test "$enable_testing" = yes])
 
@@ -54,9 +48,11 @@
 AC_ARG_ENABLE([cubit],
     [AC_HELP_STRING([--enable-cubit],
         [enable reading/writing Cubit EXODUS files (requires netcdf) @<:@default=no@:>@])],
-	[enable_cubit=yes
-	CPPFLAGS="-DENABLE_CUBIT $CPPFLAGS"; export CPPFLAGS;
-	PYLITH_SWIG_CPPFLAGS="-DENABLE_CUBIT $PYLITH_SWIG_CPPFLAGS"; export PYLITH_SWIG_CPPFLAGS],
+	[if test "$enableval" = yes ; then 
+	  enable_cubit=yes
+	  CPPFLAGS="-DENABLE_CUBIT $CPPFLAGS"; export CPPFLAGS;
+	  PYLITH_SWIG_CPPFLAGS="-DENABLE_CUBIT $PYLITH_SWIG_CPPFLAGS"; export PYLITH_SWIG_CPPFLAGS
+	else enable_cubit=no; fi],
 	[enable_cubit=no])
 AM_CONDITIONAL([ENABLE_CUBIT], [test "$enable_cubit" = yes])
 AC_SUBST(PYLITH_SWIG_CPPFLAGS)
@@ -65,8 +61,10 @@
 AC_ARG_ENABLE([tetgen],
     [AC_HELP_STRING([--enable-tetgen],
         [enable generating simple meshes w/TetGen via PETSc @<:@default=no@:>@])],
-	[enable_tetgen=yes
-	CPPFLAGS="-DENABLE_TETGEN $CPPFLAGS"; export CPPFLAGS],
+	[if test "$enableval" = yes ; then 
+	  enable_tetgen=yes
+	  CPPFLAGS="-DENABLE_TETGEN $CPPFLAGS"; export CPPFLAGS
+        else enable_tetgen=no; fi],
 	[enable_tetgen=no])
 AM_CONDITIONAL([ENABLE_TETGEN], [test "$enable_tetgen" = yes])
 
@@ -74,8 +72,10 @@
 AC_ARG_ENABLE([memory_logging],
     [AC_HELP_STRING([--enable-memory-logging],
         [enable memory logging @<:@default=no@:>@])],
-	[enable_memory_logging=yes
-	CPPFLAGS="-DALE_MEM_LOGGING $CPPFLAGS"; export CPPFLAGS],
+	[if test "$enableval" = yes ; then 
+	  enable_memory_logging=yes
+	  CPPFLAGS="-DALE_MEM_LOGGING $CPPFLAGS"; export CPPFLAGS
+         else enable_memory_logging=no; fi],
 	[enable_memory_logging=no])
 AM_CONDITIONAL([ENABLE_MEMORY_LOGGING], [test "$enable_memory_logging" = yes])
 
@@ -83,7 +83,7 @@
 AC_ARG_ENABLE([documentation],
     [AC_HELP_STRING([--enable-documentation],
         [enable building HTML documentation (requires doxygen) @<:@default=no@:>@])],
-	[enable_documentation=yes],
+	[if test "$enableval" = yes ; then enable_documentation=yes; else enable_documentation=no; fi],
 	[enable_documentation=no])
 AM_CONDITIONAL([ENABLE_DOCUMENTATION], [test "$enable_documentation" = yes])
 
@@ -137,36 +137,14 @@
 
 # CPPUNIT
 if test "$enable_testing" = "yes" ; then
-  AC_LANG(C++)
-  AC_CHECK_HEADER([cppunit/TestRunner.h], [], [
-    AC_MSG_ERROR([CppUnit header not found; try CPPFLAGS="-I<CppUnit include dir>"])
-  ])
-  AC_MSG_CHECKING([for CppUnit::TestRunner in -lcppunit])
-  AC_REQUIRE_CPP
-  AC_COMPILE_IFELSE(
-    [AC_LANG_PROGRAM([[#include <cppunit/TestRunner.h>]],
-	             [[CppUnit::TestRunner runner;]])],
-    [AC_MSG_RESULT(yes)],
-    [AC_MSG_RESULT(no)
-     AC_MSG_ERROR([CppUnit library not found; try LDFLAGS="-L<CppUnit lib dir>"])
-  ])
+  CIT_CPPUNIT_HEADER
+  CIT_CPPUNIT_LIB
 fi
 
 # CUBIT (netcdf)
 if test "$enable_cubit" = "yes" ; then
-  AC_LANG(C++)
-  AC_CHECK_HEADER([netcdfcpp.h], [], [
-    AC_MSG_ERROR([netcdf C++ header not found; try CPPFLAGS="-I<netcdf include dir>"])
-  ])
-  AC_MSG_CHECKING([for NcFile in -lnetcdfc++])
-  AC_REQUIRE_CPP
-  AC_COMPILE_IFELSE(
-    [AC_LANG_PROGRAM([[#include <netcdfcpp.h>]],
-	             [[NcFile ncfile("filename");]])],
-    [AC_MSG_RESULT(yes)],
-    [AC_MSG_RESULT(no)
-     AC_MSG_ERROR([netcdfc++ library not found; try LDFLAGS="-L<netcdf lib dir>"])
-  ])
+  CIT_NETCDF_HEADER
+  CIT_NETCDF_LIB
 fi
 
 # TETGEN
@@ -190,29 +168,12 @@
 fi
 
 # PROJ4
-AC_CHECK_LIB(proj, pj_init_plus, [
-  AC_CHECK_HEADER([proj_api.h], [], [
-    AC_MSG_ERROR([Proj4 header not found; try CPPFLAGS="-I<Proj4 include dir>"])
-  ])
-],[
-  AC_MSG_ERROR([Proj4 library not found; try LDFLAGS="-L<Proj4 lib dir>"])
-])
+CIT_PROJ4_HEADER
+CIT_PROJ4_LIB
 
 # SPATIALDATA
-AC_LANG(C++)
-AC_CHECK_HEADER([spatialdata/spatialdb/SpatialDB.hh], [], [
-  AC_MSG_ERROR([SpatialDB header not found; try CPPFLAGS="-I<Spatialdata include dir>"])
-])
-AC_MSG_CHECKING([for spatialdb::SimpleDB in -lspatialdata])
-AC_REQUIRE_CPP
-AC_COMPILE_IFELSE(
-  [AC_LANG_PROGRAM([[#include <spatialdata/spatialdb/SpatialDB.hh>]
-                    [#include <spatialdata/spatialdb/SimpleDB.hh>]],
-                   [[spatialdata::spatialdb::SimpleDB db;]])],
-  [AC_MSG_RESULT(yes)],
-  [AC_MSG_RESULT(no)
-   AC_MSG_ERROR([Spatialdata library not found; try LDFLAGS="-L<Spatialdata lib dir>"])
-])
+CIT_SPATIALDATA_HEADER
+CIT_SPATIALDATA_LIB
 
 # DOXYGEN
 if test "$enable_documentation" = "yes" ; then



More information about the CIG-COMMITS mailing list