Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
4.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_boost_iostreams.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_BOOST_IOSTREAMS
  8. #
  9. # DESCRIPTION
  10. #
  11. # Test for IOStreams library from the Boost C++ libraries. The macro
  12. # requires a preceding call to AX_BOOST_BASE. Further documentation is
  13. # available at <http://randspringer.de/boost/index.html>.
  14. #
  15. # This macro calls:
  16. #
  17. # AC_SUBST(BOOST_IOSTREAMS_LIB)
  18. #
  19. # And sets:
  20. #
  21. # HAVE_BOOST_IOSTREAMS
  22. #
  23. # LICENSE
  24. #
  25. # Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
  26. #
  27. # Copying and distribution of this file, with or without modification, are
  28. # permitted in any medium without royalty provided the copyright notice
  29. # and this notice are preserved. This file is offered as-is, without any
  30. # warranty.
  31. #serial 21
  32. AC_DEFUN([AX_BOOST_IOSTREAMS],
  33. [
  34. AC_ARG_WITH([boost-iostreams],
  35. AS_HELP_STRING([--with-boost-iostreams@<:@=special-lib@:>@],
  36. [use the IOStreams library from boost - it is possible to specify a certain library for the linker
  37. e.g. --with-boost-iostreams=boost_iostreams-gcc-mt-d-1_33_1 ]),
  38. [
  39. if test "$withval" = "no"; then
  40. want_boost="no"
  41. elif test "$withval" = "yes"; then
  42. want_boost="yes"
  43. ax_boost_user_iostreams_lib=""
  44. else
  45. want_boost="yes"
  46. ax_boost_user_iostreams_lib="$withval"
  47. fi
  48. ],
  49. [want_boost="yes"]
  50. )
  51. if test "x$want_boost" = "xyes"; then
  52. AC_REQUIRE([AC_PROG_CC])
  53. CPPFLAGS_SAVED="$CPPFLAGS"
  54. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  55. export CPPFLAGS
  56. LDFLAGS_SAVED="$LDFLAGS"
  57. LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
  58. export LDFLAGS
  59. AC_CACHE_CHECK(whether the Boost::IOStreams library is available,
  60. ax_cv_boost_iostreams,
  61. [AC_LANG_PUSH([C++])
  62. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/iostreams/filtering_stream.hpp>
  63. @%:@include <boost/range/iterator_range.hpp>
  64. ]],
  65. [[std::string input = "Hello World!";
  66. namespace io = boost::iostreams;
  67. io::filtering_istream in(boost::make_iterator_range(input));
  68. return 0;
  69. ]])],
  70. ax_cv_boost_iostreams=yes, ax_cv_boost_iostreams=no)
  71. AC_LANG_POP([C++])
  72. ])
  73. if test "x$ax_cv_boost_iostreams" = "xyes"; then
  74. AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available])
  75. BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
  76. if test "x$ax_boost_user_iostreams_lib" = "x"; then
  77. for libextension in `ls $BOOSTLIBDIR/libboost_iostreams*.so* $BOOSTLIBDIR/libboost_iostream*.dylib* $BOOSTLIBDIR/libboost_iostreams*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_iostreams.*\)\.so.*$;\1;' -e 's;^lib\(boost_iostream.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_iostreams.*\)\.a.*$;\1;'` ; do
  78. ax_lib=${libextension}
  79. AC_CHECK_LIB($ax_lib, exit,
  80. [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
  81. [link_iostreams="no"])
  82. done
  83. if test "x$link_iostreams" != "xyes"; then
  84. for libextension in `ls $BOOSTLIBDIR/boost_iostreams*.dll* $BOOSTLIBDIR/boost_iostreams*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_iostreams.*\)\.dll.*$;\1;' -e 's;^\(boost_iostreams.*\)\.a.*$;\1;'` ; do
  85. ax_lib=${libextension}
  86. AC_CHECK_LIB($ax_lib, exit,
  87. [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
  88. [link_iostreams="no"])
  89. done
  90. fi
  91. else
  92. for ax_lib in $ax_boost_user_iostreams_lib boost_iostreams-$ax_boost_user_iostreams_lib; do
  93. AC_CHECK_LIB($ax_lib, main,
  94. [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
  95. [link_iostreams="no"])
  96. done
  97. fi
  98. if test "x$ax_lib" = "x"; then
  99. AC_MSG_ERROR(Could not find a version of the library!)
  100. fi
  101. if test "x$link_iostreams" != "xyes"; then
  102. AC_MSG_ERROR(Could not link against $ax_lib !)
  103. fi
  104. fi
  105. CPPFLAGS="$CPPFLAGS_SAVED"
  106. LDFLAGS="$LDFLAGS_SAVED"
  107. fi
  108. ])