1 dnl Copyright (C) 2010 Andrew Hutchings
2 dnl This file is free software; Andrew Hutchings
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
6 AC_DEFUN([_PANDORA_SEARCH_BOOST_IOSTREAMS],[
7 AC_REQUIRE([AC_LIB_PREFIX])
9 dnl --------------------------------------------------------------------
10 dnl Check for Boost.Iostreams
11 dnl --------------------------------------------------------------------
14 AC_LIB_HAVE_LINKFLAGS(boost_iostreams-mt,,[
15 #include <boost/iostreams/stream.hpp>
16 #include <boost/iostreams/device/array.hpp>
18 const char* input= "hello world";
19 boost::iostreams::stream<boost::iostreams::array_source> in(input, strlen(input));
21 AS_IF([test "x${ac_cv_libboost_iostreams_mt}" = "xno"],[
22 AC_LIB_HAVE_LINKFLAGS(boost_iostreams,,[
23 #include <boost/iostreams/stream.hpp>
24 #include <boost/iostreams/device/array.hpp>
26 const char* input= "hello world";
27 boost::iostreams::stream<boost::iostreams::array_source> in(input, strlen(input));
32 AM_CONDITIONAL(HAVE_BOOST_IOSTREAMS,
33 [test "x${ac_cv_libboost_iostreams}" = "xyes" -o "x${ac_cv_libboost_iostreams_mt}" = "xyes"])
34 BOOST_LIBS="${BOOST_LIBS} ${LTLIBBOOST_IOSTREAMS_MT} ${LTLIBBOOST_IOSTREAMS}"
38 AC_DEFUN([PANDORA_HAVE_BOOST_IOSTREAMS],[
39 PANDORA_HAVE_BOOST($1)
40 _PANDORA_SEARCH_BOOST_IOSTREAMS($1)
43 AC_DEFUN([PANDORA_REQUIRE_BOOST_IOSTREAMS],[
44 PANDORA_REQUIRE_BOOST($1)
45 _PANDORA_SEARCH_BOOST_IOSTREAMS($1)
46 AS_IF([test "x${ac_cv_libboost_iostreams}" = "xno" -a "x${ac_cv_libboost_iostreams_mt}" = "xno"],
47 AC_MSG_ERROR([Boost.Iostreams is required for ${PACKAGE}]))