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.

115 lines
4.3KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_boost_signals.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_BOOST_SIGNALS
  8. #
  9. # DESCRIPTION
  10. #
  11. # Test for Signals 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_SIGNALS_LIB)
  18. #
  19. # And sets:
  20. #
  21. # HAVE_BOOST_SIGNALS
  22. #
  23. # LICENSE
  24. #
  25. # Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
  26. # Copyright (c) 2008 Michael Tindal
  27. #
  28. # Copying and distribution of this file, with or without modification, are
  29. # permitted in any medium without royalty provided the copyright notice
  30. # and this notice are preserved. This file is offered as-is, without any
  31. # warranty.
  32. #serial 22
  33. AC_DEFUN([AX_BOOST_SIGNALS],
  34. [
  35. AC_ARG_WITH([boost-signals],
  36. AS_HELP_STRING([--with-boost-signals@<:@=special-lib@:>@],
  37. [use the Signals library from boost - it is possible to specify a certain library for the linker
  38. e.g. --with-boost-signals=boost_signals-gcc-mt-d ]),
  39. [
  40. if test "$withval" = "no"; then
  41. want_boost="no"
  42. elif test "$withval" = "yes"; then
  43. want_boost="yes"
  44. ax_boost_user_signals_lib=""
  45. else
  46. want_boost="yes"
  47. ax_boost_user_signals_lib="$withval"
  48. fi
  49. ],
  50. [want_boost="yes"]
  51. )
  52. if test "x$want_boost" = "xyes"; then
  53. AC_REQUIRE([AC_PROG_CC])
  54. CPPFLAGS_SAVED="$CPPFLAGS"
  55. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  56. export CPPFLAGS
  57. LDFLAGS_SAVED="$LDFLAGS"
  58. LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
  59. export LDFLAGS
  60. AC_CACHE_CHECK(whether the Boost::Signals library is available,
  61. ax_cv_boost_signals,
  62. [AC_LANG_PUSH([C++])
  63. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/signal.hpp>
  64. ]],
  65. [[boost::signal<void ()> sig;
  66. return 0;
  67. ]])],
  68. ax_cv_boost_signals=yes, ax_cv_boost_signals=no)
  69. AC_LANG_POP([C++])
  70. ])
  71. if test "x$ax_cv_boost_signals" = "xyes"; then
  72. AC_DEFINE(HAVE_BOOST_SIGNALS,,[define if the Boost::Signals library is available])
  73. BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
  74. if test "x$ax_boost_user_signals_lib" = "x"; then
  75. for libextension in `ls $BOOSTLIBDIR/libboost_signals*.so* $BOOSTLIBDIR/libboost_signals*.dylib* $BOOSTLIBDIR/libboost_signals*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_signals.*\)\.so.*$;\1;' -e 's;^lib\(boost_signals.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_signals.*\)\.a.*$;\1;'` ; do
  76. ax_lib=${libextension}
  77. AC_CHECK_LIB($ax_lib, exit,
  78. [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break],
  79. [link_signals="no"])
  80. done
  81. if test "x$link_signals" != "xyes"; then
  82. for libextension in `ls $BOOSTLIBDIR/boost_signals*.dll* $BOOSTLIBDIR/boost_signals*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_signals.*\)\.dll.*$;\1;' -e 's;^\(boost_signals.*\)\.a*$;\1;'` ; do
  83. ax_lib=${libextension}
  84. AC_CHECK_LIB($ax_lib, exit,
  85. [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break],
  86. [link_signals="no"])
  87. done
  88. fi
  89. else
  90. for ax_lib in $ax_boost_user_signals_lib boost_signals-$ax_boost_user_signals_lib; do
  91. AC_CHECK_LIB($ax_lib, main,
  92. [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break],
  93. [link_signals="no"])
  94. done
  95. fi
  96. if test "x$ax_lib" = "x"; then
  97. AC_MSG_ERROR(Could not find a version of the library!)
  98. fi
  99. if test "x$link_signals" != "xyes"; then
  100. AC_MSG_ERROR(Could not link against $ax_lib !)
  101. fi
  102. fi
  103. CPPFLAGS="$CPPFLAGS_SAVED"
  104. LDFLAGS="$LDFLAGS_SAVED"
  105. fi
  106. ])