File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -279,16 +279,18 @@ def configure(env: "SConsEnvironment"):
279279 env .ParseConfig ("pkg-config libwebp --cflags --libs" )
280280
281281 if not env ["builtin_mbedtls" ]:
282- # mbedTLS does not provide a pkgconfig config yet. See https://github.com/ARMmbed/mbedtls/issues/228
283- env .Append (LIBS = ["mbedtls" , "mbedcrypto" , "mbedx509" ])
282+ # mbedTLS only provides a pkgconfig file since 3.6.0, but we still support 2.28.x,
283+ # so fallback to manually specifying LIBS if it fails.
284+ if os .system ("pkg-config --exists mbedtls" ) == 0 : # 0 means found
285+ env .ParseConfig ("pkg-config mbedtls mbedcrypto mbedx509 --cflags --libs" )
286+ else :
287+ env .Append (LIBS = ["mbedtls" , "mbedcrypto" , "mbedx509" ])
284288
285289 if not env ["builtin_wslay" ]:
286290 env .ParseConfig ("pkg-config libwslay --cflags --libs" )
287291
288292 if not env ["builtin_miniupnpc" ]:
289- # No pkgconfig file so far, hardcode default paths.
290- env .Prepend (CPPPATH = ["/usr/include/miniupnpc" ])
291- env .Append (LIBS = ["miniupnpc" ])
293+ env .ParseConfig ("pkg-config miniupnpc --cflags --libs" )
292294
293295 # On Linux wchar_t should be 32-bits
294296 # 16-bit library shouldn't be required due to compiler optimizations
You can’t perform that action at this time.
0 commit comments