|
Packit Service |
c5cf8c |
# ===========================================================================
|
|
Packit Service |
c5cf8c |
# https://www.gnu.org/software/autoconf-archive/ax_check_posix_regcomp.html
|
|
Packit Service |
c5cf8c |
# ===========================================================================
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# SYNOPSIS
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# AX_CHECK_POSIX_REGCOMP
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# DESCRIPTION
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# Check that the POSIX compliant regular expression compiler is available
|
|
Packit Service |
c5cf8c |
# in the POSIX specified manner, and it works. If it fails, we have a
|
|
Packit Service |
c5cf8c |
# backup -- use gnu-regex.
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# LICENSE
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# Copyright (c) 2008 Bruce Korb <bkorb@gnu.org>
|
|
Packit Service |
c5cf8c |
#
|
|
Packit Service |
c5cf8c |
# Copying and distribution of this file, with or without modification, are
|
|
Packit Service |
c5cf8c |
# permitted in any medium without royalty provided the copyright notice
|
|
Packit Service |
c5cf8c |
# and this notice are preserved. This file is offered as-is, without any
|
|
Packit Service |
c5cf8c |
# warranty.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#serial 6
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
AU_ALIAS([AG_CHECK_POSIX_REGCOMP], [AX_CHECK_POSIX_REGCOMP])
|
|
Packit Service |
c5cf8c |
AC_DEFUN([AX_CHECK_POSIX_REGCOMP],[
|
|
Packit Service |
c5cf8c |
AC_MSG_CHECKING([whether POSIX compliant regcomp()/regexec()])
|
|
Packit Service |
c5cf8c |
AC_CACHE_VAL([ax_cv_posix_regcomp],[
|
|
Packit Service |
c5cf8c |
AC_TRY_RUN([
|
|
Packit Service |
c5cf8c |
#include <sys/types.h>
|
|
Packit Service |
c5cf8c |
#include <regex.h>
|
|
Packit Service |
c5cf8c |
int main() {
|
|
Packit Service |
c5cf8c |
int flags = REG_EXTENDED|REG_ICASE|REG_NEWLINE;
|
|
Packit Service |
c5cf8c |
regex_t re;
|
|
Packit Service |
c5cf8c |
if (regcomp( &re, "^.*$", flags ) != 0)
|
|
Packit Service |
c5cf8c |
return 1;
|
|
Packit Service |
c5cf8c |
return regcomp( &re, "yes.*|no.*", flags );
|
|
Packit Service |
c5cf8c |
}],
|
|
Packit Service |
c5cf8c |
[ax_cv_posix_regcomp=yes],[ax_cv_posix_regcomp=no],[ax_cv_posix_regcomp=no]
|
|
Packit Service |
c5cf8c |
) # end of TRY_RUN]) # end of CACHE_VAL
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
AC_MSG_RESULT([$ax_cv_posix_regcomp])
|
|
Packit Service |
c5cf8c |
if test "$ax_cv_posix_regcomp" = "yes"; then
|
|
Packit Service |
c5cf8c |
AC_DEFINE(HAVE_POSIX_REGCOMP, 1,
|
|
Packit Service |
c5cf8c |
[Define this if POSIX compliant regcomp()/regexec()])
|
|
Packit Service |
c5cf8c |
fi
|
|
Packit Service |
c5cf8c |
]) # end of AC_DEFUN of AX_CHECK_POSIX_REGCOMP
|