automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

renaming vars to indicate target


From: Warren Turkal
Subject: renaming vars to indicate target
Date: Sun, 11 Jan 2004 10:04:52 -0600
User-agent: KNode/0.7.2

I know that I am not a regular contributor or anything, but could some of
you look at the following patch and see if the variable renames are
reasonable. I am trying to add support for host compiled utility binaries
that are used during a build. The following patch attempts to rename all
the current arch dependent language attributes to something that more
appropriately indicates that the work on the target architecture. I plan to
add corresponding host variables for the host arch also. I know that this
will need support in autoconf also, but I think this is the right place to
start.

This patch is against automake 1.8. It makes identical Makefiles to automake
1.8. It just renames some variables in preparation for the introduction of
host variables.

Thanks, wt

--- automake.in.old     2003-12-08 11:53:57.000000000 -0600
+++ automake.in 2004-01-11 00:05:46.000000000 -0600
@@ -61,10 +61,10 @@
 
        'autodep' => "\$",
 
-       # Name of the compiling variable (COMPILE).
-        'compiler'  => "\$",
-        # Content of the compiling variable.
-        'compile'  => "\$",
+       # Name of the target compiling variable (COMPILE).
+        'target_compiler'  => "\$",
+        # Content of the target compiling variable.
+        'target_compile'  => "\$",
         # Flag to require compilation without linking (-c).
         'compile_flag' => "\$",
         'extensions' => '@',
@@ -80,15 +80,15 @@
        # The default is 'depend2'.
        'rule_file' => "\$",
 
-        # Name of the linking variable (LINK).
-        'linker' => "\$",
-        # Content of the linking variable.
-        'link' => "\$",
-
-        # Name of the linker variable (LD).
-        'lder' => "\$",
-        # Content of the linker variable ($(CC)).
-        'ld' => "\$",
+        # Name of the target linking variable (LINK).
+        'target_linker' => "\$",
+        # Content of the target linking variable.
+        'target_link' => "\$",
+
+        # Name of the target linker variable (LD).
+        'target_lder' => "\$",
+        # Content of the target linker variable ($(CC)).
+        'target_ld' => "\$",
 
         # Flag to specify the output file (-o).
         'output_flag' => "\$",
@@ -655,12 +655,12 @@
                   'ansi' => 1,
                   'autodep' => '',
                   'flags' => ['CFLAGS', 'CPPFLAGS'],
-                  'compiler' => 'COMPILE',
-                  'compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
-                  'lder' => 'CCLD',
-                  'ld' => '$(CC)',
-                  'linker' => 'LINK',
-                  'link' => '$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o
$@',
+                  'target_compiler' => 'COMPILE',
+                  'target_compile' => '$(CC) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
+                  'target_lder' => 'CCLD',
+                  'target_ld' => '$(CC)',
+                  'target_linker' => 'LINK',
+                  'target_link' => '$(CCLD) $(AM_CFLAGS) $(CFLAGS) 
$(AM_LDFLAGS)
$(LDFLAGS) -o $@',
                   'compile_flag' => '-c',
                   'extensions' => ['.c'],
                   '_finish' => \&lang_c_finish);
