Re: 81-lang-extensions.patch

2001-04-10 Thread Tom Tromey

 "Akim" == Akim Demaille [EMAIL PROTECTED] writes:

Akim   * automake.in: (Language): Add attribute `extensions'.
Akim   (Automake): Pass a hash to `register_language' instead of a
Akim   list of pseudo assignments.
Akim   (register_language): Adjust.
Akim   (finish_languages): Initialize `$ltoutarg'.

Ok.

Tom




81-lang-extensions.patch

2001-03-23 Thread Akim Demaille

Index: ChangeLog
from  Akim Demaille  [EMAIL PROTECTED]

* automake.in: (Language): Add attribute `extensions'.
(Automake): Pass a hash to `register_language' instead of a
list of pseudo assignments.
(register_language): Adjust.
(finish_languages): Initialize `$ltoutarg'.

Index: automake.in
--- automake.in Wed, 21 Mar 2001 02:46:05 +0100 akim (am/f/39_automake.i 1.204 755)
+++ 0.224(w)/automake.in Fri, 23 Mar 2001 01:26:58 +0100 akim (am/f/39_automake.i 
+1.205 755)
@@ -34,6 +34,7 @@
 'compile'  = '$',
 'compiler'  = '$',
'derived_autodep' = '$',
+'extensions'  = '@',
 'flags' = '$',
 'linker' = '$',
 'output_arg' = '$',
@@ -731,71 +732,95 @@
 

 # Initialize our list of languages that are internally supported.
