X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=util%2Fmk1mf.pl;h=97f79c5e75c49ed0c7be19aec6a67c0d7648d764;hb=3bd1690bfb59b014fafa93b22e737e50c7db4b5b;hp=a6fd27509e96b7a92d54204f51cccef2dec83f94;hpb=5f649d583c071d3271990b348063023c99629b02;p=oweals%2Fopenssl.git diff --git a/util/mk1mf.pl b/util/mk1mf.pl index a6fd27509e..97f79c5e75 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -12,6 +12,8 @@ $banner="\t\@echo Building OpenSSL"; my $no_static_engine = 0; my $engines = ""; +local $zlib_opt = 0; # 0 = no zlib, 1 = static, 2 = dynamic +local $zlib_lib = ""; open(IN," " -DOPENSSL_BUILD_SHLIBSSL", "CRYPTO" => " -DOPENSSL_BUILD_SHLIBCRYPTO"); @@ -284,8 +293,14 @@ for (;;) if ($key eq "KRB5_INCLUDES") { $cflags .= " $val";} + if ($key eq "ZLIB_INCLUDE") + { $cflags .= " $val" if $val ne "";} + + if ($key eq "LIBZLIB") + { $zlib_lib = "$val" if $val ne "";} + if ($key eq "LIBKRB5") - { $ex_libs .= " $val";} + { $ex_libs .= " $val" if $val ne "";} if ($key eq "TEST") { $test.=&var_add($dir,$val, 0); } @@ -326,8 +341,8 @@ EOF if ($no_static_engine) { $extra_install .= <<"EOF" - \$(MKDIR) \$(INSTALLTOP)${o}engines - \$(CP) \$(E_SHLIB) \$(INSTALLTOP)${o}engines + \$(MKDIR) \$(INSTALLTOP)${o}lib${o}engines + \$(CP) \$(E_SHLIB) \$(INSTALLTOP)${o}lib${o}engines EOF } } @@ -337,6 +352,7 @@ else \$(CP) \$(O_SSL) \$(INSTALLTOP)${o}lib \$(CP) \$(O_CRYPTO) \$(INSTALLTOP)${o}lib EOF + $ex_libs .= " $zlib_lib" if $zlib_opt == 1; } $defs= <<"EOF"; @@ -380,6 +396,8 @@ LINK=$link LFLAGS=$lflags RSC=$rsc +AES_ASM_OBJ=$aes_asm_obj +AES_ASM_SRC=$aes_asm_src BN_ASM_OBJ=$bn_asm_obj BN_ASM_SRC=$bn_asm_src BNCO_ASM_OBJ=$bnco_asm_obj @@ -400,6 +418,8 @@ SHA1_ASM_OBJ=$sha1_asm_obj SHA1_ASM_SRC=$sha1_asm_src RMD160_ASM_OBJ=$rmd160_asm_obj RMD160_ASM_SRC=$rmd160_asm_src +CPUID_ASM_OBJ=$cpuid_asm_obj +CPUID_ASM_SRC=$cpuid_asm_src # The output directory for everything intersting OUT_D=$out_dir @@ -507,6 +527,11 @@ install: all \$(CP) apps${o}openssl.cnf \$(INSTALLTOP) $extra_install + +test: \$(T_EXE) + cd \$(BIN_D) + ..${o}ms${o}test + clean: \$(RM) \$(TMP_D)$o*.* @@ -586,7 +611,12 @@ foreach (values %lib_nam) $rules.="\$(O_SSL):\n\n"; next; } - + if (($aes_asm_obj ne "") && ($_ eq "CRYPTO")) + { + $lib_obj =~ s/\s(\S*\/aes_core\S*)/ \$(AES_ASM_OBJ)/; + $lib_obj =~ s/\s\S*\/aes_cbc\S*//; + $rules.=&do_asm_rule($aes_asm_obj,$aes_asm_src); + } if (($bn_asm_obj ne "") && ($_ eq "CRYPTO")) { $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/; @@ -638,6 +668,11 @@ foreach (values %lib_nam) $lib_obj =~ s/\s(\S*\/rmd_dgst\S*)/ $1 \$(RMD160_ASM_OBJ)/; $rules.=&do_asm_rule($rmd160_asm_obj,$rmd160_asm_src); } + if (($cpuid_asm_obj ne "") && ($_ eq "CRYPTO")) + { + $lib_obj =~ s/\s(\S*\/cversion\S*)/ $1 \$(CPUID_ASM_OBJ)/; + $rules.=&do_asm_rule($cpuid_asm_obj,$cpuid_asm_src); + } $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj); $lib=($slib)?" \$(SHLIB_CFLAGS)".$shlib_ex_cflags{$_}:" \$(LIB_CFLAGS)"; $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib); @@ -703,6 +738,8 @@ sub var_add return("") if $no_hw && $dir =~ /\/hw/; return("") if $no_idea && $dir =~ /\/idea/; return("") if $no_aes && $dir =~ /\/aes/; + return("") if $no_camellia && $dir =~ /\/camellia/; + return("") if $no_seed && $dir =~ /\/seed/; return("") if $no_rc2 && $dir =~ /\/rc2/; return("") if $no_rc4 && $dir =~ /\/rc4/; return("") if $no_rc5 && $dir =~ /\/rc5/; @@ -736,6 +773,8 @@ sub var_add @a=grep(!/^e_.*_bf$/,@a) if $no_bf; @a=grep(!/^e_.*_c$/,@a) if $no_cast; @a=grep(!/^e_rc4$/,@a) if $no_rc4; + @a=grep(!/^e_camellia$/,@a) if $no_camellia; + @a=grep(!/^e_seed$/,@a) if $no_seed; @a=grep(!/(^s2_)|(^s23_)/,@a) if $no_ssl2; @a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3; @@ -819,14 +858,16 @@ sub do_defs elsif ($_ =~ /RC5_ENC/) { $t="$_ "; } elsif ($_ =~ /MD5_ASM/) { $t="$_ "; } elsif ($_ =~ /SHA1_ASM/){ $t="$_ "; } + elsif ($_ =~ /AES_ASM/){ $t="$_ "; } elsif ($_ =~ /RMD160_ASM/){ $t="$_ "; } + elsif ($_ =~ /CPUID_ASM/){ $t="$_ "; } else { $t="$location${o}$_$pf "; } $Vars{$var}.="$t "; $ret.=$t; } # hack to add version info on MSVC - if ($shlib && ($platform eq "VC-WIN32") || ($platform eq "VC-NT")) + if ($shlib && (($platform eq "VC-WIN32") || ($platform eq "VC-NT"))) { if ($var eq "CRYPTOOBJ") { $ret.="\$(OBJ_D)\\\$(CRYPTO).res "; } @@ -946,6 +987,8 @@ sub read_options "no-rc5" => \$no_rc5, "no-idea" => \$no_idea, "no-aes" => \$no_aes, + "no-camellia" => \$no_camellia, + "no-seed" => \$no_seed, "no-des" => \$no_des, "no-bf" => \$no_bf, "no-cast" => \$no_cast, @@ -962,7 +1005,6 @@ sub read_options "no-dsa" => \$no_dsa, "no-dh" => \$no_dh, "no-hmac" => \$no_hmac, - "no-aes" => \$no_aes, "no-asm" => \$no_asm, "nasm" => \$nasm, "nw-nasm" => \$nw_nasm, @@ -970,6 +1012,7 @@ sub read_options "gaswin" => \$gaswin, "no-ssl2" => \$no_ssl2, "no-ssl3" => \$no_ssl3, + "no-tlsext" => \$no_tlsext, "no-err" => \$no_err, "no-sock" => \$no_sock, "no-krb5" => \$no_krb5, @@ -982,7 +1025,7 @@ sub read_options [\$no_rc2, \$no_idea, \$no_des, \$no_bf, \$no_cast, \$no_md2, \$no_sha, \$no_mdc2, \$no_dsa, \$no_dh, \$no_ssl2, \$no_err, \$no_ripemd, \$no_rc5, - \$no_aes], + \$no_aes, \$no_camellia, \$no_seed], "rsaref" => 0, "gcc" => \$gcc, "debug" => \$debug, @@ -991,6 +1034,7 @@ sub read_options "dll" => \$shlib, "shared" => 0, "no-gmp" => 0, + "no-rfc3779" => 0, "no-shared" => 0, "no-zlib" => 0, "no-zlib-dynamic" => 0, @@ -1011,10 +1055,10 @@ sub read_options } } elsif (/^no-comp$/) { $xcflags = "-DOPENSSL_NO_COMP $xcflags"; } - elsif (/^enable-zlib$/) { $xcflags = "-DZLIB $xcflags"; } + elsif (/^enable-zlib$/) { $zlib_opt = 1 if $zlib_opt == 0 } elsif (/^enable-zlib-dynamic$/) { - $xcflags = "-DZLIB_SHARED -DZLIB $xcflags"; + $zlib_opt = 2; } elsif (/^no-static-engine/) {