automake-patches
[Top][All Lists]
Advanced

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

[PATCH 04/11] depend: assume we can always pass "-o" to the C compiler


From: Stefano Lattarini
Subject: [PATCH 04/11] depend: assume we can always pass "-o" to the C compiler
Date: Sat, 12 Jan 2013 13:51:57 +0100

This is the case after the change in commit XXX of YYYY-MM-DD,
``compile: use 'compile' script when "-c -o" is used with losing compilers''

This is just a simplification; no semantic changes are intended.

* automake.in (handle_languages): Drop transform '%-o%', and definitions
of '$output_flag'.
* lib/am/depend2.am: Adjust to just assume the '?-o?' transform is true,
and the '%-o%' transform expands to "-o".

Signed-off-by: Stefano Lattarini <address@hidden>
---
 automake.in       | 12 +-----------
 lib/am/depend2.am | 16 ++++------------
 2 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/automake.in b/automake.in
index 407dd76..46813b6 100644
--- a/automake.in
+++ b/automake.in
@@ -1386,12 +1386,6 @@ sub handle_languages
        if (((! option 'no-dependencies') && $lang->autodep ne 'no')
            || defined $lang->compile)
        {
-           # Some C compilers don't support -c -o.  Use it only if really
-           # needed.
-           my $output_flag = $lang->output_flag || '';
-           $output_flag = '-o'
-             if (! $output_flag && $lang->name eq 'c');
-
            # Compute a possible derived extension.
            # This is not used by depend2.am.
            my $der_ext = (&{$lang->output_extensions} ($ext))[0];
@@ -1420,7 +1414,7 @@ sub handle_languages
 
                             COMPILE   => '$(' . $lang->compiler . ')',
                             LTCOMPILE => '$(LT' . $lang->compiler . ')',
-                            -o        => $output_flag);
+                           );
        }
 
        # Now include code for each specially handled object with this
@@ -1464,9 +1458,6 @@ sub handle_languages
              "\$(LIBTOOL) $ltverbose $libtool_tag\$($ptltflags) 
\$(LIBTOOLFLAGS) "
              . "--mode=compile $obj_compile";
 
-           # We _need_ '-o' for per object rules.
-           my $output_flag = $lang->output_flag || '-o';
-
            $output_rules .=
              file_contents ($rule_file,
                             new Automake::Location,
@@ -1488,7 +1479,6 @@ sub handle_languages
                             SILENT    => $silent,
                             COMPILE   => $obj_compile,
                             LTCOMPILE => $obj_ltcompile,
-                            -o        => $output_flag,
                             %file_transform);
        }
 
diff --git a/lib/am/depend2.am b/lib/am/depend2.am
index c727bd8..d3a8763 100644
--- a/lib/am/depend2.am
+++ b/lib/am/depend2.am
@@ -36,7 +36,6 @@ if %?NONLIBTOOL%
 ?GENERIC?%EXT%.o:
 ?!GENERIC?%OBJ%: %SOURCE%
 if %FASTDEP%
-## In fast-dep mode, we can always use -o.
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
 ## TODO: rewrite this to avoid extra forks once we can assume a POSIX
 ## TODO: shell.
@@ -50,19 +49,16 @@ if %AMDEP%
        DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif %AMDEP%
 if %?GENERIC%
-?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%%SOURCE%
-?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%%SOURCE%
+       %VERBOSE-NODEP%%COMPILE% %-c% -o %OBJ% %SOURCEFLAG%%SOURCE%
 else !%?GENERIC%
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJ% %SOURCEFLAG%`test -f 
'%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
-?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`test -f '%SOURCE%' || echo 
'$(srcdir)/'`%SOURCE%
+       %VERBOSE-NODEP%%COMPILE% %-c% -o %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' 
|| echo '$(srcdir)/'`%SOURCE%
 endif !%?GENERIC%
 endif !%FASTDEP%
 
 ?GENERIC?%EXT%.obj:
 ?!GENERIC?%OBJOBJ%: %SOURCE%
 if %FASTDEP%
-## In fast-dep mode, we can always use -o.
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
 ## TODO: rewrite this to avoid extra forks once we can assume a POSIX
 ## TODO: shell.
@@ -76,12 +72,10 @@ if %AMDEP%
        DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif %AMDEP%
 if %?GENERIC%
-?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) 
'%SOURCE%'`
-?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% `$(CYGPATH_W) %SOURCEFLAG%'%SOURCE%'`
+       %VERBOSE-NODEP%%COMPILE% %-c% -o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) 
'%SOURCE%'`
 else !%?GENERIC%
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-?-o?   %VERBOSE-NODEP%%COMPILE% %-c% %-o% %OBJOBJ% %SOURCEFLAG%`if test -f 
'%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) 
'$(srcdir)/%SOURCE%'; fi`
-?!-o?  %VERBOSE-NODEP%%COMPILE% %-c% %SOURCEFLAG%`if test -f '%SOURCE%'; then 
$(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) '$(srcdir)/%SOURCE%'; fi`
+       %VERBOSE-NODEP%%COMPILE% %-c% -o %OBJOBJ% %SOURCEFLAG%`if test -f 
'%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; else $(CYGPATH_W) 
'$(srcdir)/%SOURCE%'; fi`
 endif !%?GENERIC%
 endif !%FASTDEP%
 endif %?NONLIBTOOL%
@@ -90,7 +84,6 @@ if %?LIBTOOL%
 ?GENERIC?%EXT%.lo:
 ?!GENERIC?%LTOBJ%: %SOURCE%
 if %FASTDEP%
-## In fast-dep mode, we can always use -o.
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
 ## TODO: rewrite this to avoid extra forks once we can assume a POSIX
 ## TODO: shell.
@@ -103,7 +96,6 @@ if %AMDEP%
        %VERBOSE%source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
        DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
 endif %AMDEP%
-## We can always use '-o' with Libtool.
 ?GENERIC?      %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%%SOURCE%
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
 ?!GENERIC?     %VERBOSE-NODEP%%LTCOMPILE% %-c% -o %LTOBJ% %SOURCEFLAG%`test -f 
'%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
-- 
1.8.1.rc3.192.g2d0029e




reply via email to

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