~drizzle-trunk/drizzle/development

1377.3.4 by Monty Taylor
Wow. Actually check this in. :)
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++)
1643.1.12 by Monty Taylor
Updated pandora-build files to version 0.136
22
    AC_LIB_HAVE_LINKFLAGS(c,,
23
      [#include <boost/pool/pool.hpp>],
24
      [boost::pool<> test_pool(1);],
25
      [system])
1377.3.4 by Monty Taylor
Wow. Actually check this in. :)
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