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.

128 lines
4.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_boost_wave.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_BOOST_WAVE
  8. #
  9. # DESCRIPTION
  10. #
  11. # Test for Wave library from the Boost C++ libraries. The macro requires a
  12. # preceding call to AX_BOOST_BASE. Further documentation is available at
  13. # <http://randspringer.de/boost/index.html>.
  14. #
  15. # This macro calls:
  16. #
  17. # AC_SUBST(BOOST_WAVE_LIB)
  18. #
  19. # And sets:
  20. #
  21. # HAVE_BOOST_WAVE
  22. #
  23. # LICENSE
  24. #
  25. # Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
  26. # Copyright (c) 2009 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 16
  33. AC_DEFUN([AX_BOOST_WAVE],
  34. [
  35. AC_ARG_WITH([boost-wave],
  36. AS_HELP_STRING([--with-boost-wave@<:@=special-lib@:>@],
  37. [use the Wave library from boost - it is possible to specify a certain library for the linker
  38. e.g. --with-boost-wave=boost_wave-gcc-mt-d-1_33_1 ]),
  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_wave_lib=""
  45. else
  46. want_boost="yes"
  47. ax_boost_user_wave_lib="$withval"
  48. fi
  49. ],
  50. [want_boost="yes"]
  51. )
  52. AM_CONDITIONAL(ROSE_USE_BOOST_WAVE, test "x$want_boost" = "xyes" )
  53. if test "x$want_boost" = "xyes"; then
  54. AC_REQUIRE([AC_PROG_CC])
  55. CPPFLAGS_SAVED="$CPPFLAGS"
  56. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  57. export CPPFLAGS
  58. LDFLAGS_SAVED="$LDFLAGS"
  59. LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
  60. export LDFLAGS
  61. LIBS_SAVED=$LIBS
  62. LIBS="$LIBS $BOOST_THREAD_LIB"
  63. export LIBS
  64. AC_CACHE_CHECK(whether the Boost::Wave library is available,
  65. ax_cv_boost_wave,
  66. [AC_LANG_PUSH([C++])
  67. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/wave.hpp>
  68. ]],
  69. [[boost::wave::token_category r; return 0;]])],
  70. ax_cv_boost_wave=yes, ax_cv_boost_wave=no)
  71. AC_LANG_POP([C++])
  72. ])
  73. if test "x$ax_cv_boost_wave" = "xyes"; then
  74. AC_DEFINE(HAVE_BOOST_WAVE,,[define if the Boost::Wave library is available])
  75. BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
  76. if test "x$ax_boost_user_wave_lib" = "x"; then
  77. for libextension in `ls $BOOSTLIBDIR/libboost_wave*.so* $BOOSTLIBDIR/libboost_wave*.dylib* $BOOSTLIBDIR/libboost_wave*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_wave.*\)\.so.*$;\1;' -e 's;^lib\(boost_wave.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_wave.*\)\.a.*$;\1;' ` ; do
  78. ax_lib=${libextension}
  79. AC_CHECK_LIB($ax_lib, exit,
  80. [BOOST_WAVE_LIB="-l$ax_lib"; AC_SUBST(BOOST_WAVE_LIB) link_wave="yes"; break],
  81. [link_wave="no"])
  82. done
  83. if test "x$link_wave" != "xyes"; then
  84. for libextension in `ls $BOOSTLIBDIR/boost_wave*.dll* $BOOSTLIBDIR/boost_wave*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_wave.*\)\.dll.*$;\1;' -e 's;^\(boost_wave.*\)\.a.*$;\1;'` ; do
  85. ax_lib=${libextension}
  86. AC_CHECK_LIB($ax_lib, exit,
  87. [BOOST_WAVE_LIB="-l$ax_lib"; AC_SUBST(BOOST_WAVE_LIB) link_wave="yes"; break],
  88. [link_wave="no"])
  89. done
  90. fi
  91. else
  92. for ax_lib in $ax_boost_user_wave_lib boost_wave-$ax_boost_user_wave_lib; do
  93. AC_CHECK_LIB($ax_lib, exit,
  94. [BOOST_WAVE_LIB="-l$ax_lib"; AC_SUBST(BOOST_WAVE_LIB) link_wave="yes"; break],
  95. [link_wave="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_wave" != "xyes"; then
  102. AC_MSG_ERROR(Could not link against $ax_lib !)
  103. fi
  104. # DQ (4/7/2006): build a macro to use in source code to know when WAVE is to be used.
  105. AC_DEFINE([USE_ROSE_BOOST_WAVE_SUPPORT],1,[Controls use of BOOST WAVE support in ROSE.])
  106. else
  107. AC_DEFINE([USE_ROSE_BOOST_WAVE_SUPPORT],0,[Controls use of BOOST WAVE support in ROSE.])
  108. fi
  109. CPPFLAGS="$CPPFLAGS_SAVED"
  110. LDFLAGS="$LDFLAGS_SAVED"
  111. LIBS="$LIBS_SAVED"
  112. fi
  113. ])