bug-gnulib
[Top][All Lists]
Advanced

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

avoid broken random.h


From: Eric Blake
Subject: avoid broken random.h
Date: Thu, 26 Feb 2009 17:24:44 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

I encountered a weird build failure on a Solaris machine:

checking random.h usability... no
checking random.h presence... yes
configure: WARNING: random.h: present but cannot be compiled
configure: WARNING: random.h:     check for missing prerequisite headers?
configure: WARNING: random.h: see the Autoconf documentation
configure: WARNING: random.h:     section "Present But Cannot Be Compiled"
configure: WARNING: random.h: proceeding with the preprocessor's result
configure: WARNING: random.h: in the future, the compiler will take precedence
checking for random.h... yes

and traced it to the fact that /usr/local/include/random.h was an ObjC header 
file installed by Swarm, and not a C system header.

autoconf.git automatically avoids this file, but we might as well avoid it even 
with 2.63 and earlier, and without that verbose warning.  So I'm applying this:


From: Eric Blake <address@hidden>
Date: Thu, 26 Feb 2009 10:00:28 -0700
Subject: [PATCH] stdlib: favor compiler check of random.h

* m4/stdlib_h.m4 (gl_STDLIB_H): Skip preprocessor check.  Needed
to avoid an ObjC random.h installed by Swarm.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog      |    6 ++++++
 m4/stdlib_h.m4 |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3aa297e..a34e3f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-26  Eric Blake  <address@hidden>
+
+       stdlib: favor compiler check of random.h
+       * m4/stdlib_h.m4 (gl_STDLIB_H): Skip preprocessor check.  Needed
+       to avoid an ObjC random.h installed by Swarm.
+
 2009-02-26  Bruno Haible  <address@hidden>

        Work around *printf bug with %g directive and 0.0 on HP-UX 10.20.
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4
index 515befe..b295f16 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -1,4 +1,4 @@
-# stdlib_h.m4 serial 14
+# stdlib_h.m4 serial 15
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,7 +8,7 @@ AC_DEFUN([gl_STDLIB_H],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   gl_CHECK_NEXT_HEADERS([stdlib.h])
-  AC_CHECK_HEADERS([random.h])
+  AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
   if test $ac_cv_header_random_h = yes; then
     HAVE_RANDOM_H=1
   else
-- 
1.6.1.2







reply via email to

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