automake
[Top][All Lists]
Advanced

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

Re: New bugs


From: Akim Demaille
Subject: Re: New bugs
Date: 31 Jan 2001 17:52:31 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Crater Lake)

>>>>> "Tom" == Tom Tromey <address@hidden> writes:

Tom> The reason is only historical.  Feel free to change it.

I'm applying this.  Sure, more clarification is needed in this area.
I find it especially hard to track failures of substitution since
Automake uses @FOO@ just like AC_SUBST :(  Can't we move to something
else, say %FOO%?


2001-01-31  Akim Demaille  <address@hidden>

        * depend2.am: Instead of replacing @PFX@ in $(@address@hidden), and
        then replacing `$(@address@hidden)' for the files that need some
        special flags, use only @address@hidden  Similarly for @address@hidden
        Try to document this file.
        * automake.in (add_depend2): Adjust to these changes.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.843
diff -u -u -r1.843 automake.in
--- automake.in 2001/01/31 14:36:21 1.843
+++ automake.in 2001/01/31 16:44:49
@@ -2956,12 +2956,13 @@
 {
     local ($lang) = @_;
 
+    # Get information on $LANG.
+    my $pfx = $language_map{"$lang-autodep"};
+    my $fpfx = ($pfx eq '') ? 'CC' : $pfx;
+    my $flag = $language_map{"$lang-flags"};
+
     # First include code for ordinary objects.
-    local ($key) = $lang . '-autodep';
     local ($xform, $ext);
-
-    local ($pfx) = $language_map{$key};
-    local ($fpfx) = ($pfx eq '') ? 'CC' : $pfx;
     $xform = &transform ('PFX'  => $pfx,
                         'FPFX' => $fpfx);
     $xform .= $seen_objext  ? 's/^OBJEXT//;'  : 's/^OBJEXT.*$//;';
@@ -2972,12 +2973,16 @@
     # target.  In this case we don't want to include the generic code.
     if ($use_dependencies)
     {
-       local ($xform1) = ($xform
-                          . &transform ('BASE'   => '$*',
-                                        'SOURCE' => '$<',
-                                        'OBJ'    => '$@',
-                                        'LTOBJ'  => '$@',
-                                        'OBJOBJ' => '$@'));
+        my $compile = '$(' . $pfx . 'COMPILE)';
+       my $ltcompile = '$(LT' . $pfx . 'COMPILE)';
+       my $xform1 = ($xform
+                     . &transform ('BASE'      => '$*',
+                                   'SOURCE'    => '$<',
+                                   'OBJ'       => '$@',
+                                   'LTOBJ'     => '$@',
+                                   'OBJOBJ'    => '$@',
+                                   'COMPILE'   => $compile,
+                                   'LTCOMPILE' => $ltcompile));
 
        foreach $ext (&lang_extensions ($lang))
        {
@@ -3007,11 +3012,12 @@
        $source = $list[$i + 1];
        $obj = $list[$i + 2];
        $i += 3;
+
+       my $val = "${derived}_${flag}";
 
-       local ($flag) = $language_map{$lang . '-flags'};
-       local ($val) = "(${derived}_${flag}";
-       ($rule = $language_map{$lang . '-compile'}) =~
-           s/\(AM_$flag/$val/;
+       my $obj_compile = $language_map{"$lang-compile"};
+       $obj_compile =~ s/\(AM_$flag/\($val/;
+       my $obj_ltcompile = '$(LIBTOOL) --mode=compile ' . $obj_compile;
 
        # Generate a transform which will turn suffix targets in
        # depend2.am into real targets for the particular objects we
@@ -3020,16 +3026,14 @@
            &file_contents
                ('depend2',
                 $xform
-                . &transform ('$(' . $pfx . 'COMPILE)'
-                              => $rule,
-                              '$(LT' . $pfx . 'COMPILE)'
-                              => '$(LIBTOOL) --mode=compile ' . $rule,
+                . &transform ('COMPILE'   => $obj_compile,
+                              'LTCOMPILE' => $obj_ltcompile,
                               # Handle source and obj transforms.
-                              'OBJ'    => $obj . '.o',
-                              'OBJOBJ' => $obj . '.obj',
-                              'LTOBJ'  => $obj . '.lo',
-                              'BASE'   => $obj,
-                              'SOURCE' => $source)
+                              'OBJ'       => $obj . '.o',
+                              'OBJOBJ'    => $obj . '.obj',
+                              'LTOBJ'     => $obj . '.lo',
+                              'BASE'      => $obj,
+                              'SOURCE'    => $source)
                 # Generate rule for `.o'.
                 . 's/address@hidden@\.o:/' . $obj . '.o: ' . $source . '/g;'
                 # Maybe generate rule for `.lo'.  Might be eliminated
Index: depend2.am
===================================================================
RCS file: /cvs/automake/automake/depend2.am,v
retrieving revision 1.26
diff -u -u -r1.26 depend2.am
--- depend2.am 2000/10/16 09:01:36 1.26
+++ depend2.am 2001/01/31 16:44:49
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+## Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -16,22 +16,30 @@
 ## along with this program; if not, write to the Free Software
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
+
+## This file is read several times:
+## - once per language for generic compilation rules
+## - once for each file which requires specific flags.
+##
+## It is worth noting that @AMDEP@ and @AMDEPBACKSLASH@ are not
+## transformed by automake, they are AC_SUBST'ed.
+
 @AMDEP@@address@hidden = @@address@hidden@
 
 @address@hidden:
 @AMDEP@        source='@SOURCE@' object='@OBJ@' libtool=no @AMDEPBACKSLASH@
 @AMDEP@        depfile='$(DEPDIR)/@address@hidden' 
tmpdepfile='$(DEPDIR)/@address@hidden' @AMDEPBACKSLASH@
 @AMDEP@        $(@address@hidden) $(depcomp) @AMDEPBACKSLASH@
-       $(@address@hidden) -c -o @OBJ@ `test -f @SOURCE@ || echo 
'$(srcdir)/'address@hidden@
+       @COMPILE@ -c -o @OBJ@ `test -f @SOURCE@ || echo 
'$(srcdir)/'address@hidden@
 
 address@hidden@.lo:
 address@hidden@        source='@SOURCE@' object='@LTOBJ@' libtool=yes 
@AMDEPBACKSLASH@
 address@hidden@        depfile='$(DEPDIR)/@address@hidden' 
tmpdepfile='$(DEPDIR)/@address@hidden' @AMDEPBACKSLASH@
 address@hidden@        $(@address@hidden) $(depcomp) @AMDEPBACKSLASH@
-LIBTOOL        $(address@hidden@COMPILE) -c -o @LTOBJ@ `test -f @SOURCE@ || 
echo '$(srcdir)/'address@hidden@
+LIBTOOL        @LTCOMPILE@ -c -o @LTOBJ@ `test -f @SOURCE@ || echo 
'$(srcdir)/'address@hidden@
 
 address@hidden@.obj:
 address@hidden@        source='@SOURCE@' object='@OBJOBJ@' libtool=no 
@AMDEPBACKSLASH@
 address@hidden@        depfile='$(DEPDIR)/@address@hidden' 
tmpdepfile='$(DEPDIR)/@address@hidden' @AMDEPBACKSLASH@
 address@hidden@        $(@address@hidden) $(depcomp) @AMDEPBACKSLASH@
-OBJEXT $(@address@hidden) -c -o @OBJOBJ@ `cygpath -w @address@hidden
+OBJEXT @COMPILE@ -c -o @OBJOBJ@ `cygpath -w @address@hidden



reply via email to

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