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.

68 lines
2.6KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_c_var_func.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_C_VAR_FUNC
  8. #
  9. # DESCRIPTION
  10. #
  11. # This macro tests if the C complier supports the C9X standard __func__
  12. # identifier.
  13. #
  14. # The new C9X standard for the C language stipulates that the identifier
  15. # __func__ shall be implicitly declared by the compiler as if, immediately
  16. # following the opening brace of each function definition, the declaration
  17. #
  18. # static const char __func__[] = "function-name";
  19. #
  20. # appeared, where function-name is the name of the function where the
  21. # __func__ identifier is used.
  22. #
  23. # LICENSE
  24. #
  25. # Copyright (c) 2008 Christopher Currie <christopher@currie.com>
  26. #
  27. # This program is free software; you can redistribute it and/or modify it
  28. # under the terms of the GNU General Public License as published by the
  29. # Free Software Foundation; either version 2 of the License, or (at your
  30. # option) any later version.
  31. #
  32. # This program is distributed in the hope that it will be useful, but
  33. # WITHOUT ANY WARRANTY; without even the implied warranty of
  34. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  35. # Public License for more details.
  36. #
  37. # You should have received a copy of the GNU General Public License along
  38. # with this program. If not, see <https://www.gnu.org/licenses/>.
  39. #
  40. # As a special exception, the respective Autoconf Macro's copyright owner
  41. # gives unlimited permission to copy, distribute and modify the configure
  42. # scripts that are the output of Autoconf when processing the Macro. You
  43. # need not follow the terms of the GNU General Public License when using
  44. # or distributing such scripts, even though portions of the text of the
  45. # Macro appear in them. The GNU General Public License (GPL) does govern
  46. # all other use of the material that constitutes the Autoconf Macro.
  47. #
  48. # This special exception to the GPL applies to versions of the Autoconf
  49. # Macro released by the Autoconf Archive. When you make and distribute a
  50. # modified version of the Autoconf Macro, you may extend this special
  51. # exception to the GPL to apply to your modified version as well.
  52. #serial 10
  53. AU_ALIAS([AC_C_VAR_FUNC], [AX_C_VAR_FUNC])
  54. AC_DEFUN([AX_C_VAR_FUNC],
  55. [AC_REQUIRE([AC_PROG_CC])
  56. AC_CACHE_CHECK(whether $CC recognizes __func__, ac_cv_c_var_func,
  57. AC_TRY_COMPILE(,
  58. [int main() {
  59. char *s = __func__;
  60. }], ac_cv_c_var_func=yes,
  61. ac_cv_c_var_func=no) )
  62. if test "x$ac_cv_c_var_func" = xyes; then
  63. AC_DEFINE(HAVE_FUNC,,[Define if the C complier supports __func__])
  64. fi
  65. ])dnl