X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fregex.m4;h=944dfaf905ec978f101de97a58a101f794515fbd;hb=a0b25daf001cb1a0352f329e2b5e1640acc88541;hp=2f5bd0973bfb6ba7f870cd6e6db809e094c805a3;hpb=9fdffffad88a06f406d74ea9b23643a05a4069ef;p=gnulib.git diff --git a/m4/regex.m4 b/m4/regex.m4 index 2f5bd0973..944dfaf90 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -1,4 +1,4 @@ -# serial 62 +# serial 63 # Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc. # @@ -27,6 +27,7 @@ AC_DEFUN([gl_REGEX], # 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. + AC_CHECK_FUNCS_ONCE([alarm]) AC_CACHE_CHECK([for working re_compile_pattern], [gl_cv_func_re_compile_pattern_working], [AC_RUN_IFELSE( @@ -35,6 +36,10 @@ AC_DEFUN([gl_REGEX], #include #include #include + #if HAVE_ALARM + # include + # include + #endif ]], [[int result = 0; static struct re_pattern_buffer regex; @@ -43,6 +48,11 @@ AC_DEFUN([gl_REGEX], const char *s; struct re_registers regs; +#if HAVE_ALARM + /* Some builds of glibc go into an infinite loop on this test. */ + signal (SIGALRM, SIG_DFL); + alarm (2); +#endif if (setlocale (LC_ALL, "en_US.UTF-8")) { {