summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRhys Ulerich <rhys.ulerich@gmail.com>2008-11-07 00:07:19 +0100
committerPeter Simons <simons@cryp.to>2008-11-07 00:07:19 +0100
commitc5bc406380248f47a9ec8751a206dcbe755d7339 (patch)
treef539db0262a789e028742d8949f336de243174f0
parent8f0b0984e7a551228a3f6b363548ec2bc2612b5f (diff)
downloadautoconf-archive-c5bc406380248f47a9ec8751a206dcbe755d7339.tar.gz
Updated AX_TRILINOS macros.
-rw-r--r--AUTHORS3
-rw-r--r--ax_add_am_trilinos_makefile_export.m451
-rw-r--r--ax_trilinos_amesos.m427
-rw-r--r--ax_trilinos_base.m499
-rw-r--r--ax_trilinos_epetra.m427
-rw-r--r--ax_trilinos_epetraext.m444
-rw-r--r--ax_trilinos_epetraext_hdf5.m456
-rw-r--r--ax_trilinos_rtop.m444
-rw-r--r--ax_trilinos_rythmos.m444
-rw-r--r--ax_trilinos_teuchos.m428
-rw-r--r--ax_trilinos_thyra.m444
-rw-r--r--ax_trilinos_thyra_epetra.m442
-rw-r--r--ax_trilinos_thyra_epetraext.m442
-rw-r--r--gl_trilinos_absolute_header.m471
14 files changed, 539 insertions, 83 deletions
diff --git a/AUTHORS b/AUTHORS
index 8878236..a210766 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -11,6 +11,7 @@ Autoconf Macro Contributors
Guido U. Draheim
Todd Veldhuizen
Thomas Porschberg
+ Rhys Ulerich
Tom Howard
Bogdan Drozdowski
Gleen Salmon
@@ -33,7 +34,6 @@ Autoconf Macro Contributors
Ludovic Courtès
Ville Laurikari
Scott Pakin
- Rhys Ulerich
Matteo Frigo
Christophe Tournayre
Caolan McNamara
@@ -105,6 +105,7 @@ Autoconf Macro Contributors
Gerald Point
Don Anderson
Dodji Seketeli
+ Derek Price
Dean Povey
David Cluytens
Dave Benson
diff --git a/ax_add_am_trilinos_makefile_export.m4 b/ax_add_am_trilinos_makefile_export.m4
new file mode 100644
index 0000000..f95713c
--- /dev/null
+++ b/ax_add_am_trilinos_makefile_export.m4
@@ -0,0 +1,51 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_add_am_trilinos_makefile_export.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT(EXPORT_SUFFIX [, ACTION-IF-NOT-FOUND])
+#
+# DESCRIPTION
+#
+# Checks if a file named <Makefile.export.EXPORT_SUFFIX> appears in the
+# $TRILINOS_INCLUDE directory. If so, adds an include for it using the
+# AX_AM_MACROS framework.
+#
+# If ACTION-IF-NOT-FOUND is not provided, configure fails.
+#
+# LAST MODIFICATION
+#
+# 2008-11-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT],[
+AC_REQUIRE([AX_TRILINOS_BASE])
+AC_REQUIRE([AX_AM_MACROS])
+
+AC_CACHE_CHECK(
+ [for file ${TRILINOS_INCLUDE}/Makefile.export.$1],
+ [ax_cv_add_am_trilinos_makefile_export_]translit($1,[. ],[_])[_exists],
+ [[ax_cv_add_am_trilinos_makefile_export_]translit($1,[. ],[_])[_exists]=no
+ test -f "${TRILINOS_INCLUDE}/Makefile.export.$1" && dnl
+ [ax_cv_add_am_trilinos_makefile_export_]translit($1,[. ],[_])[_exists]=yes])
+
+if test "${[ax_cv_add_am_trilinos_makefile_export_]translit($1,[. ],[_])[_exists]}" = "yes"
+then
+AX_ADD_AM_MACRO([
+include ${TRILINOS_INCLUDE}/Makefile.export.$1
+])
+else
+ ifelse([$2],,AC_MSG_ERROR([Could not find ${TRILINOS_INCLUDE}/Makefile.export.$1. Was Trilinos compiled with --enable-export-makefiles?]),[
+ AC_MSG_WARN([Could not find ${TRILINOS_INCLUDE}/Makefile.export.$1. Was Trilinos compiled with --enable-export-makefiles?])
+ $2])
+fi
+
+])
diff --git a/ax_trilinos_amesos.m4 b/ax_trilinos_amesos.m4
index 8e63655..87515a6 100644
--- a/ax_trilinos_amesos.m4
+++ b/ax_trilinos_amesos.m4
@@ -8,13 +8,15 @@
#
# DESCRIPTION
#
-# Test for the Trilinos Amesos
-# (http://trilinos.sandia.gov/packages/amesos) library. On success,
-# defines HAVE_LIBAMESOS due to AC_CHECK_LIB invocation.
+# On success, adds "include Makefile.export.amesos" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
#
# LAST MODIFICATION
#
-# 2008-08-06
+# 2008-11-02
#
# COPYLEFT
#
@@ -27,15 +29,16 @@
AC_DEFUN([AX_TRILINOS_AMESOS],[
AC_REQUIRE([AX_TRILINOS_BASE])
ax_trilinos_amesos=yes
- AC_CHECK_HEADER([Amesos.h],,[ax_trilinos_amesos=no])
- AC_CHECK_LIB([amesos],[main],,[ax_trilinos_amesos=no])
+ AC_HAVE_LIBRARY([amesos],[:],[ax_trilinos_amesos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([amesos.macros],[ax_trilinos_amesos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([amesos],[ax_trilinos_amesos=no])
if test "$ax_trilinos_amesos" = yes; then
- dnl NOP required
- :
- ifelse([$1], , , [$1])
+ : # NOP
+ ifelse([$1],,,
+ [$1])
else
- dnl NOP required
- :
- ifelse([$2], , , [$2])
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Amesos not found.]),
+ [$2])
fi
])
diff --git a/ax_trilinos_base.m4 b/ax_trilinos_base.m4
index 01408b2..7592f22 100644
--- a/ax_trilinos_base.m4
+++ b/ax_trilinos_base.m4
@@ -21,12 +21,14 @@
# --with-trilinos-libdir to override default locations underneath either
# --with-trilinos or $TRILINOS_HOME.
#
-# On success, adds -Ipath to CFLAGS and CPPFLAGS, -Lpath to LDFLAGS, and
-# defines HAVE_TRILINOS.
+# On success, adds -Ipath to CPPFLAGS, -Lpath to LDFLAGS, sets the
+# variable TRILINOS_INCLUDE based on the discovered location of
+# Trilinos_version.h, and #defines HAVE_TRILINOS. When ACTION-IF-NOT-FOUND
+# is not specified, the default behavior is for configure to fail.
#
# LAST MODIFICATION
#
-# 2008-08-06
+# 2008-11-02
#
# COPYLEFT
#
@@ -42,27 +44,27 @@
AC_DEFUN([AX_TRILINOS_BASE],
[
-AC_REQUIRE([AC_LANG_CPLUSPLUS])
-AC_ARG_VAR(TRILINOS_HOME,[Location of Trilinos installation])
+AC_REQUIRE([gl_TRILINOS_ABSOLUTE_HEADER])
+AC_ARG_VAR(TRILINOS_HOME,[root directory of Trilinos installation])
AC_ARG_WITH(trilinos, [AS_HELP_STRING([--with-trilinos[=DIR]],[root directory of Trilinos installation])],[
with_trilinos=$withval
if test "${with_trilinos}" != yes; then
TRILINOS_HOME=$withval
- trilinos_include="$withval/include"
- trilinos_libdir="$withval/lib"
+ trilinos_include="$withval/include"
+ trilinos_libdir="$withval/lib"
fi
],[
with_trilinos=$withval
if test "x${TRILINOS_HOME}" != "x"; then
- trilinos_include="${TRILINOS_HOME}/include"
- trilinos_libdir="${TRILINOS_HOME}/lib"
+ trilinos_include="${TRILINOS_HOME}/include"
+ trilinos_libdir="${TRILINOS_HOME}/lib"
fi
])
AC_ARG_WITH(trilinos-include,
[AS_HELP_STRING([--with-trilinos-include=DIR],[specify exact directory for Trilinos headers])],[
-if test -d $withval; then
+if test -d "$withval"; then
trilinos_include="$withval"
else
AC_MSG_ERROR([--with-trilinos-include expected directory name])
@@ -70,7 +72,7 @@ fi
])
AC_ARG_WITH(trilinos-libdir, [AS_HELP_STRING([--with-trilinos-libdir=DIR],[specify exact directory for Trilinos libraries])],[
-if test -d $withval; then
+if test -d "$withval"; then
trilinos_libdir="$withval"
else
AC_MSG_ERROR([--with-trilinos-libdir expected directory name])
@@ -78,22 +80,21 @@ fi
])
if test "${with_trilinos}" != no ; then
- OLD_LIBS=$LIBS
- OLD_LDFLAGS=$LDFLAGS
- OLD_CFLAGS=$CFLAGS
- OLD_CPPFLAGS=$CPPFLAGS
- if test "${trilinos_libdir}" ; then
- LDFLAGS="$LDFLAGS -L${trilinos_libdir}"
- fi
- if test "${trilinos_include}" ; then
- CPPFLAGS="$CPPFLAGS -I${trilinos_include}"
- CFLAGS="$CFLAGS -I${trilinos_include}"
- fi
+ OLD_LIBS=$LIBS
+ OLD_LDFLAGS=$LDFLAGS
+ OLD_CPPFLAGS=$CPPFLAGS
+
+ if test -d "${trilinos_libdir}" ; then
+ LDFLAGS="-L${trilinos_libdir} $LDFLAGS"
+ fi
+ if test -d "${trilinos_include}" ; then
+ CPPFLAGS="-I${trilinos_include} $CPPFLAGS"
+ fi
succeeded=no
- AC_CHECK_HEADER([Trilinos_version.h],found_header=yes,found_header=no)
- if test "$found_header" = yes; then
+ AC_CHECK_HEADER([Trilinos_version.h],[found_header=yes],[found_header=no])
+ if test "$found_header" = yes; then
dnl Patterned after AX_BOOST_BASE
trilinos_lib_version_req=ifelse([$1],,8.0.0,$1)
trilinos_lib_version_req_shorten=`expr $trilinos_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
@@ -101,41 +102,47 @@ if test "${with_trilinos}" != no ; then
trilinos_lib_version_req_minor=`expr $trilinos_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
trilinos_lib_version_req_sub_minor=`expr $trilinos_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test "x$trilinos_lib_version_req_sub_minor" = "x" ; then
- trilinos_lib_version_req_sub_minor="0"
+ trilinos_lib_version_req_sub_minor="0"
fi
WANT_TRILINOS_VERSION=`expr $trilinos_lib_version_req_major \* 10000 \+ $trilinos_lib_version_req_minor \* 100 \+ $trilinos_lib_version_req_sub_minor`
+ AC_LANG_PUSH([C++])
AC_MSG_CHECKING(for Trilinos release >= $trilinos_lib_version_req)
- AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-@%:@include <Trilinos_version.h>
-]], [[
-#if (TRILINOS_MAJOR_VERSION == 0)
-/* Development branch has zero major version. Everything is okay. */
-#elif (TRILINOS_MAJOR_MINOR_VERSION >= $WANT_TRILINOS_VERSION)
-/* Stable release of appropriate version. Everything is okay. */
-#else
-# error Trilinos version is too old
-#endif
+ @%:@include <Trilinos_version.h>
+ ]], [[
+ #if (TRILINOS_MAJOR_VERSION == 0)
+ /* Development branch has zero major version. A-OK. */
+ #elif (TRILINOS_MAJOR_MINOR_VERSION >= $WANT_TRILINOS_VERSION)
+ /* Stable release of appropriate version. A-OK. */
+ #else
+ # error Trilinos version is too old
+ #endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
- ],[
+ ],[
AC_MSG_RESULT(no)
- ])
+ ])
AC_LANG_POP([C++])
fi
if test "$succeeded" = no; then
- LIBS=$OLD_LIBS
- LDFLAGS=$OLD_LDFLAGS
- CPPFLAGS=$OLD_CPPFLAGS
- CFLAGS=$OLD_CFLAGS
+ LIBS=$OLD_LIBS
+ LDFLAGS=$OLD_LDFLAGS
+ CPPFLAGS=$OLD_CPPFLAGS
- ifelse([$3], , , [$3])
- else
- AC_DEFINE(HAVE_TRILINOS,1,[Define if Trilinos is available])
- ifelse([$2], , , [$2])
- fi
+ ifelse([$3],,AC_MSG_ERROR([Trilinos not found. Try either --with-trilinos or setting TRILINOS_HOME.]),
+ [$3])
+ else
+ dnl Find the absolute path to Trilinos_version.h
+ dnl We need it to back out the discovered TRILINOS_INCLUDE directory.
+ gl_TRILINOS_ABSOLUTE_HEADER([Trilinos_version.h])
+ TRILINOS_INCLUDE=`AS_DIRNAME([$gl_cv_absolute_Trilinos_version_h])`
+
+ AC_DEFINE(HAVE_TRILINOS,1,[Define if Trilinos is available])
+ AC_SUBST(TRILINOS_INCLUDE)
+ ifelse([$2],,,[$2])
+ fi
fi
diff --git a/ax_trilinos_epetra.m4 b/ax_trilinos_epetra.m4
index 533217d..604b64b 100644
--- a/ax_trilinos_epetra.m4
+++ b/ax_trilinos_epetra.m4
@@ -8,13 +8,15 @@
#
# DESCRIPTION
#
-# Test for the Trilinos Epetra
-# (http://trilinos.sandia.gov/packages/epetra) library. On success,
-# defines HAVE_LIBEPETRA due to AC_CHECK_LIB invocation.
+# On success, adds "include Makefile.export.epetra" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
#
# LAST MODIFICATION
#
-# 2008-08-06
+# 2008-11-02
#
# COPYLEFT
#
@@ -27,15 +29,16 @@
AC_DEFUN([AX_TRILINOS_EPETRA],[
AC_REQUIRE([AX_TRILINOS_BASE])
ax_trilinos_epetra=yes
- AC_CHECK_HEADER([Epetra_Version.h],,[ax_trilinos_epetra=no])
- AC_CHECK_LIB( [epetra],[main], ,[ax_trilinos_epetra=no])
+ AC_HAVE_LIBRARY([epetra],[:],[ax_trilinos_epetra=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([epetra.macros],[ax_trilinos_epetra=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([epetra],[ax_trilinos_epetra=no])
if test "$ax_trilinos_epetra" = yes; then
- dnl NOP required
- :
- ifelse([$1], , , [$1])
+ : # NOP
+ ifelse([$1],,,
+ [$1])
else
- dnl NOP required
- :
- ifelse([$2], , , [$2])
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Epetra not usable.]),
+ [$2])
fi
])
diff --git a/ax_trilinos_epetraext.m4 b/ax_trilinos_epetraext.m4
new file mode 100644
index 0000000..3b6af30
--- /dev/null
+++ b/ax_trilinos_epetraext.m4
@@ -0,0 +1,44 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_epetraext.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_EPETRAEXT([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.epetraext" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LAST MODIFICATION
+#
+# 2008-11-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_EPETRAEXT],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_epetraext=yes
+ AC_HAVE_LIBRARY([epetraext],[:],[ax_trilinos_epetraext=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([epetraext.macros],[ax_trilinos_epetraext=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([epetraext],[ax_trilinos_epetraext=no])
+ if test "$ax_trilinos_epetraext" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos EpetraExt not usable.]),
+ [$2])
+ fi
+])
diff --git a/ax_trilinos_epetraext_hdf5.m4 b/ax_trilinos_epetraext_hdf5.m4
new file mode 100644
index 0000000..7e6fd65
--- /dev/null
+++ b/ax_trilinos_epetraext_hdf5.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_epetraext_hdf5.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_EPETRAEXT_HDF5([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Checks if EpetraExt was compiled with HDF5 support
+# (--enable-epetraext-hdf5) enabled. When ACTION-IF-NOT-FOUND is not
+# specified, the default behavior is for configure to fail.
+#
+# LAST MODIFICATION
+#
+# 2008-11-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_EPETRAEXT_HDF5],[
+ AC_REQUIRE([AC_LIB_HDF5])
+ AC_REQUIRE([AX_TRILINOS_EPETRAEXT])
+ ax_trilinos_epetraext_hdf5=yes
+ AC_CHECK_HEADER([EpetraExt_ConfigDefs.h],,[ax_trilinos_epetraext_hdf5=no])
+ AC_MSG_CHECKING([for HDF5 support in EpetraExt release])
+ AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ @%:@include <EpetraExt_ConfigDefs.h>
+ ]], [[
+ #ifndef HAVE_EPETRAEXT_HDF5
+ # error HAVE_EPETRAEXT_HDF5 was not defined in EpetraExt_ConfigDefs.h
+ #endif
+ ]])],[
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_RESULT(no)
+ ax_trilinos_epetraext_hdf5=no
+ ])
+ AC_LANG_POP([C++])
+ if test "$ax_trilinos_epetraext_hdf5" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos EpetraExt HDF5 not usable.]),
+ [$2])
+ fi
+])
diff --git a/ax_trilinos_rtop.m4 b/ax_trilinos_rtop.m4
new file mode 100644
index 0000000..7327deb
--- /dev/null
+++ b/ax_trilinos_rtop.m4
@@ -0,0 +1,44 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_rtop.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_RTOP([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.rtop" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LAST MODIFICATION
+#
+# 2008-11-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_RTOP],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_rtop=yes
+ AC_HAVE_LIBRARY([rtop],[:],[ax_trilinos_rtop=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([rtop.macros],[ax_trilinos_rtop=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([rtop],[ax_trilinos_rtop=no])
+ if test "$ax_trilinos_rtop" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos RTOp not usable.]),
+ [$2])
+ fi
+])
diff --git a/ax_trilinos_rythmos.m4 b/ax_trilinos_rythmos.m4
new file mode 100644
index 0000000..186486c
--- /dev/null
+++ b/ax_trilinos_rythmos.m4
@@ -0,0 +1,44 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_rythmos.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_RYTHMOS([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.rythmos" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LAST MODIFICATION
+#
+# 2008-11-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_RYTHMOS],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_rythmos=yes
+ AC_HAVE_LIBRARY([rythmos],[:],[ax_trilinos_rythmos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([rythmos.macros],[ax_trilinos_rythmos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([rythmos],[ax_trilinos_rythmos=no])
+ if test "$ax_trilinos_rythmos" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Rythmos not usable.]),
+ [$2])
+ fi
+])
diff --git a/ax_trilinos_teuchos.m4 b/ax_trilinos_teuchos.m4
index bce4bb1..e9b00b5 100644
--- a/ax_trilinos_teuchos.m4
+++ b/ax_trilinos_teuchos.m4
@@ -8,13 +8,16 @@
#
# DESCRIPTION
#
-# Test for the Trilinos Teuchos
-# (http://trilinos.sandia.gov/packages/teuchos) library. On success,
-# defines HAVE_LIBTEUCHOS due to AC_CHECK_LIB invocation.
+# On success, adds "include Makefile.export.teuchos" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option.
+#
+# When ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
#
# LAST MODIFICATION
#
-# 2008-08-06
+# 2008-11-02
#
# COPYLEFT
#
@@ -27,15 +30,16 @@
AC_DEFUN([AX_TRILINOS_TEUCHOS],[
AC_REQUIRE([AX_TRILINOS_BASE])
ax_trilinos_teuchos=yes
- AC_CHECK_HEADER([Teuchos_Version.hpp],,[ax_trilinos_teuchos=no])
- AC_CHECK_LIB( [teuchos],[main], ,[ax_trilinos_teuchos=no])
+ AC_HAVE_LIBRARY([teuchos],[:],[ax_trilinos_teuchos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([teuchos.macros],[ax_trilinos_teuchos=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([teuchos],[ax_trilinos_teuchos=no])
if test "$ax_trilinos_teuchos" = yes; then
- dnl NOP required
- :
- ifelse([$1], , , [$1])
+ : # NOP
+ ifelse([$1],,,
+ [$1])
else
- dnl NOP required
- :
- ifelse([$2], , , [$2])
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Teuchos not usable]),
+ [$2])
fi
])
diff --git a/ax_trilinos_thyra.m4 b/ax_trilinos_thyra.m4
new file mode 100644
index 0000000..cfb7656
--- /dev/null
+++ b/ax_trilinos_thyra.m4
@@ -0,0 +1,44 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_thyra.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_THYRA([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# On success, adds "include Makefile.export.thyra" statements to every
+# Automake file containing @INC_AMINCLUDE@. Requires that Trilinos was
+# configured with the --enable-export-makefiles option. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LAST MODIFICATION
+#
+# 2008-11-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_THYRA],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ ax_trilinos_thyra=yes
+ AC_HAVE_LIBRARY([thyra],[:],[ax_trilinos_thyra=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([thyra.macros],[ax_trilinos_thyra=no])
+ AX_ADD_AM_TRILINOS_MAKEFILE_EXPORT([thyra],[ax_trilinos_thyra=no])
+ if test "$ax_trilinos_thyra" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Thyra not usable.]),
+ [$2])
+ fi
+])
diff --git a/ax_trilinos_thyra_epetra.m4 b/ax_trilinos_thyra_epetra.m4
new file mode 100644
index 0000000..1efe1d6
--- /dev/null
+++ b/ax_trilinos_thyra_epetra.m4
@@ -0,0 +1,42 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_thyra_epetra.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_THYRA_EPETRA([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Checks if the Thyra/Epetra adapters were compiled with Trilinos. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LAST MODIFICATION
+#
+# 2008-11-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_THYRA_EPETRA],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ AC_REQUIRE([AX_TRILINOS_EPETRA])
+ AC_REQUIRE([AX_TRILINOS_THYRA])
+ ax_trilinos_thyra_epetra=yes
+ AC_HAVE_LIBRARY([thyraepetra],[:],[ax_trilinos_thyra_epetra=no])
+ if test "$ax_trilinos_thyra_epetra" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Thyra/Epetra support not usable.]),
+ [$2])
+ fi
+])
diff --git a/ax_trilinos_thyra_epetraext.m4 b/ax_trilinos_thyra_epetraext.m4
new file mode 100644
index 0000000..218364f
--- /dev/null
+++ b/ax_trilinos_thyra_epetraext.m4
@@ -0,0 +1,42 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ax_trilinos_thyra_epetraext.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_TRILINOS_THYRA_EPETRAEXT([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# Checks if the Thyra/EpetraExt adapters were compiled with Trilinos. When
+# ACTION-IF-NOT-FOUND is not specified, the default behavior is for
+# configure to fail.
+#
+# LAST MODIFICATION
+#
+# 2008-11-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AX_TRILINOS_THYRA_EPETRAEXT],[
+ AC_REQUIRE([AX_TRILINOS_BASE])
+ AC_REQUIRE([AX_TRILINOS_EPETRAEXT])
+ AC_REQUIRE([AX_TRILINOS_THYRA_EPETRA])
+ ax_trilinos_thyra_epetraext=yes
+ AC_HAVE_LIBRARY([thyraepetraext],[:],[ax_trilinos_thyra_epetraext=no])
+ if test "$ax_trilinos_thyra_epetraext" = yes; then
+ : # NOP
+ ifelse([$1],,,
+ [$1])
+ else
+ : # NOP
+ ifelse([$2],,AC_MSG_ERROR([Trilinos Thyra/EpetraExt adapters not usable.]),
+ [$2])
+ fi
+])
diff --git a/gl_trilinos_absolute_header.m4 b/gl_trilinos_absolute_header.m4
new file mode 100644
index 0000000..1da19b5
--- /dev/null
+++ b/gl_trilinos_absolute_header.m4
@@ -0,0 +1,71 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/gl_trilinos_absolute_header.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# gl_TRILINOS_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
+#
+# DESCRIPTION
+#
+# Find the absolute name of a header file, assuming the header exists. If
+# the header were sys/inttypes.h, this macro would define
+# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of
+# sys/inttypes.h in config.h (e.g. `#define ABSOLUTE_SYS_INTTYPES_H
+# "///usr/include/sys/inttypes.h"'). The three "///" are to pacify Sun C
+# 5.8, which otherwise would say "warning: #include of /usr/include/...
+# may be non-portable". Use `""', not `<>', so that the /// cannot be
+# confused with a C99 comment.
+#
+# LAST MODIFICATION
+#
+# 2008-11-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Derek Price
+# Copyright (c) 2008 Rhys Ulerich <rhys.ulerich@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Derek Price.
+dnl Modified by Rhys Ulerich to use AC_CHECK_HEADERS instead of _ONCE
+
+AC_DEFUN([gl_TRILINOS_ABSOLUTE_HEADER],
+[AC_LANG_PREPROC_REQUIRE()dnl
+AC_FOREACH([gl_HEADER_NAME], [$1],
+ [AS_VAR_PUSHDEF([gl_absolute_header],
+ [gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+ AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
+ m4_quote(m4_defn([gl_absolute_header])),
+ [AS_VAR_PUSHDEF([ac_header_exists],
+ [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+ AC_CHECK_HEADERS(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+ if test AS_VAR_GET(ac_header_exists) = yes; then
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
+dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+ AS_VAR_SET(gl_absolute_header,
+[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
+ s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
+ s#^/[^/]#//&#
+ p
+ q
+}'`])
+ fi
+ AS_VAR_POPDEF([ac_header_exists])dnl
+ ])dnl
+ AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))),
+ ["AS_VAR_GET(gl_absolute_header)"],
+ [Define this to an absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
+ AS_VAR_POPDEF([gl_absolute_header])dnl
+])dnl
+])# gl_TRILINOS_ABSOLUTE_HEADER