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.

114 lines
3.6KB

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