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.

53 lines
1.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_cxx_have_hash.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CXX_HAVE_HASH()
  8. #
  9. # DESCRIPTION
  10. #
  11. # This macro checks if std::hash, added in C++11, is defined in the
  12. # <functional> header.
  13. #
  14. # If it is, define the ax_cv_cxx_have_hash environment variable to "yes"
  15. # and define HAVE_CXX_HASH.
  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_HASH],
  27. [AC_CACHE_CHECK(
  28. [for std::hash in functional],
  29. ax_cv_cxx_have_hash,
  30. [dnl
  31. AC_LANG_PUSH([C++])
  32. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  33. [
  34. [#include <functional>]
  35. [#include <string>]
  36. [using std::hash;]
  37. ],
  38. []
  39. )],
  40. [ax_cv_cxx_have_hash=yes],
  41. [ax_cv_cxx_have_hash=no]
  42. )
  43. AC_LANG_POP([C++])])
  44. if test x"$ax_cv_cxx_have_hash" = "xyes"
  45. then
  46. AC_DEFINE(HAVE_CXX_HASH,
  47. 1,
  48. [Define if functional defines the std::hash class.])
  49. fi
  50. ])