From: Akim Demaille Date: Sat, 20 Oct 2001 11:14:50 +0000 (+0000) Subject: * automake.in (&scan_one_autoconf_file): `%generalize' is new, and X-Git-Tag: Release-1-5b~111 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=6abd76c586ed7b85ffd024fe7962dad000dc486f;p=automake.git * automake.in (&scan_one_autoconf_file): `%generalize' is new, and factors dedicated $libsources assignments. --- diff --git a/ChangeLog b/ChangeLog index bbfaf058..fd30b7e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-10-20 Akim Demaille + + * automake.in (&scan_one_autoconf_file): `%generalize' is new, and + factors dedicated $libsources assignments. + + 2001-10-20 Akim Demaille * m4/error.m4, m4/obstack.m4, m4/ptrdiff.m4, m4/strtod.m4: diff --git a/automake.in b/automake.in index f8d5c027..65ab0329 100755 --- a/automake.in +++ b/automake.in @@ -110,7 +110,6 @@ sub target_hook ($$$$) package Automake; -require 5.005; use strict 'vars', 'subs'; use Automake::General; use Automake::XFile; @@ -4502,6 +4501,26 @@ sub scan_one_autoconf_file { my ($filename) = @_; + # Some macros already provide the right traces to enable generic + # code and specific arguments, instead of dedicated code. But + # currently we don't handle traces. Rewrite these dedicated + # macros handling into the generic macro invocation, and let our + # generic case handle them. + + my %generalize = + ( + 'AC_FUNC_ALLOCA' => 'AC_LIBSOURCES([alloca.c])', + 'AC_FUNC_GETLOADAVG' => 'AC_LIBSOURCES([getloadavg.c])', + 'AC_FUNC_MEMCMP' => 'AC_LIBSOURCES([memcmp.c])', + 'AC_STRUCT_ST_BLOCKS' => 'AC_LIBSOURCES([fileblocks.c])', + 'A[CM]_REPLACE_GNU_GETOPT' => 'AC_LIBSOURCES([getopt.c, getopt1.c])', + 'A[CM]_FUNC_STRTOD' => 'AC_LIBSOURCES([strtod.c])', + 'AM_WITH_REGEX' => 'AC_LIBSOURCES([rx.c, rx.h, regex.c, regex.h])', + 'AC_FUNC_MKTIME' => 'AC_LIBSOURCES([mktime.c])', + 'A[CM]_FUNC_ERROR_AT_LINE' => 'AC_LIBSOURCES([error.c, error.h])', + 'A[CM]_FUNC_OBSTACK' => 'AC_LIBSOURCES([obstack.c, obstack.h])', + ); + my $configfh = new Automake::XFile ("< $filename"); print "$me: reading $filename\n" if $verbose; @@ -4529,54 +4548,13 @@ sub scan_one_autoconf_file $_ = $underscore; } + for my $generalize (keys %generalize) + { + s/$generalize/$generalize{$generalize}/g; + } + # Populate libobjs array. - if (/AC_FUNC_ALLOCA/) - { - $libsources{'alloca.c'} = 1; - } - elsif (/AC_FUNC_GETLOADAVG/) - { - $libsources{'getloadavg.c'} = 1; - } - elsif (/AC_FUNC_MEMCMP/) - { - $libsources{'memcmp.c'} = 1; - } - elsif (/AC_STRUCT_ST_BLOCKS/) - { - $libsources{'fileblocks.c'} = 1; - } - elsif (/A[CM]_REPLACE_GNU_GETOPT/) - { - $libsources{'getopt.c'} = 1; - $libsources{'getopt1.c'} = 1; - } - elsif (/A[CM]_FUNC_STRTOD/) - { - $libsources{'strtod.c'} = 1; - } - elsif (/AM_WITH_REGEX/) - { - $libsources{'rx.c'} = 1; - $libsources{'rx.h'} = 1; - $libsources{'regex.c'} = 1; - $libsources{'regex.h'} = 1; - } - elsif (/AC_FUNC_MKTIME/) - { - $libsources{'mktime.c'} = 1; - } - elsif (/A[CM]_FUNC_ERROR_AT_LINE/) - { - $libsources{'error.c'} = 1; - $libsources{'error.h'} = 1; - } - elsif (/A[CM]_FUNC_OBSTACK/) - { - $libsources{'obstack.c'} = 1; - $libsources{'obstack.h'} = 1; - } - elsif (/LIBOBJS="(.*)\s+\$LIBOBJS"/ + if (/LIBOBJS="(.*)\s+\$LIBOBJS"/ || /LIBOBJS="\$LIBOBJS\s+(.*)"/) { foreach my $libobj_iter (split (' ', $1))