- exit (0);
- }
- ],
- jm_cv_func_working_re_compile_pattern=yes,
- jm_cv_func_working_re_compile_pattern=no,
- dnl When crosscompiling, assume it's broken.
- jm_cv_func_working_re_compile_pattern=no))
- if test $jm_cv_func_working_re_compile_pattern = yes; then
- ac_use_included_regex=no
- fi
-
- test -n "$1" || AC_MSG_ERROR([missing argument])
- m4_syscmd([test -f $1])
- ifelse(m4_sysval, 0,
- [
- AC_ARG_WITH(included-regex,
- [ --without-included-regex don't compile regex; this is the default on
- systems with version 2 of the GNU C library
- (use with caution on other system)],
- jm_with_regex=$withval,
- jm_with_regex=$ac_use_included_regex)
- if test "$jm_with_regex" = yes; then
- AC_LIBOBJ(regex)
- jm_PREREQ_REGEX
- fi
- ],
- )
- ]
-)
-
-# Prerequisites of lib/regex.c.
-AC_DEFUN([jm_PREREQ_REGEX],
-[
- dnl FIXME: Maybe provide a btowc replacement someday: Solaris 2.5.1 lacks it.
- dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
- dnl to get them.
+ /* The version of regex.c in older versions of gnulib
+ ignored REG_IGNORE_CASE (which was then called RE_ICASE).
+ Detect that problem too. */
+ memset (®ex, 0, sizeof (regex));
+ re_set_syntax (REG_SYNTAX_EMACS | REG_IGNORE_CASE);
+ s = re_compile_pattern ("x", 1, ®ex);
+ if (s)
+ exit (1);