From 3fd22b7b86ebad8fbd4b66da3d63e6d9c1ca829c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Dec 2010 11:38:49 +0200 Subject: Detect TR1 availability Also use the wrapper header from libodb. --- m4/tr1-memory.m4 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 m4/tr1-memory.m4 (limited to 'm4') diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 new file mode 100644 index 0000000..7b78577 --- /dev/null +++ b/m4/tr1-memory.m4 @@ -0,0 +1,40 @@ +dnl file : m4/tr1-memory.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl TR1_MEMORY +dnl +dnl Check for TR1 availability. If successful, define HAVE_TR1_MEMORY +dnl as both a macro and conditional as well as set the tr1_memory variable +dnl to 'yes'. +dnl +AC_DEFUN([TR1_MEMORY], +[ +tr1_memory=no + +AC_MSG_CHECKING([for TR1 ]) + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +int +main () +{ + std::tr1::shared_ptr p (new int (10)); + *p = 11; +} +]]), +[tr1_memory=yes]) + +if test x"$tr1_memory" = xyes; then + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_TR1_MEMORY], [1], [Have TR1 .]) +else + AC_MSG_RESULT([no]) +fi + +AM_CONDITIONAL([HAVE_TR1_MEMORY], [test x$tr1_memory = xyes]) + +])dnl -- cgit v1.1