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.

47 lines
1.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_check_posix_regcomp.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CHECK_POSIX_REGCOMP
  8. #
  9. # DESCRIPTION
  10. #
  11. # Check that the POSIX compliant regular expression compiler is available
  12. # in the POSIX specified manner, and it works. If it fails, we have a
  13. # backup -- use gnu-regex.
  14. #
  15. # LICENSE
  16. #
  17. # Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
  18. #
  19. # Copying and distribution of this file, with or without modification, are
  20. # permitted in any medium without royalty provided the copyright notice
  21. # and this notice are preserved. This file is offered as-is, without any
  22. # warranty.
  23. #serial 6
  24. AU_ALIAS([AG_CHECK_POSIX_REGCOMP], [AX_CHECK_POSIX_REGCOMP])
  25. AC_DEFUN([AX_CHECK_POSIX_REGCOMP],[
  26. AC_MSG_CHECKING([whether POSIX compliant regcomp()/regexec()])
  27. AC_CACHE_VAL([ax_cv_posix_regcomp],[
  28. AC_TRY_RUN([#include <sys/types.h>
  29. #include <regex.h>
  30. int main() {
  31. int flags = REG_EXTENDED|REG_ICASE|REG_NEWLINE;
  32. regex_t re;
  33. if (regcomp( &re, "^.*$", flags ) != 0)
  34. return 1;
  35. return regcomp( &re, "|no.*", flags ); }],[ax_cv_posix_regcomp=yes],[ax_cv_posix_regcomp=no],[ax_cv_posix_regcomp=no]
  36. ) # end of TRY_RUN]) # end of CACHE_VAL
  37. AC_MSG_RESULT([$ax_cv_posix_regcomp])
  38. if test x$ax_cv_posix_regcomp = xyes
  39. then
  40. AC_DEFINE(HAVE_POSIX_REGCOMP, 1,
  41. [Define this if POSIX compliant regcomp()/regexec()])
  42. fi
  43. ]) # end of AC_DEFUN of AX_CHECK_POSIX_REGCOMP