]> sourceware.org Git - automake.git/commitdiff
* automake.in (KNOWN_EXTENSIONS_PATTERN, known_extensions_list):
authorAlexandre Duret-Lutz <adl@gnu.org>
Fri, 16 Nov 2001 10:27:51 +0000 (10:27 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Fri, 16 Nov 2001 10:27:51 +0000 (10:27 +0000)
New variables.
(handle_single_transform_list, lang_yacc_target_hook): Use
KNOWN_EXTENSIONS_PATTERN.
(accept_extension): New function.
(register_language): Call it.

ChangeLog
automake.in

index 82570b7331c839a6918a20969c7430c83ca723d1..72746aa540904070cf8bebc9ecf20c6dfe07f5f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-11-16  Alexandre Duret-Lutz  <duret_g@epita.fr>
+
+       * automake.in (KNOWN_EXTENSIONS_PATTERN, known_extensions_list): 
+       New variables.
+       (handle_single_transform_list, lang_yacc_target_hook): Use 
+       KNOWN_EXTENSIONS_PATTERN.
+       (accept_extension): New function.
+       (register_language): Call it.
+
 2001-11-16  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
        At every place where an "$extension" is used, include the leading
index 9c94bb7b834dba578ebadd6c00d7a056b764cc4e..85a7416e89e849eea7a7acc423fbdb37942ab613 100755 (executable)
@@ -1062,6 +1062,26 @@ sub backname ($)
 
 ################################################################
 
+# Pattern that matches all know input extensions (i.e. extensions used
+# by the languages supported by Automake).  Using this pattern
+# (instead of `\..*$') to match extensions allows Automake to support
+# dot-less extensions.
+my $KNOWN_EXTENSIONS_PATTERN = "";
+my @known_extensions_list = ();
+
+# accept_extensions (@EXTS)
+# -------------------------
+# Update $KNOWN_EXTENSIONS_PATTERN to recognize the extensions
+# listed @EXTS.  Extensions should contain a dot if needed.
+sub accept_extensions (@)
+{
+    push @known_extensions_list, @_;
+    $KNOWN_EXTENSIONS_PATTERN =
+       '(?:' . join ('|', map (quotemeta, @known_extensions_list)) . ')';
+}
+
+################################################################
+
 # Parse command line.
 sub parse_arguments ()
 {
@@ -1724,7 +1744,7 @@ sub handle_single_transform_list ($$$$@)
         # is in effect.
 
         # Split file name into base and extension.
-        next if ! /^(?:(.*)\/)?([^\/]*)(\..*?)$/;
+        next if ! /^(?:(.*)\/)?([^\/]*)($KNOWN_EXTENSIONS_PATTERN)$/;
         my $full = $_;
         my $directory = $1 || '';
         my $base = $2;
@@ -5128,7 +5148,7 @@ sub lang_yacc_target_hook
        || (variable_defined ('YFLAGS')
            && &variable_value ('YFLAGS') =~ /$DASH_D_PATTERN/o))
     {
-       (my $output_base = $output) =~ s/\..*$//;
+       (my $output_base = $output) =~ s/$KNOWN_EXTENSIONS_PATTERN$//;
        my $header = $output_base . '.h';
 
        # Found a `-d' that applies to the compilation of this file.
@@ -5311,6 +5331,9 @@ sub register_language (%)
     # Fill indexes.
     grep ($extension_map{$_} = $lang->name, @{$lang->extensions});
     $languages{$lang->name} = $lang;
+
+    # Update the pattern of known extensions.
+    accept_extensions (@{$lang->extensions});
 }
 
 # derive_suffix ($EXT, $OBJ)
@@ -6314,7 +6337,7 @@ sub variable_value_as_list
 # @VALUE
 # &variable_value_as_list_recursive_worker ($VAR, $COND, $PARENT)
 # ---------------------------------------------------------------
-# Return contents of variable as list, split as whitespace.  This will
+# Return contents of VAR as a list, split on whitespace.  This will
 # recursively follow $(...) and ${...} inclusions.  It preserves @...@
 # substitutions.  If COND is 'all', then all values under all
 # conditions should be returned; if COND is a particular condition
This page took 0.047034 seconds and 5 git commands to generate.