From: Akim Demaille Date: Sun, 23 Sep 2001 17:16:01 +0000 (+0000) Subject: * lib/Autom4te/General.pm (&debug): New. X-Git-Tag: AUTOCONF-2.52f~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3bcaf7a86b61c216f774d32f7a62efe0911fc84;p=thirdparty%2Fautoconf.git * lib/Autom4te/General.pm (&debug): New. * bin/autom4te.in ($language): Move to... (parse_args): here. Handle --language in languages. * lib/autom4te.in (Automake-selections, Autoheader-selections) (Autoscan-selections): New. (Autoconf): Adjust. --- diff --git a/ChangeLog b/ChangeLog index e9d92cbfb..7fa68f059 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-09-23 Akim Demaille + + * lib/Autom4te/General.pm (&debug): New. + * bin/autom4te.in ($language): Move to... + (parse_args): here. + Handle --language in languages. + * lib/autom4te.in (Automake-selections, Autoheader-selections) + (Autoscan-selections): New. + (Autoconf): Adjust. + 2001-09-23 Tim Van Holder * m4/auxdir.m4, m4/cond.m4, m4/depend.m4, m4/init.m4, diff --git a/bin/autom4te.in b/bin/autom4te.in index c2125c145..30b14a5d0 100644 --- a/bin/autom4te.in +++ b/bin/autom4te.in @@ -234,9 +234,8 @@ use strict; my $datadir = $ENV{'AC_MACRODIR'} || '@datadir@'; my $autom4te_cfg = $ENV{'AUTOM4TE_CFG'} || "$datadir/autom4te.cfg"; -# $LANGUAGE{$LANGUAGE} is the list of automatic options for $LANGUAGE. +# $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE. my %language; -my $language; my $output = '-'; @@ -460,25 +459,29 @@ sub load_configuration () # Process any command line arguments. sub parse_args () { - my @trace; - # We want to look for the early options, which should not be found # in the configuration file. Prepend to the user arguments. - Getopt::Long::Configure ("pass_through"); - getopt ("l|language=s" => \$language); - Getopt::Long::Configure ("defaults"); - - if ($language) - { - die "$me: unknown language: $language\n" - unless exists $language{$language}; - unshift @ARGV, @{$language{$language}}; - } - - verbose "arguments: @ARGV\n" - if $debug; + # Perform this repeatedly so that we can use --language in language + # definitions. + my $language; + do { + $language = undef; + Getopt::Long::Configure ("pass_through"); + getopt ("l|language=s" => \$language); + + if ($language) + { + die "$me: unknown language: $language\n" + unless exists $language{lc $language}; + unshift @ARGV, @{$language{lc $language}}; + } + } while $language; + + debug "arguments: @ARGV\n"; # Process the arguments for real this time. + my @trace; + Getopt::Long::Configure ("defaults"); getopt ( # Operation modes: diff --git a/lib/Autom4te/General.pm b/lib/Autom4te/General.pm index b34554595..9109492ea 100644 --- a/lib/Autom4te/General.pm +++ b/lib/Autom4te/General.pm @@ -29,7 +29,7 @@ use strict; use vars qw (@ISA @EXPORT); @ISA = qw (Exporter); -@EXPORT = qw (&find_configure_ac &find_file &getopt &mktmpdir &mtime +@EXPORT = qw (&debug &find_configure_ac &find_file &getopt &mktmpdir &mtime &uniq &update_file &verbose &xsystem $debug $help $me $tmp $verbose $version); @@ -89,6 +89,16 @@ sub END } +# debug(@MESSAGE) +# --------------- +# Messages displayed only if $DEBUG and $VERBOSE. +sub debug (@) +{ + print STDERR "$me: ", @_, "\n" + if $verbose && $debug; +} + + # $CONFIGURE_AC # &find_configure_ac () # --------------------- @@ -296,8 +306,8 @@ sub update_file ($$) } -# verbose -# ------- +# verbose(@MESSAGE) +# ----------------- sub verbose (@) { print STDERR "$me: ", @_, "\n" diff --git a/lib/autom4te.in b/lib/autom4te.in index b8277021d..31b0b24a4 100644 --- a/lib/autom4te.in +++ b/lib/autom4te.in @@ -19,31 +19,35 @@ # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. -## ---------- ## -## Autoconf. ## -## ---------- ## +## -------------------------- ## +## Autoheader preselections. ## +## -------------------------- ## -begin-language: "Autoconf" -# patterns: "*.ac" -# patterns: "configure.in" -args: --include @datadir@ -args: autoconf/autoconf.m4f -args: acsite.m4? -args: aclocal.m4? -args: --mode 777 -args: --warning syntax -args: --normalize -# Wanted by autoheader +begin-language: "Autoheader-preselections" args: --preselect AC_CONFIG_HEADERS args: --preselect AH_OUTPUT args: --preselect AC_DEFINE_TRACE_LITERAL -# Wanted by Automake +end-language: "Autoheader-preselections" + + +## ------------------------ ## +## Automake-preselections. ## +## ------------------------ ## + +begin-language: "Automake-preselections" args: --preselect AC_LIBSOURCE args: --preselect AC_SUBST args: --preselect AM_CONDITIONAL args: --preselect AC_LIBSOURCE args: --preselect AC_CONFIG_FILES -# Wanted by autoscan +end-language: "Automake-preselections" + + +## ------------------------ ## +## Autoscan-preselections. ## +## ------------------------ ## + +begin-language: "Autoscan-preselections" args: --preselect AC_CHECK_FUNCS args: --preselect AC_CHECK_HEADERS args: --preselect AC_CHECK_LIB @@ -103,8 +107,29 @@ args: --preselect AC_TYPE_PID_T args: --preselect AC_TYPE_SIGNAL args: --preselect AC_TYPE_SIZE_T args: --preselect AC_TYPE_UID_T +end-language: "Autoscan-preselections" + + +## ---------- ## +## Autoconf. ## +## ---------- ## + +begin-language: "Autoconf" +# patterns: "*.ac" +# patterns: "configure.in" +args: --include @datadir@ +args: autoconf/autoconf.m4f +args: acsite.m4? +args: aclocal.m4? +args: --mode 777 +args: --warning syntax +args: --normalize +args: --language Autoheader-preselections +args: --language Autoscan-preselections +args: --language Automake-preselections end-language: "Autoconf" + ## -------- ## ## Autotest ## ## -------- ## @@ -118,6 +143,7 @@ args: --mode 777 args: --warning syntax end-language: "Autotest" + ## ---- ## ## M4sh ## ## ---- ## @@ -130,6 +156,7 @@ args: --mode 777 args: --warning syntax end-language: "M4sh" + ## ------- ## ## M4sugar ## ## ------- ##