dnl CF_REGEXPR_H_FUNCS version: 7 updated: 2021/01/10 18:23:00
dnl ------------------
dnl Tests for the <regexpr.h> include-file, and the functions associated with it.
AC_DEFUN([CF_REGEXPR_H_FUNCS],
[
cf_save_libs="$LIBS"
AC_CHECK_LIB(gen, compile)
AC_CACHE_CHECK(compile/step functions, cf_cv_REGEXPR_H,[
	AC_TRY_RUN([
#include <sys/types.h>
#include <regexpr.h>
	int main() {
		char *e;
		char *p = "foo";
		char *s = "foobar";
		if ((e = (char *)compile(p, (char *)0, (char *)0)) == 0
		 || step(s, e) == 0)
			${cf_cv_main_return:-return}(1);
		free(e);
		${cf_cv_main_return:-return}(0);
	} ],
	[cf_cv_REGEXPR_H=yes],
	[cf_cv_REGEXPR_H=no],
	[cf_cv_REGEXPR_H=unknown])
])
if test "$cf_cv_REGEXPR_H" = yes; then
	AC_DEFINE(HAVE_REGEXPR_H_FUNCS,1,[Define to 1 if we have regexpr functions])
else
	LIBS="$cf_save_libs"
fi
])dnl
