mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
Add basic regex compatibility test.
This commit is contained in:
parent
446ef413f6
commit
feb28db2a1
@ -608,6 +608,40 @@ AC_DEFUN([OL_LINUX_THREADS], [
|
||||
])dnl
|
||||
dnl
|
||||
dnl ====================================================================
|
||||
dnl Check for POSIX Regex
|
||||
AC_DEFUN([OL_POSIX_REGEX], [
|
||||
AC_MSG_CHECKING([for compatible POSIX regex])
|
||||
AC_CACHE_VAL(ol_cv_c_posix_regex,[
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
static char *pattern, *string;
|
||||
main()
|
||||
{
|
||||
int rc;
|
||||
regex_t re;
|
||||
|
||||
pattern = "^A";
|
||||
|
||||
if(regcomp(&re, pattern, 0)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
string = "ALL MATCH";
|
||||
|
||||
rc = regexec(&re, string, 0, (void*)0, 0);
|
||||
|
||||
regfree(&re);
|
||||
|
||||
return rc;
|
||||
}],
|
||||
[ol_cv_c_posix_regex=yes],
|
||||
[ol_cv_c_posix_regex=no],
|
||||
[ol_cv_c_posix_regex=cross])])
|
||||
AC_MSG_RESULT($ol_cv_c_posix_regex)
|
||||
])
|
||||
dnl
|
||||
dnl ====================================================================
|
||||
dnl Check if toupper() requires islower() to be called first
|
||||
AC_DEFUN([OL_C_UPPER_LOWER],
|
||||
[
|
||||
|
@ -500,6 +500,11 @@ if test "$ac_cv_header_regex_h" != yes ; then
|
||||
fi
|
||||
AC_CHECK_FUNC(regfree, :, AC_MSG_ERROR([POSIX regex required.]))
|
||||
|
||||
OL_POSIX_REGEX
|
||||
if test "$ol_cv_c_posix_regex" = no ; then
|
||||
AC_MSG_ERROR([broken POSIX regex!])
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
|
||||
|
||||
dnl Select arg types
|
||||
|
Loading…
Reference in New Issue
Block a user