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.

36 lines
1.2KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_awk_rand.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_AWK_RAND([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check if AWK supports rand() function. If successful execute
  12. # ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
  13. #
  14. # This work is heavily based upon testawk.sh script by Heiner Steven. You
  15. # should find his script (and related works) at
  16. # <http://www.shelldorado.com/articles/awkcompat.html>. Thanks to
  17. # Alessandro Massignan for his suggestions and extensive nawk tests on
  18. # FreeBSD.
  19. #
  20. # LICENSE
  21. #
  22. # Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
  23. #
  24. # Copying and distribution of this file, with or without modification, are
  25. # permitted in any medium without royalty provided the copyright notice
  26. # and this notice are preserved. This file is offered as-is, without any
  27. # warranty.
  28. #serial 9
  29. AC_DEFUN([AX_CHECK_AWK_RAND], [
  30. AX_TRY_AWK_ANYOUT([rand()],
  31. [],[ print rand() ],
  32. [$1],[$2])
  33. ])