From: Dr. Stephen Henson Date: Wed, 16 May 2012 18:56:33 +0000 (+0000) Subject: initial mk1mf cross compilation support X-Git-Tag: OpenSSL-fips-2_0-pl1~30 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=455ecb3a0630dbe185aeaa0dd18686f5943aaee8;p=oweals%2Fopenssl.git initial mk1mf cross compilation support --- diff --git a/CHANGES b/CHANGES index 0e9afd12ed..3dd573b709 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,16 @@ Changes between 1.0.1 and 1.1.0 [xx XXX xxxx] + *) Add initial cross compilation support for Windows build. The following + environment variables should be set: + + FIPS_SHA1_PATH: path to fips_standalone_sha1 exectutable which will + be used explicitly and not built. + FIPS_SIG: similar to other builds: path to a "get signature" script + which is used to obtain the signature of the target instead of + executing it on the host. + [Steve Henson] + *) Add flag to EC_KEY to use cofactor ECDH if set. [Steve Henson] diff --git a/util/fipslink.pl b/util/fipslink.pl index 4f47efa39c..331c456878 100644 --- a/util/fipslink.pl +++ b/util/fipslink.pl @@ -27,6 +27,19 @@ if (exists $ENV{"PREMAIN_DSO_EXE"}) $fips_premain_dso = ""; } +my $fips_sig = $ENV{"FIPS_SIG"}; +if (defined $fips_sig) + { + if ($fips_premain_dso ne "") + { + $fips_premain_dso = "$fips_sig -dso"; + } + else + { + $fips_premain_dso = "$fips_sig -exe"; + } + } + check_hash($sha1_exe, "fips_premain.c"); check_hash($sha1_exe, "fipscanister.lib"); diff --git a/util/mk1mf.pl b/util/mk1mf.pl index af039c78ac..05ecd34e01 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -23,6 +23,7 @@ local $fips_canister_path = ""; my $fips_premain_dso_exe_path = ""; my $fips_premain_c_path = ""; my $fips_sha1_exe_path = ""; +my $fips_sha1_exe_build = 1; local $fipscanisterbuild = 0; @@ -500,8 +501,16 @@ if ($fips) { if ($fips_sha1_exe_path eq "") { - $fips_sha1_exe_path = - "\$(BIN_D)${o}fips_standalone_sha1$exep"; + $fips_sha1_exe_path = $ENV{"FIPS_SHA1_PATH"}; + if (defined $fips_sha1_exe_path) + { + $fips_sha1_exe_build = 0; + } + else + { + $fips_sha1_exe_path = + "\$(BIN_D)${o}fips_standalone_sha1$exep"; + } } } else @@ -959,16 +968,16 @@ if ($fips) # FIXME $rules.=&do_link_rule("\$(FIPS_SHA1_EXE)", "\$(OBJ_D)${o}fips_standalone_sha1$obj \$(OBJ_D)${o}sha1dgst$obj $sha1_asm_obj", - "","\$(EX_LIBS)", 1); + "","\$(EX_LIBS)", 1) if $fips_sha1_exe_build; } else { $rules.=&do_link_rule("\$(FIPS_SHA1_EXE)", "\$(OBJ_D)${o}fips_standalone_sha1$obj \$(O_FIPSCANISTER)", - "","", 1); + "","", 1) if $fips_sha1_exe_build; } - $rules.=&do_link_rule("\$(PREMAIN_DSO_EXE)","\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj \$(CRYPTOOBJ) \$(O_FIPSCANISTER)","","\$(EX_LIBS)", 1); + $rules.=&do_link_rule("\$(PREMAIN_DSO_EXE)","\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj \$(CRYPTOOBJ) \$(O_FIPSCANISTER)","","\$(EX_LIBS)", 1) unless defined $ENV{"FIPS_SIG"}; }