]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
depend: assume we can always pass '-o' to the C compiler
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 10 Jan 2013 18:38:58 +0000 (19:38 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 15 May 2013 13:53:29 +0000 (15:53 +0200)
This is the case after the change in commit v1.13.1-56-g34001a9 of
2013-01-09 (compile: use 'compile' script when "-c -o" is used with
losing compilers).

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

* bin/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 <stefano.lattarini@gmail.com>
bin/automake.in
lib/am/depend2.am

index 63e5962f4b13adb854693f0ed57c5d6a8c2d9ee9..df6560d3ae8798a17ff8ed3b2ea79b7873e02f61 100644 (file)
@@ -1296,12 +1296,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];
@@ -1330,7 +1324,7 @@ sub handle_languages ()
 
                             COMPILE   => '$(' . $lang->compiler . ')',
                             LTCOMPILE => '$(LT' . $lang->compiler . ')',
-                            -o        => $output_flag);
+                           );
        }
 
        # Now include code for each specially handled object with this
@@ -1374,9 +1368,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,
@@ -1398,7 +1389,6 @@ sub handle_languages ()
                             SILENT    => $silent,
                             COMPILE   => $obj_compile,
                             LTCOMPILE => $obj_ltcompile,
-                            -o        => $output_flag,
                             %file_transform);
        }
 
index c727bd8b2bfd2778903337447b898b0aa642630b..d3a8763fa0e33bed9beacf9c63a6e962bfde9031 100644 (file)
@@ -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%