On Wed, 7 May 2014, Janne Grunau wrote:

On 2014-05-07 14:00:11 +0300, Martin Storsjö wrote:
On Wed, 7 May 2014, Janne Grunau wrote:

---
gas-preprocessor.pl | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index d6d12c3..f4a55a9 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -126,7 +126,17 @@ if ((grep /^-c$/, @gcc_cmd) && !(grep /^-o/, @gcc_cmd)) {
       }
   }
}
-@preprocess_c_cmd = map { /\.(o|obj)$/ ? "-" : $_ } @preprocess_c_cmd;
+# replace only the '-o' argument with '-', avoids rewriting the make dependency
+# target specified with -MT to '-'
+my $index = 1;
+while ($index < $#preprocess_c_cmd) {
+    if ($preprocess_c_cmd[$index] eq "-o") {
+        $index++;
+        $preprocess_c_cmd[$index] = "-";
+    }
+    $index++;
+}
+
my $tempfile;
if ($as_type ne "armasm") {
   @gcc_cmd = map { /\.[csS]$/ ? qw(-x assembler -) : $_ } @gcc_cmd;
--
1.9.2

Looks ok to me

For the record, which kind of dependency generation options are used
for gaspp depends on how it's configured.

The change is not strictly for dependency generation. It just prevents
replacing everything which looks like an object filename with '-'

If enabled implicitly (as
in the ios builds), the dependency generation is set up according to
the normal compiler. If specified manually (with --as="gaspp armasm"
or so), configure tries to detect the dependency generation
mechanism for this (and often ends up with something that doesn't
produce proper dependencies).

Does it need more passthrough options (-v|--version|-dumpversion) to detect
assembler type correctly? That change made it work with gcc and clang.

Right, yes, this seems to help there.

For the armasm case, I end up with a '-.d' generated while I run configure, but other than that it manages to detect a working way to create the deps which work while building. I'll look into what part of it creates the -.d file during configure.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to