* 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.
This commit is contained in:
Akim Demaille 2001-09-23 17:16:01 +00:00
parent 00353f7c20
commit d3bcaf7a86
4 changed files with 84 additions and 34 deletions

View File

@ -1,3 +1,13 @@
2001-09-23 Akim Demaille <akim@epita.fr>
* 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 <tim.van.holder@pandora.be>
* m4/auxdir.m4, m4/cond.m4, m4/depend.m4, m4/init.m4,

View File

@ -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");
# 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{$language};
unshift @ARGV, @{$language{$language}};
}
if ($language)
{
die "$me: unknown language: $language\n"
unless exists $language{lc $language};
unshift @ARGV, @{$language{lc $language}};
}
} while $language;
verbose "arguments: @ARGV\n"
if $debug;
debug "arguments: @ARGV\n";
# Process the arguments for real this time.
my @trace;
Getopt::Long::Configure ("defaults");
getopt
(
# Operation modes:

View File

@ -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"

View File

@ -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 ##
## ------- ##