summaryrefslogtreecommitdiff
path: root/security/openssl/patches/patch_netbsd-ab
blob: 2dec0c56aa8023bd7a4e4a16791b3c8c676c7b3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
$NetBSD: patch_netbsd-ab,v 1.1 2001/04/05 14:00:59 wiz Exp $

--- Configure.orig	Mon Mar 27 23:28:10 2000
+++ Configure
@@ -274,9 +274,6 @@
 "linux-mips",   "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::BN_LLONG:::",
 "linux-ppc",    "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::BN_LLONG::",
 "linux-ia64",   "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::(unknown)::SIXTY_FOUR_BIT_LONG::",
-"NetBSD-sparc",	"gcc:-DTERMIOS -O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:::",
-"NetBSD-m68",	"gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:::",
-"NetBSD-x86",	"gcc:-DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:",
 "FreeBSD-elf",  "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 "FreeBSD",      "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
 "bsdi-gcc",     "gcc:-O3 -ffast-math -DL_ENDIAN -DPERL5 -m486::(unknown)::RSA_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_bsdi_asm}",
@@ -297,6 +294,20 @@
 "aix-cc",   "cc:-O -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR:::",
 "aix-gcc",  "gcc:-O3 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR:::",
 
+# NetBSD
+"NetBSD-alpha", "gcc:-DTERMIOS -O3 -Wall::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:",
+"NetBSD-arm32", "gcc:-DTERMIOS -O3 -Wall -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:",
+"NetBSD-i386", "gcc:-DBN_ASM -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_out_asm:",
+"NetBSD-i386elf", "gcc:-DBN_ASM -DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -m486 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm:",
+"NetBSD-m68k", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:",
+"NetBSD-mipseb", "gcc:-DTERMIOS -O3 -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:",
+"NetBSD-mipsel", "gcc:-DTERMIOS -O3 -Wall -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:",
+"NetBSD-ns32k", "gcc:-DTERMIOS -O3 -Wall -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:",
+"NetBSD-powerpc", "gcc:-DTERMIOS -O3 -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:",
+"NetBSD-sparc", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:",
+"NetBSD-sparc64", "gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::(unknown)::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC1:",
+"NetBSD-vax", "gcc:-DTERMIOS -O3 -Wall -DL_ENDIAN::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:",
+
 #
 # Cray T90 (SDSC)
 # It's Big-endian, but the algorithms work properly when B_ENDIAN is NOT
@@ -421,6 +432,7 @@
 my $openssl_other_defines="";
 my $libs="";
 my $target="";
+my $xmakelib="";
 my $options="";
 foreach (@ARGV)
 	{
@@ -458,11 +470,12 @@
 		{
 		$libs.= "-lRSAglue -lrsaref ";
 		$flags.= "-DRSAref ";
+		$xmakelib=" libRSAglue.a";
 		$openssl_other_defines .= "#define RSAref\n";
 		}
 	elsif (/^[-+]/)
 		{
-		if (/^-[lL](.*)$/)
+		if (/^-([lLR]|Wl,)(.*)$/)
 			{
 			$libs.=$_." ";
 			}
@@ -626,14 +639,19 @@
 
 if ($version =~ /(^[0-9]*)\.([0-9\.]*)/)
 	{
-	$major=$1;
-	$minor=$2;
+# XXX Openssl version is 0.9, not 1.0
+	$major=1;
+	$minor=0;
 	}
 
 open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
 open(OUT,">$Makefile") || die "unable to create $Makefile:$!\n";
 print OUT "### Generated automatically from Makefile.org by Configure.\n\n";
 my $sdirs=0;
+my $is_elf="0";
+if ($target =~ /.*elf.*/) {
+	$is_elf="1";
+}
 while (<IN>)
 	{
 	chop;
@@ -645,6 +663,7 @@
 			}
 		}
 	$sdirs = 0 unless /\\$/;
+	s/^IS_ELF=.*/IS_ELF=$is_elf/;
 	s/^VERSION=.*/VERSION=$version/;
 	s/^MAJOR=.*/MAJOR=$major/;
 	s/^MINOR=.*/MINOR=$minor/;
@@ -669,6 +688,19 @@
 	s/^PROCESSOR=.*/PROCESSOR= $processor/;
 	s/^RANLIB=.*/RANLIB= $ranlib/;
 	s/^PERL=.*/PERL= $perl/;
+	print OUT $_."\n";
+	}
+close(IN);
+close(OUT);
+
+rename("crypto/Makefile.ssl", "crypto/Makefile.org") unless -e "crypto/Makefile.org";
+open(IN, '<crypto/Makefile.org') || die "unable to read crypto/Makefile.org:$!\n";
+open(OUT,">crypto/Makefile.ssl") || die "unable to create crypto/Makefile.ssl:$!\n";
+
+while (<IN>)
+	{
+	chop;
+	s/^(.*)\${MAKELIB}(.*)$/$&$xmakelib/;
 	print OUT $_."\n";
 	}
 close(IN);