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.

50 lines
1.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_awk__v.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_AWK__V([ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check if AWK supports -v option ($AWK -v var=val '<PROGRAM>'). If
  12. # successful execute 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__V],[
  30. AC_REQUIRE([AX_NEED_AWK])
  31. AC_MSG_CHECKING([if $AWK supports -v option])
  32. ax_try_awk_output=`echo "" | $AWK -v variable=A '{ print variable; }' 2> /dev/null`
  33. AS_IF([test $? -eq 0],[
  34. AS_IF([test "X$ax_try_awk_output" = "XA"],[
  35. AC_MSG_RESULT([yes])
  36. $1
  37. ],[
  38. AC_MSG_RESULT([no])
  39. $2
  40. ])
  41. ],[
  42. AC_MSG_RESULT([no])
  43. $2
  44. ])
  45. ])