-register_language ('c', 'ansi-p=1', 'autodep=', 'flags=CFLAGS',
-   'compile=$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) 
$(AM_CFLAGS) $(CFLAGS)',
-   'compiler-name=COMPILE',
-   'output-arg=-c',
-   'c');
-register_language ('cxx', 'linker=CXXLINK', 'autodep=CXX', 'flags=CXXFLAGS',
-   'compile=$(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) 
$(AM_CXXFLAGS) $(CXXFLAGS)',
-   'compiler-name=CXXCOMPILE',
-   'output-arg=-c -o $@',
-   'pure=yes',
-   'c++', 'cc', 'cpp', 'cxx', 'C');
-register_language ('objc', 'linker=OBJCLINK', 'autodep=OBJC',
-   'flags=OBJCFLAGS',
-   'compile=$(OBJC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) 
$(AM_OBJCFLAGS) $(OBJCFLAGS)',
-   'compiler-name=OBJCCOMPILE',
-   'output-arg=-c -o $@',
-   'pure=yes',
-'m');
-register_language ('header',
-   'h', 'H', 'hxx', 'h++', 'hh', 'hpp', 'inc');
-
+register_language ('c',
+  ('ansi' = '1',
+   'autodep' = '',
+   'flags' = 'CFLAGS',
+   'compile' = '$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) 
+$(AM_CFLAGS) $(CFLAGS)',
+   'compiler' = 'COMPILE',
+   'output-arg' = '-c',
+   'extensions' = ['c']));
+register_language ('cxx',
+  ('linker' = 'CXXLINK',
+   'autodep' = 'CXX',
+   'flags' = 'CXXFLAGS',
+   'compile' = '$(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) 
+$(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
+   'compiler' = 'CXXCOMPILE',
+   'output-arg' = '-c -o $@',
+   'pure' = 'yes',
+   'extensions' = ['c++', 'cc', 'cpp', 'cxx', 'C']));
+register_language ('objc',
+  ('linker' = 'OBJCLINK',
+   'autodep' = 'OBJC',
+   'flags' = 'OBJCFLAGS',
+   'compile' = '$(OBJC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) 
+$(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
+   'compiler' = 'OBJCCOMPILE',
+   'output-arg' = '-c -o $@',
+   'pure' = 'yes',
+   'extensions' = ['m']));
+register_language ('header',
+  ('extensions' = ['h', 'H', 'hxx', 'h++', 'hh', 'hpp', 'inc']));
 # For now, yacc and lex can't be handled on a per-exe basis.
-register_language ('yacc', 'ansi-p=1', 'derived-autodep=yes',
-   'y');
-register_language ('yaccxx', 'linker=CXXLINK', 'derived-autodep=yes',
-   'y++', 'yy', 'yxx', 'ypp');
-register_language ('lex', 'ansi-p=1', 'derived-autodep=yes',
-   'l');
-register_language ('lexxx', 'linker=CXXLINK', 'derived-autodep=yes',
-   'l++', 'll', 'lxx', 'lpp');
-
-register_language ('asm',
-   'flags=CFLAGS', # FIXME: asmflags?
-   'compile=$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) 
$(AM_CFLAGS) $(CFLAGS)', # FIXME: a different compiler?
-   'compiler-name=COMPILE',
-   'output-arg=-c',
-   's', 'S');
-
-register_language ('f77', 'linker=F77LINK', 'flags=FFLAGS',
-   'compile=$(F77) $(AM_FFLAGS) $(FFLAGS)',
-   'compiler-name=F77COMPILE',
-   'output-arg=-c -o $@',
-   'pure=yes',
-   'f', 'for', 'f90');
-register_language ('ppf77', 'linker=F77LINK', 'flags=FFLAGS',
-   'compile=$(F77) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) 
$(AM_FFLAGS) $(FFLAGS)',
-   'compiler-name=PPF77COMPILE',
-   'output-arg=-c -o $@',
-   'pure=yes',
-   'F');
-register_language ('ratfor', 'linker=F77LINK',
-   'flags=RFLAGS', # FIXME also FFLAGS.
-   'compile=$(F77) $(AM_FFLAGS) $(FFLAGS) 

Re: 81-lang-extensions.patch

2001-03-23 Thread Raja R Harinath

Hi,

Akim Demaille [EMAIL PROTECTED] writes:
 +while (my ($attr, $value) = each %option)
  {
[snip]
 +  if ($attr eq 'ansi')
   {
 +   $lang_obj-ansi ($value);
   }
 +  elsif ($attr eq 'autodep')
   {
 +   $lang_obj-autodep ($value);
   }
 +  elsif ($attr eq 'compile')
 + {
 +   $lang_obj-compile ($value);
 + }
[snip]

Wouldn't this be more compact and readable without the loop?

  $lang_obj-ansi($options{'ansi'})if exists $options{'ansi'};
  $lang_obj-autodep ($options{'autodep'}) if exists $options{'autodep'};
  $lang_obj-compile ($options{'compile'}) if exists $options{'compile'};
  # ...

  delete $options{$_} for (('ansi', 'autodep', 'compile', ...));
  complain(...) if (keys %options);

- Hari
-- 
Raja R Harinath -- [EMAIL PROTECTED]
"When all else fails, read the instructions."  -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash




Re: 81-lang-extensions.patch

2001-03-23 Thread Akim Demaille


| Hi,
| Akim Demaille [EMAIL PROTECTED] writes:
|  +while (my ($attr, $value) = each %option)
|   {
| [snip]
|  +  if ($attr eq 'ansi')
|{
|  + $lang_obj-ansi ($value);
|  }
|  +  elsif ($attr eq 'autodep')
|  {
|  + $lang_obj-autodep ($value);
|  }
|  +  elsif ($attr eq 'compile')
|  +   {
|  + $lang_obj-compile ($value);
|  +   }
| [snip]
| 
| Wouldn't this be more compact and readable without the loop?
| 
|   $lang_obj-ansi($options{'ansi'})if exists $options{'ansi'};
|   $lang_obj-autodep ($options{'autodep'}) if exists $options{'autodep'};
|   $lang_obj-compile ($options{'compile'}) if exists $options{'compile'};
|   # ...
| 
|   delete $options{$_} for (('ansi', 'autodep', 'compile', ...));
|   complain(...) if (keys %options);

Oh yes, definitely! Thanks!

But in fact, this code is made to be killed soon: recent versions of
Class::Struct finally (aah!) provide a `new' which accepts a hash to
initialize the object.  We won't need this code, and probably we would
need register_language either, just calls to `new'.




Re: 81-lang-extensions.patch

2001-03-23 Thread Raja R Harinath

Hi,

Akim Demaille [EMAIL PROTECTED] writes:
 Raja R Harinath [EMAIL PROTECTED] writes:
[snip] 
 | Wouldn't this be more compact and readable without the loop?
 | 
 |   $lang_obj-ansi($options{'ansi'})if exists $options{'ansi'};
 |   $lang_obj-autodep ($options{'autodep'}) if exists $options{'autodep'};
 |   $lang_obj-compile ($options{'compile'}) if exists $options{'compile'};
 |   # ...
 | 
 |   delete $options{$_} for (('ansi', 'autodep', 'compile', ...));
 |   complain(...) if (keys %options);
 
 Oh yes, definitely! Thanks!
 
 But in fact, this code is made to be killed soon: recent versions of
 Class::Struct finally (aah!) provide a `new' which accepts a hash to
 initialize the object.  We won't need this code, and probably we would
 need register_language either, just calls to `new'.

But, I thought the decision was to support Perl 5.005_03.  The version
of Class::Struct with that doesn't seem to support initialization by
passing a hash to 'new'.

- Hari
-- 
Raja R Harinath -- [EMAIL PROTECTED]
"When all else fails, read the instructions."  -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash