Merge pull request #858 from buffer51/develop

Fixed cross-suffix detection for path that contains dashes
This commit is contained in:
Zhang Xianyi 2016-04-28 11:42:18 -04:00
commit c95f5008fe
1 changed files with 9 additions and 9 deletions

18
c_check
View File

@ -1,5 +1,7 @@
#!/usr/bin/perl #!/usr/bin/perl
use File::Basename;
# Checking cross compile # Checking cross compile
$hostos = `uname -s | sed -e s/\-.*//`; chop($hostos); $hostos = `uname -s | sed -e s/\-.*//`; chop($hostos);
$hostarch = `uname -m | sed -e s/i.86/x86/`;chop($hostarch); $hostarch = `uname -m | sed -e s/i.86/x86/`;chop($hostarch);
@ -26,14 +28,12 @@ if ($?) {
$cross_suffix = ""; $cross_suffix = "";
if ($ARGV[0] =~ /(.*)(-[.\d]+)/) { if (dirname($compiler_name) ne ".") {
if ($1 =~ /(.*-)(.*)/) { $cross_suffix .= dirname($compiler_name) . "/";
$cross_suffix = $1; }
}
} else { if (basename($compiler_name) =~ /(.*-)(.*)/) {
if ($ARGV[0] =~ /([^\/]*-)([^\/]*$)/) { $cross_suffix .= $1;
$cross_suffix = $1;
}
} }
$compiler = ""; $compiler = "";
@ -243,7 +243,7 @@ print MAKEFILE "BINARY64=\n" if $binformat ne bin64;
print MAKEFILE "BINARY32=1\n" if $binformat eq bin32; print MAKEFILE "BINARY32=1\n" if $binformat eq bin32;
print MAKEFILE "BINARY64=1\n" if $binformat eq bin64; print MAKEFILE "BINARY64=1\n" if $binformat eq bin64;
print MAKEFILE "FU=$need_fu\n" if $need_fu ne ""; print MAKEFILE "FU=$need_fu\n" if $need_fu ne "";
print MAKEFILE "CROSS_SUFFIX=$cross_suffix\n" if $cross_suffix ne ""; print MAKEFILE "CROSS_SUFFIX=$cross_suffix\n" if $cross != 0 && $cross_suffix ne "";
print MAKEFILE "CROSS=1\n" if $cross != 0; print MAKEFILE "CROSS=1\n" if $cross != 0;
print MAKEFILE "CEXTRALIB=$linker_L $linker_l $linker_a\n"; print MAKEFILE "CEXTRALIB=$linker_L $linker_l $linker_a\n";