[yocto] [meta-mingw][sumo][PATCH 1/1] openssl: build for mingw

Juro Bystricky juro.bystricky at intel.com
Wed Jul 11 15:42:41 PDT 2018


Build openssl.exe and several .dll files needed to run openssl
under Windows

Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
---
 .../openssl/openssl/mingw-targets.patch               | 13 +++++++++++++
 recipes-connectivity/openssl/openssl_1.0.2o.bbappend  | 19 +++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 recipes-connectivity/openssl/openssl/mingw-targets.patch
 create mode 100644 recipes-connectivity/openssl/openssl_1.0.2o.bbappend

diff --git a/recipes-connectivity/openssl/openssl/mingw-targets.patch b/recipes-connectivity/openssl/openssl/mingw-targets.patch
new file mode 100644
index 0000000..a9d98db
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl/mingw-targets.patch
@@ -0,0 +1,13 @@
+--- a/Configure
++++ b/Configure
+@@ -672,6 +668,10 @@ my %table=(
+ 
+ # MinGW
+ "mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
++"mingw32-x86_64","gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",
++"i686-pokysdk-mingw32", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
++"mingw32-i686", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i686 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
++
+ # As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll
+ # compiled with one compiler with application compiled with another
+ # compiler. It's possible to engage Applink support in mingw64 build,
diff --git a/recipes-connectivity/openssl/openssl_1.0.2o.bbappend b/recipes-connectivity/openssl/openssl_1.0.2o.bbappend
new file mode 100644
index 0000000..0e4485c
--- /dev/null
+++ b/recipes-connectivity/openssl/openssl_1.0.2o.bbappend
@@ -0,0 +1,19 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append_mingw32 = " file://mingw-targets.patch"
+
+EXTRA_LIBS_mingw32 = "-lws2_32 -lgdi32 -lcrypt32 -lgcc"
+
+CFLAG_remove_mingw32 = " -DTERMIO"
+CFLAG_remove_mingw32 = " -DHAVE_CRYPTODEV"
+CFLAG_remove_mingw32 = " -Wa,--noexecstack"
+CFLAG_append_mingw32 = " -DNOCRYPT -mno-cygwin -DWIN32_LEAN_AND_MEAN" 
+
+do_compile_prepend_mingw32 () {
+	export EX_LIBS="${EXTRA_LIBS}"
+}
+
+do_install_prepend_mingw32 () {
+	export EX_LIBS="${EXTRA_LIBS}"
+}
+
-- 
2.7.4



More information about the yocto mailing list