~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/shared_ptr.m4

  • Committer: Brian Aker
  • Date: 2009-05-11 17:50:22 UTC
  • Revision ID: brian@gaz-20090511175022-y35q9ky6uh9ldcjt
Replacing Sun employee copyright headers (aka... anything done by a Sun
employee is copyright by Sun).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl  Copyright (C) 2009 Sun Microsystems
2
 
dnl This file is free software; Sun Microsystems
3
 
dnl gives unlimited permission to copy and/or distribute it,
4
 
dnl with or without modifications, as long as this notice is preserved.
5
 
 
6
 
dnl We check two things: where is the memory include file, and in what
7
 
dnl namespace does shared_ptr reside.
8
 
dnl We include AC_COMPILE_IFELSE for all the combinations we've seen in the
9
 
dnl wild:
10
 
dnl 
11
 
dnl  GCC 4.3: namespace: std::  #include <memory>
12
 
dnl  GCC 4.2: namespace: tr1::  #include <tr1/memory>
13
 
dnl  GCC 4.2: namespace: boost::  #include <boost/shared_ptr.hpp>
14
 
dnl
15
 
dnl We define one of HAVE_HAVE_TR1_SHARED_PTR or HAVE_BOOST_SHARED_PTR
16
 
dnl depending on location, and SHARED_PTR_NAMESPACE to be the namespace in
17
 
dnl which shared_ptr is defined.
18
 
dnl 
19
 
 
20
 
AC_DEFUN([PANDORA_SHARED_PTR],[
21
 
  AC_REQUIRE([PANDORA_CHECK_CXX_STANDARD])
 
1
# We check two things: where is the memory include file, and in what
 
2
# namespace does shared_ptr reside.
 
3
# We include AC_COMPILE_IFELSE for all the combinations we've seen in the
 
4
# wild:
 
5
 
6
#  GCC 4.3: namespace: std::  #include <memory>
 
7
#  GCC 4.2: namespace: tr1::  #include <tr1/memory>
 
8
#  GCC 4.2: namespace: boost::  #include <boost/shared_ptr.hpp>
 
9
#
 
10
# We define one of HAVE_HAVE_TR1_SHARED_PTR or HAVE_BOOST_SHARED_PTR
 
11
# depending on location, and SHARED_PTR_NAMESPACE to be the namespace in
 
12
# which shared_ptr is defined.
 
13
#
 
14
 
 
15
AC_DEFUN([AC_CXX_SHARED_PTR],[
 
16
  AC_REQUIRE([AC_CXX_CHECK_STANDARD])
22
17
  AC_LANG_PUSH(C++)
23
 
  save_CXXFLAGS="${CXXFLAGS}"
24
 
  CXXFLAGS="${CXX_STANDARD} ${CXXFLAGS}"
25
18
  AC_CHECK_HEADERS(memory tr1/memory boost/shared_ptr.hpp)
26
19
  AC_CACHE_CHECK([the location of shared_ptr header file],
27
20
    [ac_cv_shared_ptr_h],[
48
41
            [
49
42
              ac_cv_shared_ptr_namespace="${namespace}"
50
43
              break
51
 
            ],[ac_cv_shared_ptr_namespace=missing])
 
44
            ],[ac_cv_shared_ptr_namespace=no])
52
45
       done
53
46
  ])
 
47
  if test "$ac_cv_shared_ptr_namespace" = no
 
48
  then
 
49
    AC_MSG_WARN([a usable shared_ptr implementation was not found. Let someone know what your platform is.])
 
50
    dnl AC_MSG_WARN([a usable shared_ptr implementation is required. If you are on Solaris, please install boost, either via pkg install boost, or pkg-get -i boost. If you are elsewhere, please file a bug])
 
51
  fi
54
52
  AC_DEFINE_UNQUOTED([SHARED_PTR_NAMESPACE],
55
53
                     ${ac_cv_shared_ptr_namespace},
56
54
                     [The namespace in which SHARED_PTR can be found])
57
 
  CXXFLAGS="${save_CXXFLAGS}"
58
55
  AC_LANG_POP()
59
56
])