@@ -669,16 +669,16 @@
 register_language ('name' => 'cxx',
                   'Name' => 'C++',
                   'config_vars' => ['CXX'],
-                  'linker' => 'CXXLINK',
-                  'link' => '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS)
$(LDFLAGS) -o $@',
+                  'target_linker' => 'CXXLINK',
+                  'target_link' => '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) 
$(AM_LDFLAGS)
$(LDFLAGS) -o $@',
                   'autodep' => 'CXX',
                   'flags' => ['CXXFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
-                  'compiler' => 'CXXCOMPILE',
+                  'target_compile' => '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
+                  'target_compiler' => 'CXXCOMPILE',
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
-                  'lder' => 'CXXLD',
-                  'ld' => '$(CXX)',
+                  'target_lder' => 'CXXLD',
+                  'target_ld' => '$(CXX)',
                   'pure' => 1,
                   'extensions' => ['.c++', '.cc', '.cpp', '.cxx', '.C']);
 
@@ -686,16 +686,16 @@
 register_language ('name' => 'objc',
                   'Name' => 'Objective C',
                   'config_vars' => ['OBJC'],
-                  'linker' => 'OBJCLINK',,
-                  'link' => '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) 
$(AM_LDFLAGS)
$(LDFLAGS) -o $@',
+                  'target_linker' => 'OBJCLINK',,
+                  'target_link' => '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS)
$(AM_LDFLAGS) $(LDFLAGS) -o $@',
                   'autodep' => 'OBJC',
                   'flags' => ['OBJCFLAGS', 'CPPFLAGS'],
-                  'compile' => '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
-                  'compiler' => 'OBJCCOMPILE',
-                  'compile_flag' => '-c',
+                  'target_compile' => '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
+                  'target_compiler' => 'OBJCCOMPILE',
+                  'target_compile_flag' => '-c',
                   'output_flag' => '-o',
-                  'lder' => 'OBJCLD',
-                  'ld' => '$(OBJC)',
+                  'target_lder' => 'OBJCLD',
+                  'target_ld' => '$(OBJC)',
                   'pure' => 1,
                   'extensions' => ['.m']);
 
@@ -714,8 +714,8 @@
                   'Name' => 'Yacc',
                   'config_vars' => ['YACC'],
                   'flags' => ['YFLAGS'],
-                  'compile' => '$(YACC) $(YFLAGS) $(AM_YFLAGS)',
-                  'compiler' => 'YACCCOMPILE',
+                  'target_compile' => '$(YACC) $(YFLAGS) $(AM_YFLAGS)',
+                  'target_compiler' => 'YACCCOMPILE',
                   'extensions' => ['.y'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/y/c/;
                                                return ($ext,) },
@@ -727,8 +727,8 @@
                   'config_vars' => ['YACC'],
                   'rule_file' => 'yacc',
                   'flags' => ['YFLAGS'],
-                  'compiler' => 'YACCCOMPILE',
-                  'compile' => '$(YACC) $(YFLAGS) $(AM_YFLAGS)',
+                  'target_compiler' => 'YACCCOMPILE',
+                  'target_compile' => '$(YACC) $(YFLAGS) $(AM_YFLAGS)',
                   'extensions' => ['.y++', '.yy', '.yxx', '.ypp'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/y/c/;
                                                return ($ext,) },
@@ -741,8 +741,8 @@
                   'config_vars' => ['LEX'],
                   'rule_file' => 'lex',
                   'flags' => ['LFLAGS'],
-                  'compile' => '$(LEX) $(LFLAGS) $(AM_LFLAGS)',
-                  'compiler' => 'LEXCOMPILE',
+                  'target_compile' => '$(LEX) $(LFLAGS) $(AM_LFLAGS)',
+                  'target_compiler' => 'LEXCOMPILE',
                   'extensions' => ['.l'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/l/c/;
                                                return ($ext,) },
@@ -753,8 +753,8 @@
                   'config_vars' => ['LEX'],
                   'rule_file' => 'lex',
                   'flags' => ['LFLAGS'],
-                  'compile' => '$(LEX) $(LFLAGS) $(AM_LFLAGS)',
-                  'compiler' => 'LEXCOMPILE',
+                  'target_compile' => '$(LEX) $(LFLAGS) $(AM_LFLAGS)',
+                  'target_compiler' => 'LEXCOMPILE',
                   'extensions' => ['.l++', '.ll', '.lxx', '.lpp'],
                   'output_extensions' => sub { (my $ext = $_[0]) =~ tr/l/c/;
                                                return ($ext,) },
@@ -769,8 +769,8 @@
                   'flags' => ['CCASFLAGS'],
                   # Users can set AM_ASFLAGS to includes DEFS, INCLUDES,
                   # or anything else required.  They can also set AS.
-                  'compile' => '$(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)',
-                  'compiler' => 'CCASCOMPILE',
+                  'target_compile' => '$(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)',
+                  'target_compiler' => 'CCASCOMPILE',
                   'compile_flag' => '-c',
                   'extensions' => ['.s', '.S'],
 
@@ -780,15 +780,15 @@
 # Fortran 77
 register_language ('name' => 'f77',
                   'Name' => 'Fortran 77',
-                  'linker' => 'F77LINK',
-                  'link' => '$(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o
$@',
+                  'target_linker' => 'F77LINK',
+                  'target_link' => '$(F77LD) $(AM_FFLAGS) $(FFLAGS) 
$(AM_LDFLAGS)
$(LDFLAGS) -o $@',
                   'flags' => ['FFLAGS'],
-                  'compile' => '$(F77) $(AM_FFLAGS) $(FFLAGS)',
-                  'compiler' => 'F77COMPILE',
+                  'target_compile' => '$(F77) $(AM_FFLAGS) $(FFLAGS)',
+                  'target_compiler' => 'F77COMPILE',
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
-                  'lder' => 'F77LD',
-                  'ld' => '$(F77)',
+                  'target_lder' => 'F77LD',
+                  'target_ld' => '$(F77)',
                   'pure' => 1,
                   'extensions' => ['.f', '.for', '.f90']);
 
@@ -810,13 +810,13 @@
 register_language ('name' => 'ppf77',
                   'Name' => 'Preprocessed Fortran 77',
                   'config_vars' => ['F77'],
-                  'linker' => 'F77LINK',
-                  'link' => '$(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o
$@',
-                  'lder' => 'F77LD',
-                  'ld' => '$(F77)',
+                  'target_linker' => 'F77LINK',
+                  'target_link' => '$(F77LD) $(AM_FFLAGS) $(FFLAGS) 
$(AM_LDFLAGS)
$(LDFLAGS) -o $@',
+                  'target_lder' => 'F77LD',
+                  'target_ld' => '$(F77)',
                   'flags' => ['FFLAGS', 'CPPFLAGS'],
-                  'compiler' => 'PPF77COMPILE',
-                  'compile' => '$(F77) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)',
+                  'target_compiler' => 'PPF77COMPILE',
+                  'target_compile' => '$(F77) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FFLAGS) $(FFLAGS)',
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'pure' => 1,
@@ -826,14 +826,14 @@
 register_language ('name' => 'ratfor',
                   'Name' => 'Ratfor',
                   'config_vars' => ['F77'],
-                  'linker' => 'F77LINK',
-                  'link' => '$(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o
$@',
-                  'lder' => 'F77LD',
-                  'ld' => '$(F77)',
+                  'target_linker' => 'F77LINK',
+                  'target_link' => '$(F77LD) $(AM_FFLAGS) $(FFLAGS) 
$(AM_LDFLAGS)
$(LDFLAGS) -o $@',
+                  'target_lder' => 'F77LD',
+                  'target_ld' => '$(F77)',
                   'flags' => ['RFLAGS', 'FFLAGS'],
                   # FIXME also FFLAGS.
-                  'compile' => '$(F77) $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) 
$(RFLAGS)',
-                  'compiler' => 'RCOMPILE',
+                  'target_compile' => '$(F77) $(AM_FFLAGS) $(FFLAGS) 
$(AM_RFLAGS)
$(RFLAGS)',
+                  'target_compiler' => 'RCOMPILE',
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'pure' => 1,
@@ -843,16 +843,16 @@
 register_language ('name' => 'java',
                   'Name' => 'Java',
                   'config_vars' => ['GCJ'],
-                  'linker' => 'GCJLINK',
-                  'link' => '$(GCJLD) $(AM_GCJFLAGS) $(GCJFLAGS) $(AM_LDFLAGS)
$(LDFLAGS) -o $@',
+                  'target_linker' => 'GCJLINK',
+                  'target_link' => '$(GCJLD) $(AM_GCJFLAGS) $(GCJFLAGS) 
$(AM_LDFLAGS)
$(LDFLAGS) -o $@',
                   'autodep' => 'GCJ',
                   'flags' => ['GCJFLAGS'],
-                  'compile' => '$(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)',
-                  'compiler' => 'GCJCOMPILE',
+                  'target_compile' => '$(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)',
+                  'target_compiler' => 'GCJCOMPILE',
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
-                  'lder' => 'GCJLD',
-                  'ld' => '$(GCJ)',
+                  'target_lder' => 'GCJLD',
+                  'target_ld' => '$(GCJ)',
                   'pure' => 1,
                   'extensions' => ['.java', '.class', '.zip', '.jar']);
 
@@ -1072,7 +1072,7 @@
 
        # Generate the appropriate rules for this extension.
        if (((! option 'no-dependencies') && $lang->autodep ne 'no')
-           || defined $lang->compile)
+           || defined $lang->target_compile)
        {
            # Some C compilers don't support -c -o.  Use it only if really
            # needed.
@@ -1105,8 +1105,8 @@
                             OBJOBJ    => '$@',
                             LTOBJ     => '$@',
 
-                            COMPILE   => '$(' . $lang->compiler . ')',
-                            LTCOMPILE => '$(LT' . $lang->compiler . ')',
+                            COMPILE   => '$(' . $lang->target_compiler . ')',
+                            LTCOMPILE => '$(LT' . $lang->target_compiler . ')',
                             -o        => $output_flag);
        }
 
@@ -1123,12 +1123,12 @@
            $seen_files{$obj} = 1;
 
            prog_error ("found " . $lang->name .
-                       " in handle_languages, but compiler not defined")
-             unless defined $lang->compile;
+                       " in handle_languages, but target_compiler not defined")
+             unless defined $lang->target_compile;
 
