Unify all assembler file generators
[openssl.git] / crypto / poly1305 / asm / poly1305-s390x.pl
index 73efdd9e6d5c797d3a90d58dfa87a4976b40d67d..7f1f8347edcbff15fc3d488cf0e6e38bd3c7563f 100755 (executable)
@@ -47,7 +47,10 @@ use FindBin qw($Bin);
 use lib "$Bin/../..";
 use perlasm::s390x qw(:DEFAULT :LD :GE :EI :MI1 :VX AUTOLOAD LABEL INCLUDE);
 
-my $flavour = 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
+my $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+my $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
 
 my ($z,$SIZE_T);
 if ($flavour =~ /3[12]/) {
@@ -58,9 +61,6 @@ if ($flavour =~ /3[12]/) {
        $SIZE_T=8;
 }
 
-my $output;
-while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
-
 my $stdframe=16*$SIZE_T+4*8;
 my $sp="%r15";