From 0644b42d963b425540a3f67f069169ef37f6a51e Mon Sep 17 00:00:00 2001 From: Junichi Kajiwara Date: Mon, 13 Jul 2015 13:37:23 +0900 Subject: [PATCH 1/3] Fix clang support when we use autotools clang is compatible to C89,but without this patch,configure are mis understood compatiblity of C89. --- bin/qrintf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/qrintf b/bin/qrintf index 4b91eff..ff804cc 100755 --- a/bin/qrintf +++ b/bin/qrintf @@ -62,6 +62,20 @@ if (basename($cc) =~ m{^g(?:cc|\+\+)}) { # splice "-o fn" from ARGV my $output_fn; + + # for autoconf(C89 comatibirity test) begin + for (my $i = 0; $i < @ARGV;) { + if ($i + 1 < @ARGV && $ARGV[$i] eq '-c') { + $output_fn = $ARGV[$i + 1]; + $output_fn =~ s/\.c/\.o/; + #splice @ARGV, $i, 2; + ++$i; + } else { + ++$i; + } + } + # end + for (my $i = 0; $i < @ARGV;) { if ($i + 1 < @ARGV && $ARGV[$i] eq '-o') { $output_fn = $ARGV[$i + 1]; From e3f8a9c23c3785fa9226c9ea85215bbd1d732f71 Mon Sep 17 00:00:00 2001 From: Junichi Kajiwara Date: Mon, 13 Jul 2015 05:36:55 +0000 Subject: [PATCH 2/3] Revert "Merge pull request #1 from kjunichi/kjunichi-patch-1" This reverts commit f6b116816fcf4ed15ecd2f40edee96b12f5d83d1, reversing changes made to 283a25e4ea975ff0ab0e4b159c161ddca2de2826. --- bin/qrintf | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/bin/qrintf b/bin/qrintf index ff804cc..4b91eff 100755 --- a/bin/qrintf +++ b/bin/qrintf @@ -62,20 +62,6 @@ if (basename($cc) =~ m{^g(?:cc|\+\+)}) { # splice "-o fn" from ARGV my $output_fn; - - # for autoconf(C89 comatibirity test) begin - for (my $i = 0; $i < @ARGV;) { - if ($i + 1 < @ARGV && $ARGV[$i] eq '-c') { - $output_fn = $ARGV[$i + 1]; - $output_fn =~ s/\.c/\.o/; - #splice @ARGV, $i, 2; - ++$i; - } else { - ++$i; - } - } - # end - for (my $i = 0; $i < @ARGV;) { if ($i + 1 < @ARGV && $ARGV[$i] eq '-o') { $output_fn = $ARGV[$i + 1]; From f02ad1bfa76f091846a05bce1087b2a8c7e5d65b Mon Sep 17 00:00:00 2001 From: Junichi Kajiwara Date: Mon, 13 Jul 2015 05:42:15 +0000 Subject: [PATCH 3/3] Fix support clang when we use autotools --- bin/qrintf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/qrintf b/bin/qrintf index 4b91eff..87f2095 100755 --- a/bin/qrintf +++ b/bin/qrintf @@ -62,11 +62,16 @@ if (basename($cc) =~ m{^g(?:cc|\+\+)}) { # splice "-o fn" from ARGV my $output_fn; + my $coption; + for (my $i = 0; $i < @ARGV;) { if ($i + 1 < @ARGV && $ARGV[$i] eq '-o') { $output_fn = $ARGV[$i + 1]; splice @ARGV, $i, 2; } else { + if ($i + 1 < @ARGV && $ARGV[$i] eq '-c') { + $coption = 1; + } ++$i; } } @@ -78,6 +83,10 @@ if (basename($cc) =~ m{^g(?:cc|\+\+)}) { && -e $ARGV[$i] # is a file && get_preprocessed_fn($ARGV[$i]) # is a file that is recognized as a source file ) { + if($ARGV[$i] =~ /\.c$/ && !defined $output_fn && defined $coption) { + $output_fn = $ARGV[$i]; + $output_fn =~ s/\.c$/\.o/; + } push @files, splice @ARGV, $i, 1; } else { ++$i;