X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Farm64cpuid.pl;h=0fdaf3db678d5f5ac513cd3ac1545d4b84727d1e;hp=06c8add7a07561f1f00b2e5edb6826881771ba83;hb=dc8de3e6f1eed18617dc42d41dec6c6566c2ac0c;hpb=9a708bf982da1d2c9739339d16d7b021da955e00 diff --git a/crypto/arm64cpuid.pl b/crypto/arm64cpuid.pl index 06c8add7a0..0fdaf3db67 100755 --- a/crypto/arm64cpuid.pl +++ b/crypto/arm64cpuid.pl @@ -1,21 +1,24 @@ #! /usr/bin/env perl # Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. # -# Licensed under the OpenSSL license (the "License"). You may not use +# Licensed under the Apache License 2.0 (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # 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";