/[autoconf]/autoconf/doc/autoconf.texi
ViewVC logotype

Diff of /autoconf/doc/autoconf.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.590 by akim, Mon Mar 4 15:06:44 2002 UTC revision 1.591 by akim, Mon Mar 4 15:09:21 2002 UTC
# Line 412  Upgrading From Version 2.13 Line 412  Upgrading From Version 2.13
412  * Changed Quotation::           Broken code which used to work  * Changed Quotation::           Broken code which used to work
413  * New Macros::                  Interaction with foreign macros  * New Macros::                  Interaction with foreign macros
414  * Hosts and Cross-Compilation::  Bugward compatibility kludges  * Hosts and Cross-Compilation::  Bugward compatibility kludges
415    * AC_LIBOBJ vs. LIBOBJS::
416    
417  Generating Test Suites with Autotest  Generating Test Suites with Autotest
418    
# Line 11493  features in version 2.50; the changes ar Line 11494  features in version 2.50; the changes ar
11494  * Changed Quotation::           Broken code which used to work  * Changed Quotation::           Broken code which used to work
11495  * New Macros::                  Interaction with foreign macros  * New Macros::                  Interaction with foreign macros
11496  * Hosts and Cross-Compilation::  Bugward compatibility kludges  * Hosts and Cross-Compilation::  Bugward compatibility kludges
11497    * AC_LIBOBJ vs. LIBOBJS::       LIBOBJS is a forbidden token
11498  @end menu  @end menu
11499    
11500  @node Changed Quotation  @node Changed Quotation
# Line 11735  configure as follows: Line 11737  configure as follows:
11737  @end example  @end example
11738    
11739    
11740    @node AC_LIBOBJ vs. LIBOBJS
11741    @subsection @code{AC_LIBOBJ} vs. @code{LIBOBJS}
11742    
11743    Up to Autoconf 2.13, the replacement of functions was triggered via the
11744    variable @code{LIBOBJS}.  Since Autoconf 2.50, the macro
11745    @code{AC_LIBOBJ} should be used instead (@pxref{Generic Functions}).
11746    Starting at Autoconf 2.53, the use of @code{LIBOBJS} is an error.
11747    
11748    This change is mandated by the unification of the GNU Build System
11749    components.  In particular, the various fragile techniques used to parse
11750    a @file{configure.ac} are all replaced with the use of traces.  As a
11751    consequence, any action must be traceable, which obsoletes critical
11752    variable assignments.  Fortunately, @code{LIBOBJS} was the only problem.
11753    
11754    At the time this documentation is written, Automake does not rely on
11755    traces yet, but this is planed for a near future.  Nevertheless, to
11756    ease the transition, and to guarantee this future Automake release will
11757    be able to use Autoconf 2.53, using @code{LIBOBJS} directly will make
11758    @command{autoconf} fail.  But note that the output, @command{configure},
11759    is correct and fully functional: you have some delay to adjust your
11760    source.
11761    
11762    There are two typical uses of @code{LIBOBJS}: asking for a replacement
11763    function, and adjusting @code{LIBOBJS} for Automake and/or Libtool.
11764    
11765    @sp 1
11766    
11767    As for function replacement, the fix is immediate: use
11768    @code{AC_LIBOBJ}.  For instance:
11769    
11770    @example
11771    LIBOBJS="$LIBOBJS fnmatch.o"
11772    LIBOBJS="$LIBOBJS malloc.$ac_objext"
11773    @end example
11774    
11775    @noindent
11776    should be replaced with:
11777    
11778    @example
11779    AC_LIBOBJ([fnmatch])
11780    AC_LIBOBJ([malloc])
11781    @end example
11782    
11783    @sp 1
11784    
11785    When asked for automatic de-ANSI-fication, Automake needs
11786    @code{LIBOBJS}'ed filenames to have @samp{$U} appended to the
11787    base names.   Libtool requires the definition of @code{LTLIBOBJS}, which
11788    suffixes are mapped to @samp{.lo}.  Although Autoconf provides them with
11789    means to free the user to do that by herself, by the time of this
11790    writing, none do.  Therefore, it is common to see @file{configure.ac}
11791    end with:
11792    
11793    @example
11794    # This is necessary so that .o files in LIBOBJS are also built via
11795    # the ANSI2KNR-filtering rules.
11796    LIBOBJS=`echo "$LIBOBJS" | sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
11797    LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/\.lo/g'`
11798    AC_SUBST(LTLIBOBJS)
11799    @end example
11800    
11801    @noindent
11802    First, note that this code is @emph{wrong}, because @samp{.o} is not the
11803    only possible extension@footnote{
11804    @c
11805    Yet another reason why assigning @code{LIBOBJS} directly is discouraged.
11806    @c
11807    }!  Because the token @code{LIBOBJS} is now
11808    forbidden, you will have to replace this snippet with:
11809    
11810    @example
11811    # This is necessary so that .o files in LIBOBJS are also built via
11812    # the ANSI2KNR-filtering rules.
11813    LIB@@&t@@OBJS=`echo "$LIB@@&t@@OBJS" |
11814                 sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
11815    LTLIBOBJS=`echo "$LIB@@&t@@OBJS" |
11816               sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
11817    AC_SUBST(LTLIBOBJS)
11818    @end example
11819    
11820    @noindent
11821    Unfortunately, @command{autoupdate} cannot help here, since... this is
11822    not a macro!  Of course, first make sure your release of Automake and/or
11823    Libtool still requires these.
11824    
11825  @c ============================= Generating Test Suites with Autotest  @c ============================= Generating Test Suites with Autotest
11826    
11827  @node Using Autotest  @node Using Autotest

Legend:
Removed from v.1.590  
changed lines
  Added in v.1.591

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26