autoconf-patches
[Top][All Lists]
Advanced

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

FYI: LIBOBJS mess for 2.54


From: Akim Demaille
Subject: FYI: LIBOBJS mess for 2.54
Date: 18 Jul 2002 13:55:19 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

Index: ChangeLog
from  Akim Demaille  <address@hidden>,

        Handle LIBOBJS and LTLIBOBJS once for all, including Libtool's and
        Automake's parts.

        * lib/autoconf/general.m4 (_AC_LIBOBJS_NORMALIZE): New.
        * lib/autoconf/status.m4 (AC_OUTPUT_COMMANDS_PRE): Call it.
        * tests/semantics.at (AC_REPLACE_FUNCS): Adjust.

2002-07-18  Akim Demaille  <address@hidden>,
Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.249
diff -u -u -r1.249 NEWS
--- NEWS 17 Jul 2002 08:29:26 -0000 1.249
+++ NEWS 18 Jul 2002 11:51:38 -0000
@@ -18,7 +18,18 @@
 
 ** Macros
 
+- AC_OUTPUT
+  Now handles all the gory details about LIBOBJS and LTLIBOBJS.
+  Please, remove lines such as
+
+       # This is necessary so that .o files in LIBOBJS are also
+       # built via the ANSI2KNR-filtering rules.
+       LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
+
+  and read the `AC_LIBOBJ vs LIBOBJS' section.
+
 - AC_CONFIG_LINKS now makes copies if it can't make links.
+
 - AC_FUNC_FNMATCH now tests only for POSIX compatibility, reverting to
   Autoconf 2.13 behavior.  The new macro AC_FUNC_FNMATCH_GNU also
   tests for GNU extensions to fnmatch, and replaces fnmatch if needed.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.642
diff -u -u -r1.642 autoconf.texi
--- doc/autoconf.texi 17 Jul 2002 18:39:20 -0000 1.642
+++ doc/autoconf.texi 18 Jul 2002 11:52:42 -0000
@@ -12815,17 +12815,11 @@
 components.  In particular, the various fragile techniques used to parse
 a @file{configure.ac} are all replaced with the use of traces.  As a
 consequence, any action must be traceable, which obsoletes critical
-variable assignments.  Fortunately, @code{LIBOBJS} was the only problem.
+variable assignments.  Fortunately, @code{LIBOBJS} was the only problem,
+and it can even be handled gracefully (read, ``without your having to
+change something'').
 
-At the time this documentation is written, Automake does not rely on
-traces yet, but this is planned for a near future.  Nevertheless, to
-ease the transition, and to guarantee this future Automake release will
-be able to use Autoconf 2.53, using @code{LIBOBJS} directly will make
address@hidden fail.  But note that the output, @command{configure},
-is correct and fully functional: you have some delay to adjust your
-source.
-
-There are two typical uses of @code{LIBOBJS}: asking for a replacement
+There were two typical uses of @code{LIBOBJS}: asking for a replacement
 function, and adjusting @code{LIBOBJS} for Automake and/or Libtool.
 
 @sp 1
@@ -12849,12 +12843,9 @@
 @sp 1
 
 When asked for automatic de-ANSI-fication, Automake needs
address@hidden'ed filenames to have @samp{$U} appended to the
-base names.   Libtool requires the definition of @code{LTLIBOBJS}, which
-suffixes are mapped to @samp{.lo}.  Although Autoconf provides them with
-means to free the user to do that by herself, by the time of this
-writing, none do.  Therefore, it is common to see @file{configure.ac}
-end with:
address@hidden'ed filenames to have @samp{$U} appended to the base
+names.  Libtool requires the definition of @code{LTLIBOBJS}, which
+suffixes are mapped to @samp{.lo}.  People used to run snippets such as:
 
 @example
 # This is necessary so that .o files in LIBOBJS are also built via
@@ -12865,13 +12856,12 @@
 @end example
 
 @noindent
-First, note that this code is @emph{wrong}, because @samp{.o} is not the
-only possible address@hidden
+Note that this code is @emph{wrong}, because @samp{.o} is not the only
+possible address@hidden
 @c
 Yet another reason why assigning @code{LIBOBJS} directly is discouraged.
 @c
-}!  Because the token @code{LIBOBJS} is now
-forbidden, you will have to replace this snippet with:
+}!  It should have read:
 
 @example
 # This is necessary so that .o files in LIBOBJS are also built via
@@ -12883,10 +12873,13 @@
 AC_SUBST(LTLIBOBJS)
 @end example
 
address@hidden
-Unfortunately, @command{autoupdate} cannot help here, address@hidden this is
-not a macro!  Of course, first make sure your release of Automake and/or
-Libtool still requires these.
address@hidden 1
+
+Fortunately, you no longer have to use this: @code{AC_OUTPUT} normalizes
address@hidden and @code{LTLIBOBJS} (hence it works with any version of
+Automake and Libtool).  So just remove these lines.
address@hidden cannot handle this task, since this is not a macro.
+
 
 @c ============================= Generating Test Suites with Autotest
 
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.800
diff -u -u -r1.800 general.m4
--- lib/autoconf/general.m4 17 Jul 2002 08:17:29 -0000 1.800
+++ lib/autoconf/general.m4 18 Jul 2002 11:52:47 -0000
@@ -1272,7 +1272,7 @@
 m4_pattern_forbid([^_?A[CHUM]_])
 m4_pattern_forbid([_AC_])
 m4_pattern_forbid([^LIBOBJS$],
-                  [do not use LIBOBJS directly, use AC_LIBOBJ (see section 
`AC_LIBOBJ vs. LIBOBJS'])
+                  [do not use LIBOBJS directly, use AC_LIBOBJ (see section 
`AC_LIBOBJ vs LIBOBJS'])
 # Actually reserved by M4sh.
 m4_pattern_allow([^AS_FLAGS$])
 AS_INIT
@@ -2393,6 +2393,7 @@
 LIB@&address@hidden"$LIB@&address@hidden $1.$ac_objext"])
 
 
+
 # AC_LIBOBJ(FILENAME-NOEXT)
 # -------------------------
 # We need `FILENAME-NOEXT.o', save this into `LIBOBJS'.
@@ -2403,6 +2404,26 @@
                          [$0($1): you should use literals])])dnl
 ])
 
