+ # However, if the system regex support is good enough that it passes the
+ # the following run test, then default to *not* using the included regex.c.
+ # If cross compiling, assume the test would fail and use the included
+ # regex.c. The failing regular expression is from `Spencer ere test #75'
+ # in grep-2.3.
+ AC_CACHE_CHECK([for working re_compile_pattern],
+ jm_cv_func_working_re_compile_pattern,
+ AC_TRY_RUN(
+ changequote(<<, >>)dnl
+ <<
+#include <stdio.h>
+#include <regex.h>
+ int
+ main ()
+ {
+ static struct re_pattern_buffer regex;
+ const char *s;
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ /* Add this third left square bracket, [, to balance the
+ three right ones below. Otherwise autoconf-2.14 chokes. */
+ s = re_compile_pattern ("a[[:]:]]b\n", 9, ®ex);
+ /* This should fail with _Invalid character class name_ error. */
+ exit (s ? 0 : 1);
+ }
+ >>,
+ changequote([, ])dnl