Skip to content
Snippets Groups Projects
Commit feb28db2 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add basic regex compatibility test.

parent 446ef413
No related branches found
No related tags found
No related merge requests found
...@@ -608,6 +608,40 @@ AC_DEFUN([OL_LINUX_THREADS], [ ...@@ -608,6 +608,40 @@ AC_DEFUN([OL_LINUX_THREADS], [
])dnl ])dnl
dnl 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 dnl Check if toupper() requires islower() to be called first
AC_DEFUN([OL_C_UPPER_LOWER], AC_DEFUN([OL_C_UPPER_LOWER],
[ [
......
This diff is collapsed.
...@@ -500,6 +500,11 @@ if test "$ac_cv_header_regex_h" != yes ; then ...@@ -500,6 +500,11 @@ if test "$ac_cv_header_regex_h" != yes ; then
fi fi
AC_CHECK_FUNC(regfree, :, AC_MSG_ERROR([POSIX regex required.])) 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.])) AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
dnl Select arg types dnl Select arg types
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment