crypto/ppccap.c: permit build with no-chacha and no-poly1305.
[openssl.git] / crypto / objects / objxref.pl
index 1913b9d133c24b05c56c68b9eb98e4589abf6313..db0415f2515f3c25040292901a28fb18a2c70986 100644 (file)
@@ -1,4 +1,11 @@
-#!/usr/local/bin/perl
+#! /usr/bin/env perl
+# Copyright 2006-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
+
 
 use strict;
 
@@ -7,25 +14,25 @@ my %oid_tbl;
 
 my ($mac_file, $xref_file) = @ARGV;
 
-open(IN, $mac_file) || die "Can't open $mac_file";
+open(IN, $mac_file) || die "Can't open $mac_file, $!\n";
 
 # Read in OID nid values for a lookup table.
 
 while (<IN>)
        {
-       chomp;
+       s|\R$||;                # Better chomp
        my ($name, $num) = /^(\S+)\s+(\S+)$/;
        $oid_tbl{$name} = $num;
        }
 close IN;
 
-open(IN, $xref_file) || die "Can't open $xref_file";
+open(IN, $xref_file) || die "Can't open $xref_file, $!\n";
 
 my $ln = 1;
 
 while (<IN>)
        {
-       chomp;
+       s|\R$||;                # Better chomp
        s/#.*$//;
        next if (/^\S*$/);
        my ($xr, $p1, $p2) = /^(\S+)\s+(\S+)\s+(\S+)/;
@@ -57,8 +64,7 @@ my @srt2 = sort
        } @xrkeys;
 
 my $pname = $0;
-
-$pname =~ s|^.[^/]/||;
+$pname =~ s|.*/||;
 
 print <<EOF;
 /* AUTOGENERATED BY $pname, DO NOT EDIT */
@@ -69,6 +75,8 @@ typedef struct {
     int pkey_id;
 } nid_triple;
 
+DEFINE_STACK_OF(nid_triple)
+
 static const nid_triple sigoid_srt[] = {
 EOF
 
@@ -111,6 +119,6 @@ sub check_oid
        my ($chk) = @_;
        if (!exists $oid_tbl{$chk})
                {
-               die "Not Found \"$chk\"\n";
+               die "Can't find \"$chk\"\n";
                }
        }