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.pl33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/lib/libcrypto/util/mk1mf.pl b/src/lib/libcrypto/util/mk1mf.pl
index 100d76f279..46755fa287 100644
--- a/src/lib/libcrypto/util/mk1mf.pl
+++ b/src/lib/libcrypto/util/mk1mf.pl
@@ -52,7 +52,8 @@ foreach (@ARGV)
52 { printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; } 52 { printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; }
53 print STDERR <<"EOF"; 53 print STDERR <<"EOF";
54and [options] can be one of 54and [options] can be one of
55 no-md2 no-md5 no-sha no-mdc2 no-ripemd - Skip this digest 55 no-md2 no-md4 no-md5 no-sha no-mdc2 - Skip this digest
56 no-ripemd
56 no-rc2 no-rc4 no-idea no-des no-bf no-cast - Skip this symetric cipher 57 no-rc2 no-rc4 no-idea no-des no-bf no-cast - Skip this symetric cipher
57 no-rc5 58 no-rc5
58 no-rsa no-dsa no-dh - Skip this public key cipher 59 no-rsa no-dsa no-dh - Skip this public key cipher
@@ -65,6 +66,7 @@ and [options] can be one of
65 no-err - No error strings 66 no-err - No error strings
66 dll/shlib - Build shared libraries (MS) 67 dll/shlib - Build shared libraries (MS)
67 debug - Debug build 68 debug - Debug build
69 profile - Profiling build
68 gcc - Use Gcc (unix) 70 gcc - Use Gcc (unix)
69 rsaref - Build to require RSAref 71 rsaref - Build to require RSAref
70 72
@@ -200,6 +202,7 @@ $cflags.=" -DNO_RC2" if $no_rc2;
200$cflags.=" -DNO_RC4" if $no_rc4; 202$cflags.=" -DNO_RC4" if $no_rc4;
201$cflags.=" -DNO_RC5" if $no_rc5; 203$cflags.=" -DNO_RC5" if $no_rc5;
202$cflags.=" -DNO_MD2" if $no_md2; 204$cflags.=" -DNO_MD2" if $no_md2;
205$cflags.=" -DNO_MD4" if $no_md4;
203$cflags.=" -DNO_MD5" if $no_md5; 206$cflags.=" -DNO_MD5" if $no_md5;
204$cflags.=" -DNO_SHA" if $no_sha; 207$cflags.=" -DNO_SHA" if $no_sha;
205$cflags.=" -DNO_SHA1" if $no_sha1; 208$cflags.=" -DNO_SHA1" if $no_sha1;
@@ -217,9 +220,10 @@ $cflags.=" -DNO_SSL3" if $no_ssl3;
217$cflags.=" -DNO_ERR" if $no_err; 220$cflags.=" -DNO_ERR" if $no_err;
218$cflags.=" -DRSAref" if $rsaref ne ""; 221$cflags.=" -DRSAref" if $rsaref ne "";
219 222
220if ($unix) 223## if ($unix)
221 { $cflags="$c_flags" if ($c_flags ne ""); } 224## { $cflags="$c_flags" if ($c_flags ne ""); }
222else { $cflags="$c_flags$cflags" if ($c_flags ne ""); } 225##else
226 { $cflags="$c_flags$cflags" if ($c_flags ne ""); }
223 227
224$ex_libs="$l_flags$ex_libs" if ($l_flags ne ""); 228$ex_libs="$l_flags$ex_libs" if ($l_flags ne "");
225 229
@@ -273,6 +277,8 @@ LFLAGS=$lflags
273 277
274BN_ASM_OBJ=$bn_asm_obj 278BN_ASM_OBJ=$bn_asm_obj
275BN_ASM_SRC=$bn_asm_src 279BN_ASM_SRC=$bn_asm_src
280BNCO_ASM_OBJ=$bnco_asm_obj
281BNCO_ASM_SRC=$bnco_asm_src
276DES_ENC_OBJ=$des_enc_obj 282DES_ENC_OBJ=$des_enc_obj
277DES_ENC_SRC=$des_enc_src 283DES_ENC_SRC=$des_enc_src
278BF_ENC_OBJ=$bf_enc_obj 284BF_ENC_OBJ=$bf_enc_obj
@@ -379,6 +385,7 @@ $banner
379 \$(MKDIR) \$(INC_D) 385 \$(MKDIR) \$(INC_D)
380 386
381headers: \$(HEADER) \$(EXHEADER) 387headers: \$(HEADER) \$(EXHEADER)
388 @
382 389
383lib: \$(LIBS_DEP) 390lib: \$(LIBS_DEP)
384 391
@@ -539,6 +546,11 @@ foreach (values %lib_nam)
539 $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/; 546 $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/;
540 $rules.=&do_asm_rule($bn_asm_obj,$bn_asm_src); 547 $rules.=&do_asm_rule($bn_asm_obj,$bn_asm_src);
541 } 548 }
549 if (($bnco_asm_obj ne "") && ($_ eq "CRYPTO"))
550 {
551 $lib_obj .= "\$(BNCO_ASM_OBJ)";
552 $rules.=&do_asm_rule($bnco_asm_obj,$bnco_asm_src);
553 }
542 if (($des_enc_obj ne "") && ($_ eq "CRYPTO")) 554 if (($des_enc_obj ne "") && ($_ eq "CRYPTO"))
543 { 555 {
544 $lib_obj =~ s/\s\S*des_enc\S*/ \$(DES_ENC_OBJ)/; 556 $lib_obj =~ s/\s\S*des_enc\S*/ \$(DES_ENC_OBJ)/;
@@ -601,6 +613,14 @@ $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPT
601$rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); 613$rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)");
602 614
603print $defs; 615print $defs;
616
617if ($platform eq "linux-elf") {
618 print <<"EOF";
619# Generate perlasm output files
620%.cpp:
621 (cd \$(\@D)/..; PERL=perl make -f Makefile.ssl asm/\$(\@F))
622EOF
623}
604print "###################################################################\n"; 624print "###################################################################\n";
605print $rules; 625print $rules;
606 626
@@ -652,6 +672,7 @@ sub var_add
652 @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock; 672 @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock;
653 673
654 @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2; 674 @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2;
675 @a=grep(!/(^md4)|(_md4$)/,@a) if $no_md4;
655 @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5; 676 @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5;
656 @a=grep(!/(rmd)|(ripemd)/,@a) if $no_rmd160; 677 @a=grep(!/(rmd)|(ripemd)/,@a) if $no_rmd160;
657 678
@@ -717,6 +738,7 @@ sub do_defs
717 { $pf=".c"; } 738 { $pf=".c"; }
718 else { $pf=$postfix; } 739 else { $pf=$postfix; }
719 if ($_ =~ /BN_ASM/) { $t="$_ "; } 740 if ($_ =~ /BN_ASM/) { $t="$_ "; }
741 elsif ($_ =~ /BNCO_ASM/){ $t="$_ "; }
720 elsif ($_ =~ /DES_ENC/) { $t="$_ "; } 742 elsif ($_ =~ /DES_ENC/) { $t="$_ "; }
721 elsif ($_ =~ /BF_ENC/) { $t="$_ "; } 743 elsif ($_ =~ /BF_ENC/) { $t="$_ "; }
722 elsif ($_ =~ /CAST_ENC/){ $t="$_ "; } 744 elsif ($_ =~ /CAST_ENC/){ $t="$_ "; }
@@ -840,6 +862,7 @@ sub read_options
840 elsif (/^no-bf$/) { $no_bf=1; } 862 elsif (/^no-bf$/) { $no_bf=1; }
841 elsif (/^no-cast$/) { $no_cast=1; } 863 elsif (/^no-cast$/) { $no_cast=1; }
842 elsif (/^no-md2$/) { $no_md2=1; } 864 elsif (/^no-md2$/) { $no_md2=1; }
865 elsif (/^no-md4$/) { $no_md4=1; }
843 elsif (/^no-md5$/) { $no_md5=1; } 866 elsif (/^no-md5$/) { $no_md5=1; }
844 elsif (/^no-sha$/) { $no_sha=1; } 867 elsif (/^no-sha$/) { $no_sha=1; }
845 elsif (/^no-sha1$/) { $no_sha1=1; } 868 elsif (/^no-sha1$/) { $no_sha1=1; }
@@ -865,8 +888,10 @@ sub read_options
865 elsif (/^rsaref$/) { $rsaref=1; } 888 elsif (/^rsaref$/) { $rsaref=1; }
866 elsif (/^gcc$/) { $gcc=1; } 889 elsif (/^gcc$/) { $gcc=1; }
867 elsif (/^debug$/) { $debug=1; } 890 elsif (/^debug$/) { $debug=1; }
891 elsif (/^profile$/) { $profile=1; }
868 elsif (/^shlib$/) { $shlib=1; } 892 elsif (/^shlib$/) { $shlib=1; }
869 elsif (/^dll$/) { $shlib=1; } 893 elsif (/^dll$/) { $shlib=1; }
894 elsif (/^shared$/) { } # We just need to ignore it for now...
870 elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; } 895 elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; }
871 elsif (/^-[lL].*$/) { $l_flags.="$_ "; } 896 elsif (/^-[lL].*$/) { $l_flags.="$_ "; }
872 elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/) 897 elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/)