2025-10-19 22:12 UTC+0200 Aleksander Czajczynski (hb fki.pl)

* contrib/hbssl/hbssl.h
  * contrib/hbssl/hbssl.hbm
  * contrib/hbssl/ssl.c
    ! HB_OPENSSL_HAS_APPLINK was never checked,
      defining HB_OPENSSL_NO_APPLINK didn't do anything

    * make current OpenSSL 3.6.0 build under fresh MSYS2
      shell. MSYS2 does not distribute applink.c, claiming
      MingGW C runtime is safe for operation without it.
      Have to define HB_OPENSSL_NO_APPLINK and additional
      workaround for lacking __int64 type when including
      ssl.h. If you need similar workround outside of
      MSYS2 shell, setenv: HB_USER_CFLAGS=-DHB_OPENSSL_MSYS

      packages needed: openssl-devel (for headers)
                       mingw-w64-x86_64-openssl (for libs)
                       mingw-w64-aarch64-openssl

  * contrib/hbssl/hbssl.hbc
    * using Clang or Zig compiler on Windows, build will
      now reference libssl and libcrypto instead of old
      ssleay32/libeay32 pair when linking.

  * config/win/zig.mk
    % unnecessary check
This commit is contained in:
Aleksander Czajczynski
2025-10-19 22:12:22 +02:00
parent aba6779100
commit d42d81d605
6 changed files with 49 additions and 6 deletions

View File

@@ -7,6 +7,33 @@
Entries may not always be in chronological/commit order. Entries may not always be in chronological/commit order.
See license at the end of file. */ See license at the end of file. */
2025-10-19 22:12 UTC+0200 Aleksander Czajczynski (hb fki.pl)
* contrib/hbssl/hbssl.h
* contrib/hbssl/hbssl.hbm
* contrib/hbssl/ssl.c
! HB_OPENSSL_HAS_APPLINK was never checked,
defining HB_OPENSSL_NO_APPLINK didn't do anything
* make current OpenSSL 3.6.0 build under fresh MSYS2
shell. MSYS2 does not distribute applink.c, claiming
MingGW C runtime is safe for operation without it.
Have to define HB_OPENSSL_NO_APPLINK and additional
workaround for lacking __int64 type when including
ssl.h. If you need similar workround outside of
MSYS2 shell, setenv: HB_USER_CFLAGS=-DHB_OPENSSL_MSYS
packages needed: openssl-devel (for headers)
mingw-w64-x86_64-openssl (for libs)
mingw-w64-aarch64-openssl
* contrib/hbssl/hbssl.hbc
* using Clang or Zig compiler on Windows, build will
now reference libssl and libcrypto instead of old
ssleay32/libeay32 pair when linking.
* config/win/zig.mk
% unnecessary check
2025-10-18 23:15 UTC+0200 Aleksander Czajczynski (hb fki.pl) 2025-10-18 23:15 UTC+0200 Aleksander Czajczynski (hb fki.pl)
+ config/bsd/zig-noauto.mk + config/bsd/zig-noauto.mk
+ config/bsd/zig.mk + config/bsd/zig.mk

View File

@@ -3,8 +3,6 @@ RCFLAGS := /I. /I$(HB_HOST_INC) /C 1252
RC_OUT := /FO$(subst x,x, ) RC_OUT := /FO$(subst x,x, )
RES_EXT := .res RES_EXT := .res
ifeq ($(HB_PLATFORM),win) IMPLIBFLAGS = -Wl,--out-implib,$(IMP_FILE)
IMPLIBFLAGS = -Wl,--out-implib,$(IMP_FILE)
endif
include $(TOP)$(ROOT)config/common/zig.mk include $(TOP)$(ROOT)config/common/zig.mk

View File

@@ -62,6 +62,18 @@
#endif #endif
#endif #endif
/* following can be defined if MSYS/MinGW64 toolchain complains about lacking
'__int64' type inside OpenSSL project headers, also applink.c is not
needed on MinGW C runtime - therefore applink.c is not distributed there */
#if defined( HB_OPENSSL_MSYS )
#ifdef __MINGW64__
#include <basetsd.h>
#endif
#if ! defined( HB_OPENSSL_NO_APPLINK )
#define HB_OPENSSL_NO_APPLINK
#endif
#endif
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include "hbssl.ch" #include "hbssl.ch"

View File

@@ -13,8 +13,10 @@ skip={dos}
{!HB_DYNBIND_OPENSSL&unix}libs=ssl crypto {!HB_DYNBIND_OPENSSL&unix}libs=ssl crypto
{!HB_DYNBIND_OPENSSL&os2}libs=libssl_s libcrypto_s {!HB_DYNBIND_OPENSSL&os2}libs=libssl_s libcrypto_s
{!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)&win&!allmingw}libs=ssleay32 libeay32 {!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)&win&!allmingw&!clang&!zig}libs=ssleay32 libeay32
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&win&!allmingw}libs=ssleay32 libeay32 {!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&win&!allmingw&!clang&!zig}libs=ssleay32 libeay32
{!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)&win&(clang|zig)}libs=ssl crypto
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&win&(clang|zig)}libs=ssl crypto
{!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=ssl crypto {!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=ssl crypto
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=ssl crypto {!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=ssl crypto
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&allwin}libs=crypt32 {!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&allwin}libs=crypt32

View File

@@ -31,6 +31,9 @@
# Patent expires in 2010/2011 # Patent expires in 2010/2011
-cflag=-DOPENSSL_NO_IDEA -cflag=-DOPENSSL_NO_IDEA
# MSYS2 lacks applink.c and __int64
{MSYSTEM}-cflag=-DHB_OPENSSL_MSYS
# to suppress Apple's deprecation warnings that apply to # to suppress Apple's deprecation warnings that apply to
# the complete OpenSSL API, starting with OS X Lion 10.7 # the complete OpenSSL API, starting with OS X Lion 10.7
-cflag={allgcc&darwin}-Wno-deprecated -cflag={allgcc&darwin}-Wno-deprecated

View File

@@ -82,6 +82,7 @@
#if ! defined( HB_OPENSSL_NO_APPLINK ) && \ #if ! defined( HB_OPENSSL_NO_APPLINK ) && \
defined( HB_OS_WIN ) && \ defined( HB_OS_WIN ) && \
defined( HB_CPU_X86 ) && \ defined( HB_CPU_X86 ) && \
! defined( HB_OPENSSL_STATIC ) && \
OPENSSL_VERSION_NUMBER >= 0x00908000L OPENSSL_VERSION_NUMBER >= 0x00908000L
/* Enable this to add support for various scenarios when /* Enable this to add support for various scenarios when
OpenSSL is build with OPENSSL_USE_APPLINK (the default). OpenSSL is build with OPENSSL_USE_APPLINK (the default).
@@ -93,7 +94,7 @@
/* NOTE: See: http://www.openssl.org/support/faq.html#PROG2 /* NOTE: See: http://www.openssl.org/support/faq.html#PROG2
Application must call SSL_init(), so that this module gets linked. Application must call SSL_init(), so that this module gets linked.
[vszakats] */ [vszakats] */
#if defined( HB_OS_WIN ) && ! defined( HB_OPENSSL_STATIC ) && OPENSSL_VERSION_NUMBER >= 0x00908000L #if defined( HB_OPENSSL_HAS_APPLINK )
/* Pull a stub that returns a table with some selected /* Pull a stub that returns a table with some selected
C RTL function pointers. When linking to OpenSSL shared C RTL function pointers. When linking to OpenSSL shared
libraries, the function OPENSSL_Applink() exported from libraries, the function OPENSSL_Applink() exported from