Improve the Windows OneCore target support. (Add targets for building libraries for...
authorMouriNaruto <Mouri_Naruto@outlook.com>
Sat, 11 May 2019 21:10:58 +0000 (05:10 +0800)
committerMatt Caswell <matt@openssl.org>
Mon, 10 Jun 2019 09:22:36 +0000 (10:22 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8917)

CHANGES
Configurations/10-main.conf
Configurations/50-win-onecore.conf
Configure
INSTALL
NOTES.WIN

diff --git a/CHANGES b/CHANGES
index 7151e2b..ef2a890 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,11 @@
 
  Changes between 1.1.1 and 3.0.0 [xx XXX xxxx]
 
+  *) Add target VC-WIN32-UWP, VC-WIN64A-UWP, VC-WIN32-ARM-UWP and
+     VC-WIN64-ARM-UWP in Windows OneCore target for making building libraries
+     for Windows Store apps easier. Also, the "no-uplink" option has been added.
+     [Kenji Mouri]
+
   *) Join the directories crypto/x509 and crypto/x509v3
      [Richard Levitte]
 
index 0cda720..52b23ce 100644 (file)
@@ -1273,7 +1273,7 @@ my %targets = (
     },
     "VC-WIN64I" => {
         inherit_from     => [ "VC-WIN64-common", asm("ia64_asm"),
-                              sub { $disabled{shared} ? () : "ia64_uplink" } ],
+                              sub { $disabled{uplink} ? () : "ia64_uplink" } ],
         AS               => "ias",
         ASFLAGS          => "-d debug",
         asoutflag        => "-o ",
@@ -1285,7 +1285,7 @@ my %targets = (
     },
     "VC-WIN64A" => {
         inherit_from     => [ "VC-WIN64-common", asm("x86_64_asm"),
-                              sub { $disabled{shared} ? () : "x86_64_uplink" } ],
+                              sub { $disabled{uplink} ? () : "x86_64_uplink" } ],
         AS               => sub { vc_win64a_info()->{AS} },
         ASFLAGS          => sub { vc_win64a_info()->{ASFLAGS} },
         asoutflag        => sub { vc_win64a_info()->{asoutflag} },
@@ -1298,7 +1298,7 @@ my %targets = (
     },
     "VC-WIN32" => {
         inherit_from     => [ "VC-noCE-common", asm("x86_asm"),
-                              sub { $disabled{shared} ? () : "uplink_common" } ],
+                              sub { $disabled{uplink} ? () : "uplink_common" } ],
         CFLAGS           => add("/WX"),
         AS               => sub { vc_win32_info()->{AS} },
         ASFLAGS          => sub { vc_win32_info()->{ASFLAGS} },
@@ -1382,7 +1382,7 @@ my %targets = (
     },
     "mingw" => {
         inherit_from     => [ "mingw-common", asm("x86_asm"),
-                              sub { $disabled{shared} ? () : "x86_uplink" } ],
+                              sub { $disabled{uplink} ? () : "x86_uplink" } ],
         CFLAGS           => add(picker(release => "-fomit-frame-pointer")),
         cflags           => "-m32",
         sys_id           => "MINGW32",
index 51cb381..2cc3928 100644 (file)
@@ -61,4 +61,53 @@ my %targets = (
         ex_libs         => "onecore.lib",
         multilib        => "-arm64",
     },
