** 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.
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
-@command{autoconf} 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
@sp 1
When asked for automatic de-ANSI-fication, Automake needs
-@code{LIBOBJS}'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:
+@code{LIBOBJS}'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
@end example
@noindent
-First, note that this code is @emph{wrong}, because @samp{.o} is not the
-only possible extension@footnote{
+Note that this code is @emph{wrong}, because @samp{.o} is not the only
+possible extension@footnote{
@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
AC_SUBST(LTLIBOBJS)
@end example
-@noindent
-Unfortunately, @command{autoupdate} cannot help here, since@dots{} this is
-not a macro! Of course, first make sure your release of Automake and/or
-Libtool still requires these.
+@sp 1
+
+Fortunately, you no longer have to use this: @code{AC_OUTPUT} normalizes
+@code{LIBOBJS} and @code{LTLIBOBJS} (hence it works with any version of
+Automake and Libtool). So just remove these lines.
+@command{autoupdate} cannot handle this task, since this is not a macro.
+
@c ============================= Generating Test Suites with Autotest
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
LIB@&t@OBJS="$LIB@&t@OBJS $1.$ac_objext"])
+
# AC_LIBOBJ(FILENAME-NOEXT)
# -------------------------
# We need `FILENAME-NOEXT.o', save this into `LIBOBJS'.
])
+# _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@&t@OBJS; 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@&t@OBJS], [$ac_libobjs])
+AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+])
+
## ----------------------------------- ##
## Checking compiler characteristics. ##