summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/util/mk1mf.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/util/mk1mf.pl')
-rw-r--r--src/lib/libcrypto/util/mk1mf.pl98
1 files changed, 52 insertions, 46 deletions
diff --git a/src/lib/libcrypto/util/mk1mf.pl b/src/lib/libcrypto/util/mk1mf.pl
index 46755fa287..8b6b2e668a 100644
--- a/src/lib/libcrypto/util/mk1mf.pl
+++ b/src/lib/libcrypto/util/mk1mf.pl
@@ -37,6 +37,7 @@ $infile="MINFO";
37 "linux-elf","Linux elf", 37 "linux-elf","Linux elf",
38 "ultrix-mips","DEC mips ultrix", 38 "ultrix-mips","DEC mips ultrix",
39 "FreeBSD","FreeBSD distribution", 39 "FreeBSD","FreeBSD distribution",
40 "OS2-EMX", "EMX GCC OS/2",
40 "default","cc under unix", 41 "default","cc under unix",
41 ); 42 );
42 43
@@ -54,12 +55,14 @@ foreach (@ARGV)
54and [options] can be one of 55and [options] can be one of
55 no-md2 no-md4 no-md5 no-sha no-mdc2 - Skip this digest 56 no-md2 no-md4 no-md5 no-sha no-mdc2 - Skip this digest
56 no-ripemd 57 no-ripemd
57 no-rc2 no-rc4 no-idea no-des no-bf no-cast - Skip this symetric cipher 58 no-rc2 no-rc4 no-rc5 no-idea no-des - Skip this symetric cipher
58 no-rc5 59 no-bf no-cast no-aes
59 no-rsa no-dsa no-dh - Skip this public key cipher 60 no-rsa no-dsa no-dh - Skip this public key cipher
60 no-ssl2 no-ssl3 - Skip this version of SSL 61 no-ssl2 no-ssl3 - Skip this version of SSL
61 just-ssl - remove all non-ssl keys/digest 62 just-ssl - remove all non-ssl keys/digest
62 no-asm - No x86 asm 63 no-asm - No x86 asm
64 no-krb5 - No KRB5
65 no-ec - No EC
63 nasm - Use NASM for x86 asm 66 nasm - Use NASM for x86 asm
64 gaswin - Use GNU as with Mingw32 67 gaswin - Use GNU as with Mingw32
65 no-socks - No socket code 68 no-socks - No socket code
@@ -68,7 +71,6 @@ and [options] can be one of
68 debug - Debug build 71 debug - Debug build
69 profile - Profiling build 72 profile - Profiling build
70 gcc - Use Gcc (unix) 73 gcc - Use Gcc (unix)
71 rsaref - Build to require RSAref
72 74
73Values that can be set 75Values that can be set
74TMP=tmpdir OUT=outdir SRC=srcdir BIN=binpath INC=header-outdir CC=C-compiler 76TMP=tmpdir OUT=outdir SRC=srcdir BIN=binpath INC=header-outdir CC=C-compiler
@@ -81,7 +83,7 @@ EOF
81 } 83 }
82 $platform=$_; 84 $platform=$_;
83 } 85 }
84foreach (split / /, $OPTIONS) 86foreach (grep(!/^$/, split(/ /, $OPTIONS)))
85 { 87 {
86 print STDERR "unknown option - $_\n" if !&read_options; 88 print STDERR "unknown option - $_\n" if !&read_options;
87 } 89 }
@@ -91,7 +93,7 @@ $no_mdc2=1 if ($no_des);
91$no_ssl3=1 if ($no_md5 || $no_sha); 93$no_ssl3=1 if ($no_md5 || $no_sha);
92$no_ssl3=1 if ($no_rsa && $no_dh); 94$no_ssl3=1 if ($no_rsa && $no_dh);
93 95
94$no_ssl2=1 if ($no_md5 || $no_rsa); 96$no_ssl2=1 if ($no_md5);
95$no_ssl2=1 if ($no_rsa); 97$no_ssl2=1 if ($no_rsa);
96 98
97$out_def="out"; 99$out_def="out";
@@ -101,7 +103,6 @@ $tmp_def="tmp";
101$mkdir="mkdir"; 103$mkdir="mkdir";
102 104
103($ssl,$crypto)=("ssl","crypto"); 105($ssl,$crypto)=("ssl","crypto");
104$RSAglue="RSAglue";
105$ranlib="echo ranlib"; 106$ranlib="echo ranlib";
106 107
107$cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc'; 108$cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc';
@@ -183,6 +184,11 @@ elsif ($platform eq "ultrix-mips")
183 require "ultrix.pl"; 184 require "ultrix.pl";
184 $unix=1; 185 $unix=1;
185 } 186 }
187elsif ($platform eq "OS2-EMX")
188 {
189 $wc=1;
190 require 'OS2-EMX.pl';
191 }
186else 192else
187 { 193 {
188 require "unix.pl"; 194 require "unix.pl";
@@ -197,28 +203,31 @@ $inc_dir=(defined($VARS{'INC'}))?$VARS{'INC'}:$inc_def;
197 203
198$bin_dir=$bin_dir.$o unless ((substr($bin_dir,-1,1) eq $o) || ($bin_dir eq '')); 204$bin_dir=$bin_dir.$o unless ((substr($bin_dir,-1,1) eq $o) || ($bin_dir eq ''));
199 205
200$cflags.=" -DNO_IDEA" if $no_idea; 206$cflags.=" -DOPENSSL_NO_IDEA" if $no_idea;
201$cflags.=" -DNO_RC2" if $no_rc2; 207$cflags.=" -DOPENSSL_NO_AES" if $no_aes;
202$cflags.=" -DNO_RC4" if $no_rc4; 208$cflags.=" -DOPENSSL_NO_RC2" if $no_rc2;
203$cflags.=" -DNO_RC5" if $no_rc5; 209$cflags.=" -DOPENSSL_NO_RC4" if $no_rc4;
204$cflags.=" -DNO_MD2" if $no_md2; 210$cflags.=" -DOPENSSL_NO_RC5" if $no_rc5;
205$cflags.=" -DNO_MD4" if $no_md4; 211$cflags.=" -DOPENSSL_NO_MD2" if $no_md2;
206$cflags.=" -DNO_MD5" if $no_md5; 212$cflags.=" -DOPENSSL_NO_MD4" if $no_md4;
207$cflags.=" -DNO_SHA" if $no_sha; 213$cflags.=" -DOPENSSL_NO_MD5" if $no_md5;
208$cflags.=" -DNO_SHA1" if $no_sha1; 214$cflags.=" -DOPENSSL_NO_SHA" if $no_sha;
209$cflags.=" -DNO_RIPEMD" if $no_rmd160; 215$cflags.=" -DOPENSSL_NO_SHA1" if $no_sha1;
210$cflags.=" -DNO_MDC2" if $no_mdc2; 216$cflags.=" -DOPENSSL_NO_RIPEMD" if $no_rmd160;
211$cflags.=" -DNO_BF" if $no_bf; 217$cflags.=" -DOPENSSL_NO_MDC2" if $no_mdc2;
212$cflags.=" -DNO_CAST" if $no_cast; 218$cflags.=" -DOPENSSL_NO_BF" if $no_bf;
213$cflags.=" -DNO_DES" if $no_des; 219$cflags.=" -DOPENSSL_NO_CAST" if $no_cast;
214$cflags.=" -DNO_RSA" if $no_rsa; 220$cflags.=" -DOPENSSL_NO_DES" if $no_des;
215$cflags.=" -DNO_DSA" if $no_dsa; 221$cflags.=" -DOPENSSL_NO_RSA" if $no_rsa;
216$cflags.=" -DNO_DH" if $no_dh; 222$cflags.=" -DOPENSSL_NO_DSA" if $no_dsa;
217$cflags.=" -DNO_SOCK" if $no_sock; 223$cflags.=" -DOPENSSL_NO_DH" if $no_dh;
218$cflags.=" -DNO_SSL2" if $no_ssl2; 224$cflags.=" -DOPENSSL_NO_SOCK" if $no_sock;
219$cflags.=" -DNO_SSL3" if $no_ssl3; 225$cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2;
220$cflags.=" -DNO_ERR" if $no_err; 226$cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3;
221$cflags.=" -DRSAref" if $rsaref ne ""; 227$cflags.=" -DOPENSSL_NO_ERR" if $no_err;
228$cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5;
229$cflags.=" -DOPENSSL_NO_EC" if $no_ec;
230#$cflags.=" -DRSAref" if $rsaref ne "";
222 231
223## if ($unix) 232## if ($unix)
224## { $cflags="$c_flags" if ($c_flags ne ""); } 233## { $cflags="$c_flags" if ($c_flags ne ""); }
@@ -227,6 +236,9 @@ $cflags.=" -DRSAref" if $rsaref ne "";
227 236
228$ex_libs="$l_flags$ex_libs" if ($l_flags ne ""); 237$ex_libs="$l_flags$ex_libs" if ($l_flags ne "");
229 238
239%shlib_ex_cflags=("SSL" => " -DOPENSSL_BUILD_SHLIBSSL",
240 "CRYPTO" => " -DOPENSSL_BUILD_SHLIBCRYPTO");
241
230if ($msdos) 242if ($msdos)
231 { 243 {
232 $banner ="\t\@echo Make sure you have run 'perl Configure $platform' in the\n"; 244 $banner ="\t\@echo Make sure you have run 'perl Configure $platform' in the\n";
@@ -319,7 +331,6 @@ ASM=$bin_dir$asm
319E_EXE=openssl 331E_EXE=openssl
320SSL=$ssl 332SSL=$ssl
321CRYPTO=$crypto 333CRYPTO=$crypto
322RSAGLUE=$RSAglue
323 334
324# BIN_D - Binary output directory 335# BIN_D - Binary output directory
325# TEST_D - Binary test file output directory 336# TEST_D - Binary test file output directory
@@ -338,14 +349,12 @@ INCL_D=\$(TMP_D)
338 349
339O_SSL= \$(LIB_D)$o$plib\$(SSL)$shlibp 350O_SSL= \$(LIB_D)$o$plib\$(SSL)$shlibp
340O_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$shlibp 351O_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$shlibp
341O_RSAGLUE= \$(LIB_D)$o$plib\$(RSAGLUE)$libp
342SO_SSL= $plib\$(SSL)$so_shlibp 352SO_SSL= $plib\$(SSL)$so_shlibp
343SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp 353SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp
344L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp 354L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp
345L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp 355L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp
346 356
347L_LIBS= \$(L_SSL) \$(L_CRYPTO) 357L_LIBS= \$(L_SSL) \$(L_CRYPTO)
348#L_LIBS= \$(O_SSL) \$(O_RSAGLUE) -lrsaref \$(O_CRYPTO)
349 358
350###################################################### 359######################################################
351# Don't touch anything below this point 360# Don't touch anything below this point
@@ -355,7 +364,7 @@ INC=-I\$(INC_D) -I\$(INCL_D)
355APP_CFLAGS=\$(INC) \$(CFLAG) \$(APP_CFLAG) 364APP_CFLAGS=\$(INC) \$(CFLAG) \$(APP_CFLAG)
356LIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) 365LIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG)
357SHLIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) \$(SHLIB_CFLAG) 366SHLIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) \$(SHLIB_CFLAG)
358LIBS_DEP=\$(O_CRYPTO) \$(O_RSAGLUE) \$(O_SSL) 367LIBS_DEP=\$(O_CRYPTO) \$(O_SSL)
359 368
360############################################# 369#############################################
361EOF 370EOF
@@ -527,20 +536,12 @@ foreach (values %lib_nam)
527 $lib_obj=$lib_obj{$_}; 536 $lib_obj=$lib_obj{$_};
528 local($slib)=$shlib; 537 local($slib)=$shlib;
529 538
530 $slib=0 if ($_ eq "RSAGLUE");
531
532 if (($_ eq "SSL") && $no_ssl2 && $no_ssl3) 539 if (($_ eq "SSL") && $no_ssl2 && $no_ssl3)
533 { 540 {
534 $rules.="\$(O_SSL):\n\n"; 541 $rules.="\$(O_SSL):\n\n";
535 next; 542 next;
536 } 543 }
537 544
538 if (($_ eq "RSAGLUE") && $no_rsa)
539 {
540 $rules.="\$(O_RSAGLUE):\n\n";
541 next;
542 }
543
544 if (($bn_asm_obj ne "") && ($_ eq "CRYPTO")) 545 if (($bn_asm_obj ne "") && ($_ eq "CRYPTO"))
545 { 546 {
546 $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/; 547 $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/;
@@ -593,7 +594,7 @@ foreach (values %lib_nam)
593 $rules.=&do_asm_rule($rmd160_asm_obj,$rmd160_asm_src); 594 $rules.=&do_asm_rule($rmd160_asm_obj,$rmd160_asm_src);
594 } 595 }
595 $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj); 596 $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj);
596 $lib=($slib)?" \$(SHLIB_CFLAGS)":" \$(LIB_CFLAGS)"; 597 $lib=($slib)?" \$(SHLIB_CFLAGS)".$shlib_ex_cflags{$_}:" \$(LIB_CFLAGS)";
597 $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib); 598 $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib);
598 } 599 }
599 600
@@ -606,8 +607,6 @@ foreach (split(/\s+/,$test))
606 } 607 }
607 608
608$rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)"); 609$rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)");
609$rules.= &do_lib_rule("\$(RSAGLUEOBJ)","\$(O_RSAGLUE)",$RSAglue,0,"")
610 unless $no_rsa;
611$rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)"); 610$rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)");
612 611
613$rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); 612$rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)");
@@ -634,6 +633,7 @@ sub var_add
634 local(@a,$_,$ret); 633 local(@a,$_,$ret);
635 634
636 return("") if $no_idea && $dir =~ /\/idea/; 635 return("") if $no_idea && $dir =~ /\/idea/;
636 return("") if $no_aes && $dir =~ /\/aes/;
637 return("") if $no_rc2 && $dir =~ /\/rc2/; 637 return("") if $no_rc2 && $dir =~ /\/rc2/;
638 return("") if $no_rc4 && $dir =~ /\/rc4/; 638 return("") if $no_rc4 && $dir =~ /\/rc4/;
639 return("") if $no_rc5 && $dir =~ /\/rc5/; 639 return("") if $no_rc5 && $dir =~ /\/rc5/;
@@ -659,7 +659,8 @@ sub var_add
659 659
660 @a=grep(!/^e_.*_3d$/,@a) if $no_des; 660 @a=grep(!/^e_.*_3d$/,@a) if $no_des;
661 @a=grep(!/^e_.*_d$/,@a) if $no_des; 661 @a=grep(!/^e_.*_d$/,@a) if $no_des;
662 @a=grep(!/^e_.*_i$/,@a) if $no_idea; 662 @a=grep(!/^e_.*_ae$/,@a) if $no_idea;
663 @a=grep(!/^e_.*_i$/,@a) if $no_aes;
663 @a=grep(!/^e_.*_r2$/,@a) if $no_rc2; 664 @a=grep(!/^e_.*_r2$/,@a) if $no_rc2;
664 @a=grep(!/^e_.*_r5$/,@a) if $no_rc5; 665 @a=grep(!/^e_.*_r5$/,@a) if $no_rc5;
665 @a=grep(!/^e_.*_bf$/,@a) if $no_bf; 666 @a=grep(!/^e_.*_bf$/,@a) if $no_bf;
@@ -858,6 +859,7 @@ sub read_options
858 elsif (/^no-rc4$/) { $no_rc4=1; } 859 elsif (/^no-rc4$/) { $no_rc4=1; }
859 elsif (/^no-rc5$/) { $no_rc5=1; } 860 elsif (/^no-rc5$/) { $no_rc5=1; }
860 elsif (/^no-idea$/) { $no_idea=1; } 861 elsif (/^no-idea$/) { $no_idea=1; }
862 elsif (/^no-aes$/) { $no_aes=1; }
861 elsif (/^no-des$/) { $no_des=1; } 863 elsif (/^no-des$/) { $no_des=1; }
862 elsif (/^no-bf$/) { $no_bf=1; } 864 elsif (/^no-bf$/) { $no_bf=1; }
863 elsif (/^no-cast$/) { $no_cast=1; } 865 elsif (/^no-cast$/) { $no_cast=1; }
@@ -873,6 +875,7 @@ sub read_options
873 elsif (/^no-dsa$/) { $no_dsa=1; } 875 elsif (/^no-dsa$/) { $no_dsa=1; }
874 elsif (/^no-dh$/) { $no_dh=1; } 876 elsif (/^no-dh$/) { $no_dh=1; }
875 elsif (/^no-hmac$/) { $no_hmac=1; } 877 elsif (/^no-hmac$/) { $no_hmac=1; }
878 elsif (/^no-aes$/) { $no_aes=1; }
876 elsif (/^no-asm$/) { $no_asm=1; } 879 elsif (/^no-asm$/) { $no_asm=1; }
877 elsif (/^nasm$/) { $nasm=1; } 880 elsif (/^nasm$/) { $nasm=1; }
878 elsif (/^gaswin$/) { $gaswin=1; } 881 elsif (/^gaswin$/) { $gaswin=1; }
@@ -880,12 +883,15 @@ sub read_options
880 elsif (/^no-ssl3$/) { $no_ssl3=1; } 883 elsif (/^no-ssl3$/) { $no_ssl3=1; }
881 elsif (/^no-err$/) { $no_err=1; } 884 elsif (/^no-err$/) { $no_err=1; }
882 elsif (/^no-sock$/) { $no_sock=1; } 885 elsif (/^no-sock$/) { $no_sock=1; }
886 elsif (/^no-krb5$/) { $no_krb5=1; }
887 elsif (/^no-ec$/) { $no_ec=1; }
883 888
884 elsif (/^just-ssl$/) { $no_rc2=$no_idea=$no_des=$no_bf=$no_cast=1; 889 elsif (/^just-ssl$/) { $no_rc2=$no_idea=$no_des=$no_bf=$no_cast=1;
885 $no_md2=$no_sha=$no_mdc2=$no_dsa=$no_dh=1; 890 $no_md2=$no_sha=$no_mdc2=$no_dsa=$no_dh=1;
886 $no_ssl2=$no_err=$no_rmd160=$no_rc5=1; } 891 $no_ssl2=$no_err=$no_rmd160=$no_rc5=1;
892 $no_aes=1; }
887 893
888 elsif (/^rsaref$/) { $rsaref=1; } 894 elsif (/^rsaref$/) { }
889 elsif (/^gcc$/) { $gcc=1; } 895 elsif (/^gcc$/) { $gcc=1; }
890 elsif (/^debug$/) { $debug=1; } 896 elsif (/^debug$/) { $debug=1; }
891 elsif (/^profile$/) { $profile=1; } 897 elsif (/^profile$/) { $profile=1; }