Rollup merge.
[awesomized/libmemcached] / m4 / pandora_have_libboost_options.m4
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_PROGRAM_OPTIONS],[
7 AC_REQUIRE([AC_LIB_PREFIX])
8
9 dnl --------------------------------------------------------------------
10 dnl Check for boost::program_options
11 dnl --------------------------------------------------------------------
12
13 AC_LANG_PUSH(C++)
14 AC_LIB_HAVE_LINKFLAGS(boost_program_options-mt,,[
15 #include <boost/program_options.hpp>
16 ],[
17 boost::program_options::options_description d;
18 d.add_options()("a","some option");
19 ])
20 AS_IF([test "x${ac_cv_libboost_program_options_mt}" = "xno"],[
21 AC_LIB_HAVE_LINKFLAGS(boost_program_options,,[
22 #include <boost/program_options.hpp>
23 ],[
24 boost::program_options::options_description d;
25 d.add_options()("a","some option");
26 ])
27 ])
28 AC_LANG_POP()
29
30 AM_CONDITIONAL(HAVE_BOOST_PROGRAM_OPTIONS,
31 [test "x${ac_cv_libboost_program_options}" = "xyes" -o "x${ac_cv_libboost_program_options_mt}" = "xyes"])
32 BOOST_LIBS="${BOOST_LIBS} ${LTLIBBOOST_PROGRAM_OPTIONS} ${LTLIBBOOST_PROGRAM_OPTIONS_MT}"
33 AC_SUBST(BOOST_LIBS)
34 ])
35
36 AC_DEFUN([PANDORA_HAVE_BOOST_PROGRAM_OPTIONS],[
37 PANDORA_HAVE_BOOST($1)
38 _PANDORA_SEARCH_BOOST_PROGRAM_OPTIONS($1)
39 ])
40
41 AC_DEFUN([PANDORA_REQUIRE_BOOST_PROGRAM_OPTIONS],[
42 PANDORA_REQUIRE_BOOST($1)
43 _PANDORA_SEARCH_BOOST_PROGRAM_OPTIONS($1)
44 AS_IF([test "x${ac_cv_libboost_program_options}" = "xno" -a "x${ac_cv_libboost_program_options_mt}" = "xno"],
45 AC_MSG_ERROR([boost::program_options is required for ${PACKAGE}]))
46 ])
47