initial mk1mf cross compilation support

This commit is contained in:
Dr. Stephen Henson
2012-05-16 18:56:33 +00:00
parent d8e5830423
commit 455ecb3a06
3 changed files with 37 additions and 5 deletions

10
CHANGES
View File

@@ -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]

View File

@@ -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");

View File

@@ -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"};
}