Add an Apple privacy info file for OpenSSL
[openssl.git] / ms / uplink-x86_64.pl
index 9efe5ab98bb51573b9fba8d0c9b3f9fc82a4af96..e27e74536b66e855af9e35d073b6cd783754f7b3 100755 (executable)
@@ -1,14 +1,18 @@
 #! /usr/bin/env perl
 #! /usr/bin/env perl
-# Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2008-2024 The OpenSSL Project Authors. All Rights Reserved.
 #
 # 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
 
 #
 # 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
 
-$output=pop;
+# $output is the last argument if it looks like a file (it has an extension)
+$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
+$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
+
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
-open OUT,"| \"$^X\" \"${dir}../crypto/perlasm/x86_64-xlate.pl\" \"$output\"";
+open OUT,"| \"$^X\" \"${dir}../crypto/perlasm/x86_64-xlate.pl\" $flavour \"$output\""
+    or die "can't call ${dir}../crypto/perlasm/x86_64-xlate.pl: $!";
 *STDOUT=*OUT;
 push(@INC,"${dir}.");
 
 *STDOUT=*OUT;
 push(@INC,"${dir}.");