+
+# _AC_LIBOBJS_NORMALIZE
+# ---------------------
+# Clean up LIBOBJS abd LTLIBOBJS so that they work with 1. ac_objext,
+# 2. Automake's ANSI2KNR, 3. Libtool, 4. combination of the three.
+# Used with AC_CONFIG_COMMANDS_PRE.
+AC_DEFUN([_AC_LIBOBJS_NORMALIZE],
+[ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIB@&address@hidden; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+AC_SUBST([LIB@&address@hidden, [$ac_libobjs])
+AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+])
 
 
 ## ----------------------------------- ##
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.28
diff -u -u -r1.28 status.m4
--- lib/autoconf/status.m4 18 Jul 2002 11:13:55 -0000 1.28
+++ lib/autoconf/status.m4 18 Jul 2002 11:52:54 -0000
@@ -329,8 +329,12 @@
 
 # AC_OUTPUT_COMMANDS_PRE
 # ----------------------
+# A *variable* in which we append all the actions that must be
+# performed before *creating* config.status.  For a start, clean
+# up all the LIBOBJ mess.
 m4_define([AC_OUTPUT_COMMANDS_PRE],
-[])
+[_AC_LIBOBJS_NORMALIZE()
+])
 
 
 # AC_CONFIG_COMMANDS_POST(CMDS)
Index: tests/semantics.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/semantics.at,v
retrieving revision 1.39
diff -u -u -r1.39 semantics.at
--- tests/semantics.at 27 Jun 2002 07:50:42 -0000 1.39
+++ tests/semantics.at 18 Jul 2002 11:52:54 -0000
@@ -123,7 +123,7 @@
 ])
 
 AT_CHECK([sed 's/  */ /g;s/^ //;s/ $//' config.libobjs], [],
-         [autoconf_ftnirp.o
+         [autoconf_ftnirp$U.o
 ])
 
 AT_CLEANUP([config.libobjs])



reply via email to

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