* 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 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,
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 = '-';
# 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:
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);
}
+# debug(@MESSAGE)
+# ---------------
+# Messages displayed only if $DEBUG and $VERBOSE.
+sub debug (@)
+{
+ print STDERR "$me: ", @_, "\n"
+ if $verbose && $debug;
+}
+
+
# $CONFIGURE_AC
# &find_configure_ac ()
# ---------------------
}
-# verbose
-# -------
+# verbose(@MESSAGE)
+# -----------------
sub verbose (@)
{
print STDERR "$me: ", @_, "\n"
# 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
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 ##
## -------- ##
args: --warning syntax
end-language: "Autotest"
+
## ---- ##
## M4sh ##
## ---- ##
args: --warning syntax
end-language: "M4sh"
+
## ------- ##
## M4sugar ##
## ------- ##