m4-commit
[Top][All Lists]
Advanced

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

Changes to m4/configure.ac,v [branch-1_4]


From: Eric Blake
Subject: Changes to m4/configure.ac,v [branch-1_4]
Date: Fri, 07 Jul 2006 02:40:47 +0000

CVSROOT:        /sources/m4
Module name:    m4
Branch:         branch-1_4
Changes by:     Eric Blake <ericb>      06/07/07 02:40:46

Index: configure.ac
===================================================================
RCS file: /sources/m4/m4/configure.ac,v
retrieving revision 1.36.2.20
retrieving revision 1.36.2.21
diff -u -b -r1.36.2.20 -r1.36.2.21
--- configure.ac        30 Jun 2006 18:58:11 -0000      1.36.2.20
+++ configure.ac        7 Jul 2006 02:40:46 -0000       1.36.2.21
@@ -91,6 +91,38 @@
   ]])
 fi
 
+AC_CACHE_CHECK([if system() agrees with pclose()],
+  [M4_cv_func_system_consistent],
+  [AC_RUN_IFELSE([AC_LANG_PROGRAM([
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+], [int i1, i2;
+  FILE *f;
+  i1 = system ("exit 2");
+  if (i1 == -1)
+    return 1;
+  f = popen ("exit 2", "r");
+  if (!f)
+    return 1;
+  i2 = pclose (f);
+  return i1 != i2;])],
+  [M4_cv_func_system_consistent=yes], [M4_cv_func_system_consistent=no],
+  [AC_COMPILE_IFELSE([
+/* EMX on OS/2 defines WEXITSTATUS to be (x>>8)&0xff, and uses that for
+   pclose(), but for system() it uses x&0xff instead.  Otherwise, we assume
+   your system is sane and that pclose() and system() are consistent in their
+   values.  If this heuristic is wrong for your platform, report it as a bug
+   to address@hidden  */
+#ifdef __EMX__
+choke me
+#endif
+], [M4_cv_func_system_consistent=yes], [M4_cv_func_system_consistent=no])])])
+if test "$M4_cv_func_system_consistent" = no ; then
+  AC_DEFINE([FUNC_SYSTEM_BROKEN], [1],
+    [Define to 1 if the return value of system() disagrees with pclose().])
+fi
+
 dnl Don't let changeword get in our way, if bootstrapping with a version of
 dnl m4 that already turned the feature on.
 m4_ifdef([changeword], [m4_undefine([changeword])])dnl




reply via email to

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