New option no-ssl3-method which removes SSLv3_*method
[openssl.git] / util / mk1mf.pl
index 90ae84b2f6ec436dc7daa8a7c9844ed5a4007825..0fcadcbad8609eebedf519dc208c71873315be2d 100755 (executable)
@@ -66,8 +66,10 @@ my %mf_import = (
        CMLL_ENC       => \$mf_cm_asm,
        MODES_ASM_OBJ  => \$mf_modes_asm,
         ENGINES_ASM_OBJ=> \$mf_engines_asm,
+       PERLASM_SCHEME => \$mf_perlasm_scheme,
        FIPSCANISTERONLY  => \$mf_fipscanisteronly,
-       FIPSCANISTERINTERNAL  => \$mf_fipscanisterinternal
+       FIPSCANISTERINTERNAL  => \$mf_fipscanisterinternal,
+       EC_ASM         => \$mf_ec_asm,
 );
 
 open(IN,"<Makefile") || die "unable to open Makefile!\n";
@@ -455,6 +457,14 @@ for (;;)
        }
 close(IN);
 
+if ($orig_platform eq 'copy')
+       {
+       # Remove opensslconf.h so it doesn't get updated if we configure a
+       # different branch.
+       $exheader =~ s/[^ ]+\/opensslconf.h//;
+       $header =~ s/[^ ]+\/opensslconf.h//;
+       }
+
 if ($fips)
        {
 
@@ -609,6 +619,8 @@ EOF
        $ex_libs .= " $zlib_lib" if $zlib_opt == 1;
        }
 
+my $asm_def = $orig_platform eq 'copy' ? "" : "ASM=$bin_dir$asm";
+
 $defs= <<"EOF";
 # N.B. You MUST use -j on FreeBSD.
 # This makefile has been automatically generated from the OpenSSL distribution.
@@ -662,6 +674,7 @@ INC_D=$inc_dir
 INCO_D=$inc_dir${o}openssl
 
 PERL=$perl
+PERLASM_SCHEME=$mf_perlasm_scheme
 CP=$cp
 CP2=$cp2
 RM=$rm
@@ -669,7 +682,7 @@ RANLIB=$ranlib
 MKDIR=$mkdir
 MKLIB=$bin_dir$mklib
 MLFLAGS=$mlflags
-#ASM=$bin_dir$asm
+$asm_def
 
 # FIPS validated module and support file locations
 
@@ -756,6 +769,7 @@ $banner
 # This needs to be invoked once, when the makefile is first constructed, or
 # after cleaning.
 init: \$(TMP_D) \$(LIB_D) \$(INC_D) \$(INCO_D) \$(BIN_D) \$(TEST_D) headers
+       \$(PERL) \$(SRC_D)/util/copy-if-different.pl "\$(SRC_D)/crypto/opensslconf.h" "\$(INCO_D)/opensslconf.h"
 
 headers: \$(HEADER) \$(EXHEADER)
 
@@ -900,6 +914,7 @@ if ($orig_platform eq 'copy') {
        $lib_obj{CRYPTO} .= fix_asm($mf_engines_asm, 'engines');
        $lib_obj{CRYPTO} .= fix_asm($mf_rc4_asm, 'crypto/rc4');
        $lib_obj{CRYPTO} .= fix_asm($mf_modes_asm, 'crypto/modes');
+       $lib_obj{CRYPTO} .= fix_asm($mf_ec_asm, 'crypto/ec');
 }
 
 foreach (values %lib_nam)
@@ -907,12 +922,6 @@ foreach (values %lib_nam)
        $lib_obj=$lib_obj{$_};
        local($slib)=$shlib;
 
-       if (($_ eq "SSL") && $no_ssl2 && $no_ssl3)
-               {
-               $rules.="\$(O_SSL):\n\n"; 
-               next;
-               }
-
        $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);
@@ -1379,12 +1388,17 @@ sub do_copy_rule
        return($ret);
        }
 
+# Options picked up from the OPTIONS line in the top level Makefile
+# generated by Configure.
+
 sub read_options
        {
        # Many options are handled in a similar way. In particular
        # no-xxx sets zero or more scalars to 1.
-       # Process these using a hash containing the option name and
-       # reference to the scalars to set.
+       # Process these using the %valid_options hash containing the option
+       # name and reference to the scalars to set. In some cases the option
+       # needs no special handling and can be ignored: this is done by
+       # setting the value to 0.
 
        my %valid_options = (
                "no-rc2" => \$no_rc2,
@@ -1418,6 +1432,7 @@ sub read_options
                "gaswin" => \$gaswin,
                "no-ssl2" => \$no_ssl2,
                "no-ssl3" => \$no_ssl3,
+               "no-ssl3-method" => 0,
                "no-tlsext" => \$no_tlsext,
                "no-srp" => \$no_srp,
                "no-cms" => \$no_cms,
@@ -1446,6 +1461,7 @@ sub read_options
                "dll" => \$shlib,
                "shared" => 0,
                "no-sctp" => 0,
+               "no-srtp" => 0,
                "no-gmp" => 0,
                "no-rfc3779" => 0,
                "no-montasm" => 0,
@@ -1454,6 +1470,7 @@ sub read_options
                "no-zlib" => 0,
                "no-zlib-dynamic" => 0,
                "no-ssl-trace" => 0,
+               "no-unit-test" => 0,
                "fips" => \$fips,
                "fipscanisterbuild" => [\$fips, \$fipscanisterbuild],
                "fipscanisteronly" => [\$fips, \$fipscanisterbuild, \$fipscanisteronly],