+
+    # Universal Windows Platform (UWP) App Support
+
+    # TODO
+    #
+    # The 'disable' attribute should have 'uplink'.
+    # however, these are checked in some 'inherit_from', which is processed
+    # very early, before the 'disable' attributes are seen.
+    # This is a problem that needs to be resolved in Configure first.
+    #
+    # But if you want to build library with Windows 10 Version 1809 SDK or
+    # earlier, the 'disable' attribute should also have 'asm'.
+
+    "VC-WIN32-UWP" => {
+        inherit_from    => [ "VC-WIN32-ONECORE" ],
+        lflags          => add("/APPCONTAINER"),
+        defines         => add("WINAPI_FAMILY=WINAPI_FAMILY_APP",
+                               "_WIN32_WINNT=0x0A00"),
+        dso_scheme      => "",
+        disable         => [ 'ui-console', 'stdio', 'async', 'uplink' ],
+        ex_libs         => "WindowsApp.lib",
+    },
+     "VC-WIN64A-UWP" => {
+        inherit_from    => [ "VC-WIN64A-ONECORE" ],
+        lflags          => add("/APPCONTAINER"),
+        defines         => add("WINAPI_FAMILY=WINAPI_FAMILY_APP",
+                               "_WIN32_WINNT=0x0A00"),
+        dso_scheme      => "",
+        disable         => [ 'ui-console', 'stdio', 'async', 'uplink' ],
+        ex_libs         => "WindowsApp.lib",
+    },
+    "VC-WIN32-ARM-UWP" => {
+        inherit_from    => [ "VC-WIN32-ARM" ],
+        lflags          => add("/APPCONTAINER"),
+        defines         => add("WINAPI_FAMILY=WINAPI_FAMILY_APP",
+                               "_WIN32_WINNT=0x0A00"),
+        dso_scheme      => "",
+        disable         => [ 'ui-console', 'stdio', 'async', 'uplink' ],
+        ex_libs         => "WindowsApp.lib",
+    },
+     "VC-WIN64-ARM-UWP" => {
+        inherit_from    => [ "VC-WIN64-ARM" ],
+        lflags          => add("/APPCONTAINER"),
+        defines         => add("WINAPI_FAMILY=WINAPI_FAMILY_APP",
+                               "_WIN32_WINNT=0x0A00"),
+        dso_scheme      => "",
+        disable         => [ 'ui-console', 'stdio', 'async', 'uplink' ],
+        ex_libs         => "WindowsApp.lib",
+    },
 );
index c216049..17de50e 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -64,6 +64,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lx
 # zlib-dynamic  Like "zlib", but the zlib library is expected to be a shared
 #               library and will be loaded in run-time by the OpenSSL library.
 # sctp          include SCTP support
+# no-uplink     Don't build support for UPLINK interface.
 # enable-weak-ssl-ciphers
 #               Enable weak ciphers that are disabled by default.
 # 386           generate 80386 code in assembly modules
@@ -412,6 +413,7 @@ my @disablables = (
     "ubsan",
     "ui-console",
     "unit-test",
+    "uplink",
     "whirlpool",
     "weak-ssl-ciphers",
     "zlib",
@@ -504,7 +506,7 @@ my @disable_cascades = (
     # which cannot be guaranteed if shared libraries aren't present.
     # (note that even with shared libraries, both the app and dynamic engines
     # must be linked with the same library)
-    "shared"            => [ "dynamic-engine" ],
+    "shared"            => [ "dynamic-engine", "uplink" ],
     # Other modules don't necessarily have to link with libcrypto, so shared
     # libraries do not have to be a condition to produce those.
 
diff --git a/INSTALL b/INSTALL
index e980f50..16de9b8 100644 (file)
--- a/INSTALL
+++ b/INSTALL
                    Enable additional unit test APIs. This should not typically
                    be used in production deployments.
 
+  no-uplink
+                   Don't build support for UPLINK interface.
+
   enable-weak-ssl-ciphers
                    Build support for SSL/TLS ciphers that are considered "weak"
                    (e.g. RC4 based ciphersuites).
index 4d39d06..0215733 100644 (file)
--- a/NOTES.WIN
+++ b/NOTES.WIN
  is, of course, to choose a different set of directories by using
  --prefix and --openssldir when configuring.
 
+
+ Special notes for Universal Windows Platform builds, a.k.a. VC-*-UWP
+ --------------------------------------------------------------------
+
+ - UWP targets only support building the static and dynamic libraries.
+
+ - The "no-uplink" must be given in the "Configure" script.
+
+ - You should define the platform type to "uwp" and the target arch via
+   "vcvarsall.bat" before you compile. For example, if you want to build
+   "arm64" builds, you should type "vcvarsall.bat x86_arm64 uwp".
+
  mingw and mingw64
  =================