~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_have_boost.m4

  • Committer: Monty Taylor
  • Date: 2008-10-16 09:12:23 UTC
  • mto: (511.1.6 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016091223-17ngih0qu9vssjs3
We pass -Wunused-macros now!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl Copyright (C) 2010 Monty Taylor
2
 
dnl This file is free software; Monty Taylor
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
 
AC_DEFUN([_PANDORA_SEARCH_BOOST],[
7
 
  AC_REQUIRE([AC_LIB_PREFIX])
8
 
 
9
 
  dnl --------------------------------------------------------------------
10
 
  dnl  Check for boost
11
 
  dnl --------------------------------------------------------------------
12
 
 
13
 
  AC_ARG_ENABLE([boost],
14
 
    [AS_HELP_STRING([--disable-boost],
15
 
      [Build with boost support @<:@default=on@:>@])],
16
 
    [ac_enable_boost="$enableval"],
17
 
    [ac_enable_boost="yes"])
18
 
 
19
 
  AS_IF([test "x$ac_enable_boost" = "xyes"],[
20
 
    dnl link against libc because we're just looking for headers here
21
 
    AC_LANG_PUSH(C++)
22
 
    AC_LIB_HAVE_LINKFLAGS(c,,
23
 
      [#include <boost/pool/pool.hpp>],
24
 
      [boost::pool<> test_pool(1);],
25
 
      [system])
26
 
    AC_LANG_POP()
27
 
  ],[
28
 
    ac_cv_boost="no"
29
 
  ])
30
 
  
31
 
 
32
 
  AS_IF([test "x$1" != "x"],[
33
 
    AC_CACHE_CHECK([if boost is recent enough],
34
 
      [pandora_cv_recent_boost],[
35
 
      pandora_need_boost_version=`echo "$1" | perl -nle '/(\d+)\.(\d+)/; printf "%d%0.3d00", $[]1, $[]2 ;'`
36
 
      AS_IF([test "x${pandora_need_boost_version}" = "x000000"],[
37
 
        pandora_cv_recent_boost=yes
38
 
      ],[
39
 
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
40
 
#include <boost/version.hpp>
41
 
 
42
 
#if BOOST_VERSION < ${pandora_need_boost_version}
43
 
# error boost too old!
44
 
#endif
45
 
          ]],[[]])
46
 
        ],[
47
 
          pandora_cv_recent_boost=yes
48
 
        ],[
49
 
          pandora_cv_recent_boost=no
50
 
        ])
51
 
      ])
52
 
    ])
53
 
    AS_IF([test "x${pandora_cv_recent_boost}" = "xno"],[
54
 
      ac_cv_boost=no
55
 
    ])
56
 
  ])
57
 
      
58
 
 
59
 
  AM_CONDITIONAL(HAVE_BOOST, [test "x${ac_cv_boost}" = "xyes"])
60
 
  
61
 
])
62
 
 
63
 
AC_DEFUN([PANDORA_HAVE_BOOST],[
64
 
  _PANDORA_SEARCH_BOOST($1)
65
 
])
66
 
 
67
 
AC_DEFUN([PANDORA_REQUIRE_BOOST],[
68
 
  PANDORA_HAVE_BOOST($1)
69
 
  AS_IF([test x$ac_cv_boost = xno],
70
 
      AC_MSG_ERROR([boost is required for ${PACKAGE}]))
71
 
])
72