[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: m4_defun_init
From: |
Eric Blake |
Subject: |
Re: m4_defun_init |
Date: |
Fri, 24 Oct 2008 18:16:04 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Eric Blake <ebb9 <at> byu.net> writes:
> In turn, when copying a defun'd macro, the copy
> needs a location, hence m4_copy needs to be smarter.
And this is now causing gnulib-based projects to spit out lots of warnings.
gnulib-tool AC_DEFUN's a replacement AC_LIBOBJ under a different name, then
temporarily pushdef's it atop the original AC_DEFUN. But since the original
was only define'd, it has no location, hence all sorts of warnings:
/usr/local/bin/m4:configure.ac:44: Warning: _m4_defn: undefined macro
`m4_location(AC_LIBSOURCES)'
/usr/local/bin/m4:configure.ac:44: Warning: _m4_defn: undefined macro
`m4_location(AC_LIBOBJ)'
gnulib-tool should be taught to use m4_copy, to have more accurate line numbers
any time its replacement AC_LIBOBJ is traced. But in the meantime, the
autoconf solution is simple - defun these macros to begin with.
From: Eric Blake <address@hidden>
Date: Fri, 24 Oct 2008 12:09:48 -0600
Subject: [PATCH] Work around fact that gnulib-tool doesn't use m4_copy.
* lib/autoconf/general.m4 (AC_LIBOBJ, AC_LIBSOURCES): Defun, not
define, so that an initial location is present, to account for
fact that gnulib-tool pushes another AC_DEFUN'd macro on top.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 5 +++++
lib/autoconf/general.m4 | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 18ac8e0..b26d7ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-10-24 Eric Blake <address@hidden>
+ Work around fact that gnulib-tool doesn't use m4_copy.
+ * lib/autoconf/general.m4 (AC_LIBOBJ, AC_LIBSOURCES): Defun, not
+ define, so that an initial location is present, to account for
+ fact that gnulib-tool pushes another AC_DEFUN'd macro on top.
+
Make m4_defun_init more robust.
* lib/m4sugar/m4sugar.m4 (m4_defun_init): Handle indirect macro
names, and correct number of arguments.
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 4f13b58..299facd 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2788,7 +2788,7 @@ m4_define([AC_LIBSOURCE], [])
# AC_LIBSOURCES([FILE-NAME1, ...])
# -------------------------------
# Announce we might need these files.
-m4_define([AC_LIBSOURCES],
+AC_DEFUN([AC_LIBSOURCES],
[m4_foreach([_AC_FILE_NAME], [$1],
[AC_LIBSOURCE(_AC_FILE_NAME)])])
@@ -2810,7 +2810,7 @@ esac
# AC_LIBOBJ(FILE-NAME-NOEXT)
# -------------------------
# We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'.
-m4_define([AC_LIBOBJ],
+AC_DEFUN([AC_LIBOBJ],
[_AC_LIBOBJ([$1],
[AC_DIAGNOSE(syntax,
[$0($1): you should use literals])])dnl
--
1.6.0.2