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.

44 lines
1.3KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_awk_exit.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_AWK_EXIT([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check if AWK supports exit(). If successful execute ACTION-IF-SUCCESS
  12. # 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_EXIT],[
  30. AC_REQUIRE([AX_NEED_AWK])
  31. AC_MSG_CHECKING([if $AWK supports exit()])
  32. echo "" | $AWK '{ exit(99); }' 2>/dev/null
  33. AS_IF([test $? -eq 99],[
  34. AC_MSG_RESULT([yes])
  35. $1
  36. ],[
  37. AC_MSG_RESULT([no])
  38. $2
  39. ])
  40. ])