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.

52 lines
1.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_cxx_have_function.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CXX_HAVE_FUNCTION()
  8. #
  9. # DESCRIPTION
  10. #
  11. # This macro checks if std::function, added in C++11, is defined in the
  12. # <functional> header.
  13. #
  14. # If it is, define the ax_cv_cxx_have_function environment variable to
  15. # "yes" and define HAVE_CXX_FUNCTION.
  16. #
  17. # LICENSE
  18. #
  19. # Copyright (c) 2014 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>
  20. #
  21. # Copying and distribution of this file, with or without modification, are
  22. # permitted in any medium without royalty provided the copyright notice
  23. # and this notice are preserved. This file is offered as-is, without any
  24. # warranty.
  25. #serial 3
  26. AC_DEFUN([AX_CXX_HAVE_FUNCTION],
  27. [AC_CACHE_CHECK(
  28. [for std::bad_function_call in functional],
  29. ax_cv_cxx_have_function,
  30. [dnl
  31. AC_LANG_PUSH([C++])
  32. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  33. [
  34. [#include <functional>]
  35. [using std::bad_function_call;]
  36. ],
  37. []
  38. )],
  39. [ax_cv_cxx_have_function=yes],
  40. [ax_cv_cxx_have_function=no]
  41. )
  42. AC_LANG_POP([C++])])
  43. if test x"$ax_cv_cxx_have_function" = "xyes"
  44. then
  45. AC_DEFINE(HAVE_CXX_FUNCTION,
  46. 1,
  47. [Define if functional defines the std::bad_function_call class.])
  48. fi
  49. ])