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.

42 lines
1.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_require_one_func.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_REQUIRE_ONE_FUNC (FUNCTION..., [ACTION-IF-ANY-FOUND], [ACTION-IF-NONE-FOUND])
  8. #
  9. # DESCRIPTION
  10. #
  11. # AX_REQUIRE_ONE_FUNC is a simple wrapper for AC_CHECK_FUNCS. It calls
  12. # AC_CHECK_FUNCS on the list of functions named in the first argument,
  13. # then invokes ACTION-IF-ANY-FOUND if at least one of the functions exists
  14. # or ACTION-IF-NONE-FOUND if none of the functions exist.
  15. #
  16. # Here's an example:
  17. #
  18. # AX_REQUIRE_ONE_FUNC([posix_memalign memalign valloc], ,
  19. # [AC_MSG_ERROR([unable to allocate page-aligned memory])])
  20. #
  21. # LICENSE
  22. #
  23. # Copyright (c) 2008 Scott Pakin <pakin@uiuc.edu>
  24. #
  25. # Copying and distribution of this file, with or without modification, are
  26. # permitted in any medium without royalty provided the copyright notice
  27. # and this notice are preserved. This file is offered as-is, without any
  28. # warranty.
  29. #serial 9
  30. AC_DEFUN([AX_REQUIRE_ONE_FUNC],
  31. [m4_define([ax_1func_cv], [AS_TR_SH(ax_cv_func_any_$1)])
  32. AC_CACHE_VAL([ax_1func_cv],
  33. [ax_1func_cv=no
  34. AC_CHECK_FUNCS([$1], [ax_1func_cv="$ax_1func_cv $ac_func"])])
  35. AS_IF([test "$ax_1func_cv" = "no"],
  36. [$3],
  37. [ax_1func_cv=`echo $ax_1func_cv | sed 's/^no //'`
  38. $2])
  39. ])