initial mk1mf cross compilation support
authorDr. Stephen Henson <steve@openssl.org>
Wed, 16 May 2012 18:56:33 +0000 (18:56 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 16 May 2012 18:56:33 +0000 (18:56 +0000)
CHANGES
util/fipslink.pl
util/mk1mf.pl

diff --git a/CHANGES b/CHANGES
index 0e9afd12ed643675191cad4fd1588eadf1479800..3dd573b7096276457456770befb5a67299edf476 100644 (file)
--- 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]
 
index 4f47efa39ce52c6753e8fea778ee19e61129c71c..331c4568788a4b2108384db76e5a6016546b1d91 100644 (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");
 
index af039c78ac0e558d26e76f9443b1b51bd2d30c9e..05ecd34e01111ab84862419612f4ada655c0ec84 100755 (executable)
@@ -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"};
        
        }