Check for the presence of _WIN32 rather than its value.
[oweals/openssl.git] / crypto / bn / asm / co-586.pl
index 0bcb5a6d471c4c6b3b44364474233f382ad5fd93..60d0363660d093c96e64e07b1724f41d540f6e5a 100644 (file)
@@ -1,9 +1,19 @@
-#!/usr/local/bin/perl
-
-push(@INC,"perlasm","../../perlasm");
+#! /usr/bin/env perl
+# Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (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
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
-&asm_init($ARGV[0],"bn-586.pl");
+$output = pop;
+open STDOUT,">$output";
+
+&asm_init($ARGV[0],$0);
 
 &bn_mul_comba("bn_mul_comba8",8);
 &bn_mul_comba("bn_mul_comba4",4);
@@ -12,6 +22,8 @@ require "x86asm.pl";
 
 &asm_finish();
 
+close STDOUT;
+
 sub mul_add_c
        {
        local($a,$ai,$b,$bi,$c0,$c1,$c2,$pos,$i,$na,$nb)=@_;