X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Farm64cpuid.pl;h=0fdaf3db678d5f5ac513cd3ac1545d4b84727d1e;hb=32be631ca1f2b73c92e4f7f5d23f1c3aee80ec69;hp=f25c6373a4623ceff10069b601de86dc464e0ff0;hpb=0e9725bcb90770d967351b977407b174bbd91869;p=oweals%2Fopenssl.git diff --git a/crypto/arm64cpuid.pl b/crypto/arm64cpuid.pl index f25c6373a4..0fdaf3db67 100755 --- a/crypto/arm64cpuid.pl +++ b/crypto/arm64cpuid.pl @@ -7,15 +7,18 @@ # https://www.openssl.org/source/license.html -$flavour = shift; -$output = shift; +# $output is the last argument if it looks like a file (it has an extension) +# $flavour is the first argument if it doesn't look like a file +$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef; +$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef; $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; ( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or ( $xlate="${dir}perlasm/arm-xlate.pl" and -f $xlate) or die "can't locate arm-xlate.pl"; -open OUT,"| \"$^X\" $xlate $flavour $output"; +open OUT,"| \"$^X\" $xlate $flavour \"$output\"" + or die "can't call $xlate: $!"; *STDOUT=*OUT; $code.=<<___; @@ -144,4 +147,4 @@ CRYPTO_memcmp: ___ print $code; -close STDOUT; +close STDOUT or die "error closing STDOUT";