[Buildroot] [PATCH 3/8] package/sdl3: add ALSA and test program options, follow dbus
Alsey Coleman Miller <[email protected]>
| Newsgroups | net.busybox.buildroot |
|---|---|
| Message-ID | <[email protected]> |
SDL_ALSA had no option at all, so whether the ALSA audio driver was built depended on what SDL's own detection found in the sysroot when it happened to configure. Add BR2_PACKAGE_SDL3_ALSA and pass SDL_ALSA_SHARED=OFF with it, so libasound is linked rather than dlopen()ed - a dlopen leaves nothing in the ELF, and the library is then absent from the target unless something else pulls it in. SDL_DBUS was off unconditionally, which loses screensaver inhibition and the D-Bus parts of the Wayland backend; make it follow BR2_PACKAGE_DBUS. Add BR2_PACKAGE_SDL3_TESTS for the test programs, which are useful for checking the video and audio drivers on the target. Finally, name the backends that were left unset - OSS, JACK, sndio, PipeWire, RPI - and turn the examples off. SDL probes for each of these and builds against whatever it finds, so leaving them out makes the result depend on which unrelated packages are enabled. Signed-off-by: Alsey Coleman Miller <[email protected]> --- package/sdl3/Config.in | 15 +++++++++++++++ package/sdl3/sdl3.mk | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/package/sdl3/Config.in b/package/sdl3/Config.in index 7bce4ceaba..ed43879862 100644 --- a/package/sdl3/Config.in +++ b/package/sdl3/Config.in @@ -75,6 +75,21 @@ config BR2_PACKAGE_SDL3_OPENGLES comment "OpenGL ES support needs an OpenGL ES provider" depends on !BR2_PACKAGE_HAS_LIBGLES +config BR2_PACKAGE_SDL3_ALSA + bool "ALSA audio" + depends on BR2_PACKAGE_ALSA_LIB + help + Enable the ALSA audio driver. + +comment "ALSA audio needs alsa-lib" + depends on !BR2_PACKAGE_ALSA_LIB + +config BR2_PACKAGE_SDL3_TESTS + bool "build test programs" + help + Build and install the SDL3 test programs, which are useful + for checking the video and audio drivers on the target. + endif comment "sdl3 needs a toolchain w/ dynamic library, threads, wchar" diff --git a/package/sdl3/sdl3.mk b/package/sdl3/sdl3.mk index ecbcbf4bc2..7c92ee9bc8 100644 --- a/package/sdl3/sdl3.mk +++ b/package/sdl3/sdl3.mk @@ -13,23 +13,59 @@ SDL3_CPE_ID_VENDOR = libsdl SDL3_CPE_ID_PRODUCT = simple_directmedia_layer SDL3_INSTALL_STAGING = YES +SDL3_DEPENDENCIES = host-pkgconf + +# The audio and video backends this does not have a Buildroot option for are +# named explicitly rather than left out: SDL probes for each of them and +# builds against whatever it happens to find in the sysroot, so an unlisted +# backend makes the result depend on which other packages are enabled. SDL3_CONF_OPTS = \ - -DSDL_DBUS=OFF \ -DSDL_DUMMYVIDEO=OFF \ + -DSDL_EXAMPLES=OFF \ -DSDL_HIDAPI=OFF \ -DSDL_IBUS=OFF \ -DSDL_INSTALL_DOCS=OFF \ + -DSDL_JACK=OFF \ -DSDL_JOYSTICK_MFI=OFF \ -DSDL_JOYSTICK_VIRTUAL=OFF \ -DSDL_OFFSCREEN=OFF \ + -DSDL_OSS=OFF \ + -DSDL_PIPEWIRE=OFF \ -DSDL_PULSEAUDIO=OFF \ -DSDL_RENDER_D3D=OFF \ -DSDL_RPATH=OFF \ + -DSDL_RPI=OFF \ + -DSDL_SNDIO=OFF \ -DSDL_STATIC=ON \ -DSDL_UNIX_CONSOLE_BUILD=ON \ -DSDL_VIVANTE=OFF \ -DSDL_VULKAN=OFF +ifeq ($(BR2_PACKAGE_SDL3_ALSA),y) +SDL3_DEPENDENCIES += alsa-lib +# SDL_ALSA_SHARED makes SDL dlopen() libasound at runtime rather than link it, +# which leaves nothing in the ELF for Buildroot to see and the library absent +# from the target unless something else pulls it in. +SDL3_CONF_OPTS += -DSDL_ALSA=ON -DSDL_ALSA_SHARED=OFF +else +SDL3_CONF_OPTS += -DSDL_ALSA=OFF +endif + +# SDL uses D-Bus for screensaver inhibition and for parts of the Wayland +# backend, so it follows dbus rather than being off unconditionally. +ifeq ($(BR2_PACKAGE_DBUS),y) +SDL3_DEPENDENCIES += dbus +SDL3_CONF_OPTS += -DSDL_DBUS=ON +else +SDL3_CONF_OPTS += -DSDL_DBUS=OFF +endif + +ifeq ($(BR2_PACKAGE_SDL3_TESTS),y) +SDL3_CONF_OPTS += -DSDL_TESTS=ON +else +SDL3_CONF_OPTS += -DSDL_TESTS=OFF +endif + # SDL3 fails to build in Thumb mode on some ARM architectures ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y) SDL3_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -marm" -- 2.47.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot