]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/Autom4te/General.pm (&debug): New.
authorAkim Demaille <akim@epita.fr>
Sun, 23 Sep 2001 17:16:01 +0000 (17:16 +0000)
committerAkim Demaille <akim@epita.fr>
Sun, 23 Sep 2001 17:16:01 +0000 (17:16 +0000)
* 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.

ChangeLog
bin/autom4te.in
lib/Autom4te/General.pm
lib/autom4te.in

index e9d92cbfbaf0b6cf91f33695224c94df63f0af88..7fa68f059e05ce3dc573ca7e75cbb37de0be1871 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
index c2125c14558ac4e04da24641b1a348b6da5ff28f..30b14a5d09beb0b3422de1722c46babd736dad0b 100644 (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");
-
-  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:
index b34554595513654924765b88c99c5e1823542847..9109492ea7100d181eba26962cf7cc3115940b8a 100644 (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"
index b8277021da6a57737522f2f8441ab31dbcee305b..31b0b24a4a080afbc64bf83eb11b9dec03b6734f 100644 (file)
 # 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 ##
 ## ------- ##