bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for regex.m4


From: Paul Eggert
Subject: Re: patch for regex.m4
Date: Mon, 25 Jul 2005 12:35:39 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

"James Gallagher" <address@hidden> writes:

> I added AC_LANG_SOURCE to fix the error and figured I might as well
> make the switch to RUN_IFELSE at the same time since the docs say
> TRY_RUN is obsolete.

That makes sense, yes.  I installed the patch below (plus some
unimportant indenting changes) into gnulib and coreutils.  I took the
opportunity to fix another bug: 'exit' wasn't declared.

> I removed m4_syscmd, ..., because they were not working on either Mac
> OS/X or RHEL3.

Hmm, why not?  Shouldn't they be working?  What versions of m4 and Autoconf
were you using?  Let's try to see what the underlying problem is first,
before removing this from regex.m4.


2005-07-25  Paul Eggert  <address@hidden>

        * regex.m4 (gl_INCLUDED_REGEX): Use AC_RUN_ELSE instead of the
        obsolescent AC_TRY_RUN.  Include the default includes files, for 'exit'.

--- regex.m4    7 Jul 2005 08:08:39 -0000       1.39
+++ regex.m4    25 Jul 2005 19:28:26 -0000      1.40
@@ -1,4 +1,4 @@
-#serial 23
+#serial 24
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free
 # Software Foundation, Inc.
@@ -36,15 +36,11 @@ AC_DEFUN([gl_INCLUDED_REGEX],
     # test #75' in grep-2.3.
     AC_CACHE_CHECK([for working re_compile_pattern],
                   [gl_cv_func_working_re_compile_pattern],
-      [AC_TRY_RUN(
-        [[
-#include <stdio.h>
-#include <string.h>
-#include <regex.h>
-         int
-         main ()
-         {
-           static struct re_pattern_buffer regex;
+      [AC_RUN_IFELSE(
+        [AC_LANG_PROGRAM(
+           [AC_INCLUDES_DEFAULT
+            #include <regex.h>],
+           [[static struct re_pattern_buffer regex;
            const char *s;
            struct re_registers regs;
            re_set_syntax (RE_SYNTAX_POSIX_EGREP);
@@ -98,9 +94,7 @@ AC_DEFUN([gl_INCLUDED_REGEX],
            if (! REG_STARTEND)
              exit (1);
 
-           exit (0);
-         }
-        ]],
+             exit (0);]])],
         [gl_cv_func_working_re_compile_pattern=yes],
         [gl_cv_func_working_re_compile_pattern=no],
         dnl When crosscompiling, assume it is broken.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]