summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-04-26 09:34:49 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-04-26 09:37:28 +0200
commit07ad0664204fbc965627ed5cba548e93e5af4be7 (patch)
treedd3b0176d7a7445dd69066f225b3b03c3180e409
parente35ce448532b16021717aa94f7d988e2581d8ad1 (diff)
Linux: Use pkg-config for alsa, libudev and GL too
It's not needed on most distros as those are found in standard lib and include paths, but on NixOS they're all in non-standard prefixes, so we need to rely on information provided by pkg-config. Fixes #59913. Co-authored-by: David Lewis <davidalewis00@gmail.com>
-rw-r--r--platform/linuxbsd/detect.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index 39f9b99108..2fba58fc53 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -319,20 +319,21 @@ def configure(env):
if os.system("pkg-config --exists alsa") == 0: # 0 means found
env["alsa"] = True
env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
+ env.ParseConfig("pkg-config alsa --cflags") # Only cflags, we dlopen the library.
else:
print("Warning: ALSA libraries not found. Disabling the ALSA audio driver.")
if env["pulseaudio"]:
if os.system("pkg-config --exists libpulse") == 0: # 0 means found
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED"])
- env.ParseConfig("pkg-config --cflags libpulse")
+ env.ParseConfig("pkg-config libpulse --cflags") # Only cflags, we dlopen the library.
else:
print("Warning: PulseAudio development libraries not found. Disabling the PulseAudio audio driver.")
if env["dbus"]:
if os.system("pkg-config --exists dbus-1") == 0: # 0 means found
env.Append(CPPDEFINES=["DBUS_ENABLED"])
- env.ParseConfig("pkg-config --cflags --libs dbus-1")
+ env.ParseConfig("pkg-config dbus-1 --cflags --libs")
else:
print("Warning: D-Bus development libraries not found. Disabling screensaver prevention.")
@@ -341,6 +342,7 @@ def configure(env):
if env["udev"]:
if os.system("pkg-config --exists libudev") == 0: # 0 means found
env.Append(CPPDEFINES=["UDEV_ENABLED"])
+ env.ParseConfig("pkg-config libudev --cflags") # Only cflags, we dlopen the library.
else:
print("Warning: libudev development libraries not found. Disabling controller hotplugging support.")
else:
@@ -366,11 +368,11 @@ def configure(env):
if not env["use_volk"]:
env.ParseConfig("pkg-config vulkan --cflags --libs")
if not env["builtin_glslang"]:
- # No pkgconfig file for glslang so far
+ # No pkgconfig file so far, hardcode expected lib name.
env.Append(LIBS=["glslang", "SPIRV"])
env.Append(CPPDEFINES=["GLES3_ENABLED"])
- env.Append(LIBS=["GL"])
+ env.ParseConfig("pkg-config gl --cflags --libs")
env.Append(LIBS=["pthread"])