bug-autoconf
[Top][All Lists]
Advanced

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

Re: AC_REPLACE_FUNCS generates faulty checks


From: Paul Eggert
Subject: Re: AC_REPLACE_FUNCS generates faulty checks
Date: Thu, 30 Jun 2011 09:17:27 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10

Thanks for reporting that.  The weird code was probably copied
from the previous macro _AC_REPLACE_FUNC, where I'm afraid something
like that really is needed.  I installed the following patch
and it should appear in the next Autoconf version.

>From 8711b0c2be7aba36db785e3542597d55a69a522c Mon Sep 17 00:00:00 2001
From: Timo Kamph <address@hidden>
Date: Thu, 30 Jun 2011 09:12:55 -0700
Subject: [PATCH 1/2] * lib/autoconf/functions.m4 (_AC_REPLACE_FUNCS): Fix
 tr-cpp problem.

See http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00058.html
---
 ChangeLog                 |    5 +++++
 lib/autoconf/functions.m4 |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 466b8a8..b9f50c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-30  Timo Kamph  <address@hidden>  (trivial change)
+
+       * lib/autoconf/functions.m4 (_AC_REPLACE_FUNCS): Fix tr-cpp problem.
+       See http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00058.html
+
 2011-06-19  Paul Eggert  <address@hidden>
 
        * lib/autoconf/functions.m4 (_AC_LIBOBJ_ALLOCA): Be even smarter.
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index cbc3413..f506e76 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -137,7 +137,7 @@ m4_define([_AC_REPLACE_FUNCS],
 [m4_map_args_w([$1], [_AC_REPLACE_FUNC(], [)
 ])],
 [AC_CHECK_FUNCS([$1],
-  [_AH_CHECK_FUNC([$ac_func])AC_DEFINE(AS_TR_CPP([HAVE_$ac_func]))],
+  [_AH_CHECK_FUNC([$ac_func])],
   [_AC_LIBOBJ([$ac_func])])])])
 
 
-- 
1.7.4.4


>From f3d85057f39c7b9908a8710297ebcccaa17cae83 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Thu, 30 Jun 2011 09:13:41 -0700
Subject: [PATCH 2/2] * tests/semantics.at (AC_REPLACE_FUNCS): Test for
 just-fixed bug.

---
 ChangeLog          |    4 ++++
 tests/semantics.at |    4 +++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b9f50c3..0bad5a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-06-30  Paul Eggert  <address@hidden>
+
+       * tests/semantics.at (AC_REPLACE_FUNCS): Test for just-fixed bug.
+
 2011-06-30  Timo Kamph  <address@hidden>  (trivial change)
 
        * lib/autoconf/functions.m4 (_AC_REPLACE_FUNCS): Fix tr-cpp problem.
diff --git a/tests/semantics.at b/tests/semantics.at
index 68fe861..5bcab52 100644
--- a/tests/semantics.at
+++ b/tests/semantics.at
@@ -179,7 +179,8 @@ AT_CONFIGURE_AC(
 [AC_CONFIG_FILES([config.libobjs:config.in])
 AC_REPLACE_FUNCS([printf \
 autoconf_ftnirp])
-funcs='fprintf autoconf_ftnirpf'
+funcs='fprintf fopen autoconf_ftnirpf'
+AH_TEMPLATE([HAVE_FOPEN], [])
 AH_TEMPLATE([HAVE_FPRINTF], [])
 AH_TEMPLATE([HAVE_AUTOCONF_FTNIRPF], [])
 AC_REPLACE_FUNCS([\
@@ -193,6 +194,7 @@ AT_CHECK_ENV
 AT_CHECK_DEFINES(
 [/* #undef HAVE_AUTOCONF_FTNIRP */
 /* #undef HAVE_AUTOCONF_FTNIRPF */
+#define HAVE_FOPEN 1
 #define HAVE_FPRINTF 1
 #define HAVE_PRINTF 1
 ])
-- 
1.7.4.4





reply via email to

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