[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/10] depend: assume we can always pass '-o' to the C compiler
From: |
Stefano Lattarini |
Subject: |
[PATCH 03/10] depend: assume we can always pass '-o' to the C compiler |
Date: |
Tue, 14 May 2013 10:04:26 +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 <address@hidden>
---
bin/automake.in | 12 +-----------
lib/am/depend2.am | 16 ++++------------
2 files changed, 5 insertions(+), 23 deletions(-)
diff --git a/bin/automake.in b/bin/automake.in
index 63e5962..df6560d 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -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);
}
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.3.rc0.19.g7e6a0cc
- [PATCH 00/10] {master} Enable subdir-objects option unconditionally, Stefano Lattarini, 2013/05/14
- [PATCH 01/10] subdir-objects: enable unconditionally, Stefano Lattarini, 2013/05/14
- [PATCH 10/10] depend: reduce code duplication, de-uglify make verbose output, Stefano Lattarini, 2013/05/14
- [PATCH 08/10] depend: reduce code duplication, Stefano Lattarini, 2013/05/14
- [PATCH 03/10] depend: assume we can always pass '-o' to the C compiler,
Stefano Lattarini <=
- [PATCH 06/10] depend: refactor and remove code duplication, Stefano Lattarini, 2013/05/14
- [PATCH 09/10] depend: prefer $(...) over `...` in Cygwin-specific recipes, Stefano Lattarini, 2013/05/14
- [PATCH 02/10] cleanup: having subdir-objects mandatory allow us some simplifications, Stefano Lattarini, 2013/05/14
- [PATCH 05/10] Automake::Language: drop unused fields 'compile_flag' and 'output_flag', Stefano Lattarini, 2013/05/14
- [PATCH 04/10] depend: assume '-c' compiler flag always means to produce object files, Stefano Lattarini, 2013/05/14
- [PATCH 07/10] depend: a preparatory refactoring, Stefano Lattarini, 2013/05/14
- Re: [PATCH 00/10] {master} Enable subdir-objects option unconditionally, Stefano Lattarini, 2013/05/18