This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Use AC_DEFUN instead of m4_defun in libtool.m4
- From: "H.J. Lu" <hjl at lucon dot org>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: binutils at sources dot redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Sat, 30 Jun 2007 18:08:37 -0700
- Subject: PATCH: Use AC_DEFUN instead of m4_defun in libtool.m4
- References: <20070630171303.GA9794@lucon.org> <je3b09tktf.fsf@sykes.suse.de> <20070630175042.GA10038@lucon.org> <jezm2hnmoi.fsf@sykes.suse.de>
On Sat, Jun 30, 2007 at 11:43:09PM +0200, Andreas Schwab wrote:
> "H.J. Lu" <hjl@lucon.org> writes:
>
> > On Sat, Jun 30, 2007 at 07:26:52PM +0200, Andreas Schwab wrote:
> >> Please make sure that you have the right version of libtool installed
> >> before running aclocal.
>
> > For reason, aclocal.m4 always has AM_PROG_LIBTOOL from the installed
> > libtool.m4. Does anyone know how to avoid including installed
> > libtool.m4 in aclocal.m4?
>
> Please see the quoted sentence.
>
It turns out that aclocal won't see macros defined in top level
libtool.m4 unless they are defined with AC_DEFUN. _LT_CC_BASENAME,
_LT_COMPILER_BOILERPLATE and _LT_LINKER_BOILERPLATE are defined
with m4_defun. Since they are referenced in top level libtool.m4
and defined in installed libtool.m4, aclocal pulls in installed
libtool.m4 although only thoses in top level libtool.m4 are used
by autoconf.
I don't know much about m4, autoconf nor libtool. This patch works
for me on both gcc and binutils.
H.J.
---
2007-06-30 H.J. Lu <hongjiu.lu@intel.com>
* libtool.m4 (_LT_CC_BASENAME): Use AC_DEFUN instead of
m4_defun.
(_LT_COMPILER_BOILERPLATE): Likewise.
(_LT_LINKER_BOILERPLATE): Likewise.
--- binutils/libtool.m4.libtool 2007-06-01 06:42:08.000000000 -0700
+++ binutils/libtool.m4 2007-06-30 16:56:38.000000000 -0700
@@ -95,7 +95,7 @@ dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
# _LT_CC_BASENAME(CC)
# -------------------
# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
+AC_DEFUN([_LT_CC_BASENAME],
[for cc_temp in $1""; do
case $cc_temp in
compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
@@ -851,7 +851,7 @@ compiler=$CC
# ------------------------
# Check for compiler boilerplate output or warnings with
# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
[m4_require([_LT_DECL_SED])dnl
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
@@ -865,7 +865,7 @@ $RM conftest*
# ----------------------
# Check for linker boilerplate output or warnings with
# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
[m4_require([_LT_DECL_SED])dnl
ac_outfile=conftest.$ac_objext
echo "$lt_simple_link_test_code" >conftest.$ac_ext