summaryrefslogtreecommitdiff
path: root/platform/linuxbsd/detect.py
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linuxbsd/detect.py')
-rw-r--r--platform/linuxbsd/detect.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index 92af7e2d75..844b15e9fb 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -4,6 +4,11 @@ import sys
from methods import get_compiler_version, using_gcc
from platform_methods import detect_arch
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from SCons import Environment
+
def is_active():
return True
@@ -55,7 +60,7 @@ def get_flags():
]
-def configure(env):
+def configure(env: "Environment"):
# Validate arch.
supported_arches = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64"]
if env["arch"] not in supported_arches:
@@ -179,13 +184,14 @@ def configure(env):
## Dependencies
if env["x11"]:
- env.ParseConfig("pkg-config x11 --cflags --libs")
- env.ParseConfig("pkg-config xcursor --cflags --libs")
- env.ParseConfig("pkg-config xinerama --cflags --libs")
- env.ParseConfig("pkg-config xext --cflags --libs")
- env.ParseConfig("pkg-config xrandr --cflags --libs")
- env.ParseConfig("pkg-config xrender --cflags --libs")
- env.ParseConfig("pkg-config xi --cflags --libs")
+ # Only cflags, we dlopen the libraries.
+ env.ParseConfig("pkg-config x11 --cflags")
+ env.ParseConfig("pkg-config xcursor --cflags")
+ env.ParseConfig("pkg-config xinerama --cflags")
+ env.ParseConfig("pkg-config xext --cflags")
+ env.ParseConfig("pkg-config xrandr --cflags")
+ env.ParseConfig("pkg-config xrender --cflags")
+ env.ParseConfig("pkg-config xi --cflags")
if env["touch"]:
env.Append(CPPDEFINES=["TOUCH_ENABLED"])
@@ -351,14 +357,16 @@ def configure(env):
if env["opengl3"]:
env.Append(CPPDEFINES=["GLES3_ENABLED"])
- env.ParseConfig("pkg-config gl --cflags --libs")
env.Append(LIBS=["pthread"])
if platform.system() == "Linux":
env.Append(LIBS=["dl"])
- if platform.system().find("BSD") >= 0:
+ if not env["execinfo"] and platform.libc_ver()[0] != "glibc":
+ # The default crash handler depends on glibc, so if the host uses
+ # a different libc (BSD libc, musl), fall back to libexecinfo.
+ print("Note: Using `execinfo=yes` for the crash handler as required on platforms where glibc is missing.")
env["execinfo"] = True
if env["execinfo"]: