From: Akim Demaille Date: Thu, 12 Apr 2001 09:13:45 +0000 (+0000) Subject: * automake.in (Language): New package, temporarily in this file. X-Git-Tag: handle-languages~63 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=d6f39336be55a66d306a92aed7ff93d7e8558bbe;p=automake.git * automake.in (Language): New package, temporarily in this file. Use Class::Struct. (Automake): New package. (%languages): New. (&handle_single_transform_list): Use the language object's `ansi' attribute instead of `$language_map{"$lang-ansi-p"}'. (®ister_language): Build and register the language too. --- diff --git a/ChangeLog b/ChangeLog index c9aa18f4..404a3abe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-04-12 Akim Demaille + + * automake.in (Language): New package, temporarily in this file. + Use Class::Struct. + (Automake): New package. + (%languages): New. + (&handle_single_transform_list): Use the language object's `ansi' + attribute instead of `$language_map{"$lang-ansi-p"}'. + (®ister_language): Build and register the language too. + 2001-04-11 Tom Tromey Fixes report from Larry Jones: diff --git a/automake.in b/automake.in index ecafd6e7..db63d1c5 100755 --- a/automake.in +++ b/automake.in @@ -27,6 +27,17 @@ eval 'exec @PERL@ -S $0 ${1+"$@"}' # Originally written by David Mackenzie . # Perl reimplementation by Tom Tromey . +package Language; +use Class::Struct; +struct ('ansi' => '$', + 'autodep' => '$', + 'derived_autodep' => '$', + 'linker' => '$', + 'pure' => '$'); + + +package Automake; + require 5.005; use strict 'vars', 'subs'; use File::Basename; @@ -390,6 +401,8 @@ my $configure_dist_common = ''; # This maps languages names onto properties. my %language_map = (); +# This maps languages names onto objects. +my %languages = (); # List of targets we must always output. # FIXME: Complete, and remove falsely required targets. @@ -1439,6 +1452,8 @@ sub handle_single_transform_list ($$$@) $extension = &derive_suffix ($extension); my $lang = $extension_map{$extension}; + # Extract the language object. + my $lang_obj = $languages{$lang}; if ($lang) { &saw_extension ($extension); @@ -1453,7 +1468,10 @@ sub handle_single_transform_list ($$$@) $linker = $language_map{"$lang-linker"}; my $this_obj_ext; - if ($language_map{"$lang-ansi-p"}) + prog_error ("$lang-ansi-p = " . $language_map{"$lang-ansi-p"} + . " != ". $lang_obj->ansi) + if $language_map{"$lang-ansi-p"} != $lang_obj->ansi; + if ($lang_obj->ansi) { $object = $base . $obj; $this_obj_ext = $obj; @@ -5228,6 +5246,15 @@ sub register_language $extension_map{$iter} = $lang; } } + + my $obj = new Language; + $obj->ansi ($language_map{"$lang-ansi-p"}); + $obj->autodep ($language_map{"$lang-autodep"}); + $obj->derived_autodep ($language_map{"$lang-derived-autodep"}); + $obj->linker ($language_map{"$lang-linker"}); + $obj->pure ($language_map{"$lang-pure"}); + + $languages{$lang} = $obj; } # This function is used to find a path from a user-specified suffix to