diff options
author | Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com> | 2024-11-13 15:23:51 +0200 |
---|---|---|
committer | Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com> | 2024-11-13 15:25:42 +0200 |
commit | a42b8e241309a2c763a62aabaeec83925621335d (patch) | |
tree | 9913f2ffdfacea0b12c12182d1342e757e2b7ca7 /platform/linuxbsd/detect.py | |
parent | cb411fa960f0b7fdbd97dcdb4c90f9346360ee0e (diff) | |
download | redot-engine-a42b8e241309a2c763a62aabaeec83925621335d.tar.gz |
Buildsystem: Use pkg-config for miniupnpc and mbedtls
Miniupnpc added pkg-config files in 2.2.3 but we require 2.2.8
https://github.com/miniupnp/miniupnp/commit/5a398006b90e35942ffd8015a9f792df9ec97fd8
MbedTLS added pkg-config files in 3.6.0 while we require 3.6.1
https://github.com/Mbed-TLS/mbedtls/blob/development/ChangeLog
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Diffstat (limited to 'platform/linuxbsd/detect.py')
-rw-r--r-- | platform/linuxbsd/detect.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py index 2fd573da75..c8202b147d 100644 --- a/platform/linuxbsd/detect.py +++ b/platform/linuxbsd/detect.py @@ -279,16 +279,18 @@ def configure(env: "SConsEnvironment"): env.ParseConfig("pkg-config libwebp --cflags --libs") if not env["builtin_mbedtls"]: - # mbedTLS does not provide a pkgconfig config yet. See https://github.com/ARMmbed/mbedtls/issues/228 - env.Append(LIBS=["mbedtls", "mbedcrypto", "mbedx509"]) + # mbedTLS only provides a pkgconfig file since 3.6.0, but we still support 2.28.x, + # so fallback to manually specifying LIBS if it fails. + if os.system("pkg-config --exists mbedtls") == 0: # 0 means found + env.ParseConfig("pkg-config mbedtls mbedcrypto mbedx509 --cflags --libs") + else: + env.Append(LIBS=["mbedtls", "mbedcrypto", "mbedx509"]) if not env["builtin_wslay"]: env.ParseConfig("pkg-config libwslay --cflags --libs") if not env["builtin_miniupnpc"]: - # No pkgconfig file so far, hardcode default paths. - env.Prepend(CPPPATH=["/usr/include/miniupnpc"]) - env.Append(LIBS=["miniupnpc"]) + env.ParseConfig("pkg-config miniupnpc --cflags --libs") # On Linux wchar_t should be 32-bits # 16-bit library shouldn't be required due to compiler optimizations |