mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-23 00:36:42 -10:00
RealtimeKit is a backend of every threaded Linux build: libdbus is loaded when first needed through gfx/common/dbus_runtime, which mirrors libdbus's public, ABI-stable structs and constants under names of its own, so no D-Bus headers or link dependency are needed and a system without the library runs as before. The rtkit helper loads it on its own thread, so neither the audio thread nor the main thread waits on the dynamic loader or the bus, and whichever thread loads first publishes the table without anyone waiting. HAVE_DBUS no longer gates the backend. The helper now tells apart what can happen: libdbus not available, no system bus, rtkit not running, rtkit refusing with its D-Bus error name, and each grant. samples/frontend/dbus_runtime checks the mirror's sizes, alignments, field offsets and constants against libdbus's own headers, and the no-pkg-config CI job runs it.
31 lines
1.0 KiB
Makefile
31 lines
1.0 KiB
Makefile
# gfx/common/dbus_runtime.h mirrors libdbus's public ABI under names of
|
|
# its own, so RetroArch can load libdbus at run time without its headers.
|
|
# This checks the mirror against the real headers: every struct the
|
|
# caller allocates matches in size, alignment and field offsets, and
|
|
# every constant matches. It needs the D-Bus development headers; give
|
|
# DBUS_CFLAGS when pkg-config is not there to find them.
|
|
#
|
|
# make check
|
|
# make check DBUS_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include"
|
|
|
|
TARGET := dbus_runtime_abi_test
|
|
CORE_DIR := ../../..
|
|
DBUS_CFLAGS ?= $(shell pkg-config --cflags dbus-1 2>/dev/null)
|
|
|
|
# gnu99: libdbus's own headers use static inline.
|
|
CFLAGS += -Wall -Wextra -std=gnu99 -pedantic -DHAVE_DYLIB \
|
|
-I$(CORE_DIR) -I$(CORE_DIR)/libretro-common/include $(DBUS_CFLAGS)
|
|
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): dbus_runtime_abi_test.c $(CORE_DIR)/gfx/common/dbus_runtime.h
|
|
$(CC) $(CFLAGS) -o $@ dbus_runtime_abi_test.c
|
|
|
|
check: $(TARGET)
|
|
./$(TARGET)
|
|
|
|
clean:
|
|
rm -f $(TARGET)
|
|
|
|
.PHONY: all check clean
|