-           my $obj_compile = $lang->compile;
+           my $obj_compile = $lang->target_compile;
 
-           # Rewrite each occurrence of `AM_$flag' in the compile
+           # Rewrite each occurrence of `AM_$flag' in the target_compile
            # rule into `${derived}_$flag' if it exists.
            for my $flag (@{$lang->flags})
              {
@@ -1284,10 +1284,10 @@
        $needs_c ||= ! $lang->pure;
 
        define_compiler_variable ($lang)
-         if ($lang->compile);
+         if ($lang->target_compile);
 
        define_linker_variable ($lang)
-         if ($lang->link);
+         if ($lang->target_link);
 
        require_variables ("$am_file.am", $lang->Name . " source seen",
                           TRUE, @{$lang->config_vars});
@@ -1299,7 +1299,7 @@
        # they should not be overridden in the Makefile...
        my @dont_override = @{$lang->flags};
        # ... and so is LDFLAGS.
-       push @dont_override, 'LDFLAGS' if $lang->link;
+       push @dont_override, 'LDFLAGS' if $lang->target_link;
 
        foreach my $flag (@dont_override)
          {
@@ -1458,7 +1458,7 @@
             next if $r == LANG_IGNORE;
 
             # Now extract linker and other info.
-            $linker = $lang->linker;
+            $linker = $lang->target_linker;
 
             my $this_obj_ext;
            if (defined $source_extension)
@@ -1492,7 +1492,7 @@
                 # We have a per-executable flag in effect for this
                 # object.  In this case we rewrite the object's
                 # name to ensure it is unique.  We also require
-                # the `compile' program to deal with compilers
+                # the `target_compile' program to deal with compilers
                 # where `-c -o' does not work.
 
                 # We choose the name `DERIVED_OBJECT' to ensure
@@ -1518,7 +1518,7 @@
                     if $lang->name eq 'c';
 
                prog_error ($lang->name . " flags defined without compiler")
-                 if ! defined $lang->compile;
+                 if ! defined $lang->target_compile;
 
                 $renamed = 1;
             }
@@ -5377,7 +5377,7 @@
 {
     my ($lang) = @_;
 
-    my ($var, $value) = ($lang->compiler, $lang->compile);
+    my ($var, $value) = ($lang->target_compiler, $lang->target_compile);
     &define_variable ($var, $value, INTERNAL);
     &define_variable ("LT$var", "\$(LIBTOOL) --mode=compile $value",
INTERNAL)
       if var ('LIBTOOL');
@@ -5391,13 +5391,13 @@
 {
     my ($lang) = @_;
 
-    my ($var, $value) = ($lang->lder, $lang->ld);
+    my ($var, $value) = ($lang->target_lder, $lang->target_ld);
     # CCLD = $(CC).
-    &define_variable ($lang->lder, $lang->ld, INTERNAL);
+    &define_variable ($lang->target_lder, $lang->target_ld, INTERNAL);
     # CCLINK = $(CCLD) blah blah...
-    &define_variable ($lang->linker,
+    &define_variable ($lang->target_linker,
                      ((var ('LIBTOOL') ? '$(LIBTOOL) --mode=link ' : '')
-                      . $lang->link),
+                      . $lang->target_link),
                      INTERNAL);
 }
 

-- 
Warren Turkal
President, GOLUM, Inc.
http://www.golum.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]