aboutsummaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-01-13 11:31:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-01-13 11:31:14 +0200
commitab51fa65f9e8cad4ef5a1db85029dfe6404e9a1f (patch)
tree36c78dd50d88e4797f2bbb886c41399006111fea /m4
parent5511613df7dce6142a84111488aaa25ff792d66b (diff)
Add composite, relationship, and inverse examples
All add the TR1 <memory> test for the latter two examples.
Diffstat (limited to 'm4')
-rw-r--r--m4/tr1-memory.m440
1 files changed, 40 insertions, 0 deletions
diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4
new file mode 100644
index 0000000..29966b3
--- /dev/null
+++ b/m4/tr1-memory.m4
@@ -0,0 +1,40 @@
+dnl file : m4/tr1-memory.m4
+dnl author : Boris Kolpackov <boris@codesynthesis.com>
+dnl copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+dnl license : GNU GPL v2; see accompanying LICENSE file
+dnl
+dnl TR1_MEMORY
+dnl
+dnl Check for TR1 <memory> 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 <memory>])
+
+CXX_LIBTOOL_LINK_IFELSE(
+AC_LANG_SOURCE([[
+#include <odb/tr1/memory.hxx>
+
+int
+main ()
+{
+ std::tr1::shared_ptr<int> 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 <memory>.])
+else
+ AC_MSG_RESULT([no])
+fi
+
+AM_CONDITIONAL([HAVE_TR1_MEMORY], [test x$tr1_memory = xyes])
+
+])dnl