Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: remove all USE_SDL compile flags — SDL3 always via dlopen

Removed all #ifdef USE_SDL guards, -DUSE_SDL, -lSDL3, SDL3/SDL.h
include. SDL3 code always compiles with void* types and dlsym
function pointers. No compile-time or link-time SDL dependency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+11 -34
+3 -8
fedac/native/Makefile
··· 47 47 LDFLAGS += $(AV_LIBS) 48 48 endif 49 49 50 - # SDL3 GPU-accelerated display (runtime dlopen — no link-time dep) 51 - # USE_SDL=1 enables compile-time support; SDL3 is loaded via dlopen at runtime. 52 - # Binary runs and falls back to DRM even without SDL3 libs installed. 53 - ifdef USE_SDL 54 - SDL_CFLAGS := $(shell pkg-config --cflags sdl3 2>/dev/null) 55 - CFLAGS += -DUSE_SDL $(SDL_CFLAGS) 56 - # No -lSDL3 — all symbols resolved via dlsym at runtime 57 - endif 50 + # SDL3 GPU-accelerated display: always compiled, loaded via dlopen at runtime. 51 + # Binary runs without SDL3 libs and falls back to DRM/fbdev. 52 + # No compile-time or link-time SDL dependency. 58 53 59 54 # Wayland display backend (for running under cage compositor: make USE_WAYLAND=1) 60 55 XDG_SHELL_XML := /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml
+1 -3
fedac/native/ac-os
··· 49 49 # Run make and capture exit code — version strings frozen at top of script 50 50 mkdir -p "${BUILD_DIR}" 51 51 local MAKE_LOG="${BUILD_DIR}/.make.log" 52 - local SDL_FLAG="" 53 - if [ "${USE_SDL:-}" = "1" ]; then SDL_FLAG="USE_SDL=1"; fi 54 - make -j$(nproc) CC="${CC_USE}" ${SDL_FLAG} BUILD_TS="${AC_BUILD_TS}" GIT_HASH="${AC_GIT_HASH}" BUILD_NAME="${AC_BUILD_NAME}" > "${MAKE_LOG}" 2>&1 52 + make -j$(nproc) CC="${CC_USE}" BUILD_TS="${AC_BUILD_TS}" GIT_HASH="${AC_GIT_HASH}" BUILD_NAME="${AC_BUILD_NAME}" > "${MAKE_LOG}" 2>&1 55 53 local MAKE_RC=$? 56 54 grep -E "Built:|error:" "${MAKE_LOG}" || true 57 55 if [ ${MAKE_RC} -ne 0 ]; then
+1 -3
fedac/native/docker-build.sh
··· 116 116 cd "$NATIVE" 117 117 fi 118 118 119 - SDL_FLAG="" 120 - if [ "${AC_BUILD_SDL:-1}" = "1" ]; then SDL_FLAG="USE_SDL=1"; fi 121 - make -j$(nproc) CC="${CC_USE}" BUILDDIR="$BUILD" ${SDL_FLAG} \ 119 + make -j$(nproc) CC="${CC_USE}" BUILDDIR="$BUILD" \ 122 120 BUILD_TS="$BUILD_TS" GIT_HASH="$GIT_HASH" BUILD_NAME="$BUILD_NAME" \ 123 121 > "$BUILD/.make.log" 2>&1 || true 124 122
-10
fedac/native/src/drm-display.c
··· 363 363 ACDisplay *drm_init(void) { 364 364 extern void ac_log(const char *fmt, ...); 365 365 ac_log("[drm] drm_init() start\n"); 366 - #ifdef USE_SDL 367 366 ACDisplay *sdl = sdl_init(); 368 367 if (sdl) return sdl; 369 368 ac_log("[drm] SDL3 failed, falling back to DRM dumb buffers\n"); 370 - #endif 371 369 372 370 ACDisplay *d = calloc(1, sizeof(ACDisplay)); 373 371 if (!d) { ac_log("[drm] calloc failed\n"); return NULL; } ··· 568 566 void display_present(ACDisplay *d, ACFramebuffer *screen, int scale) { 569 567 if (!d || !screen) return; 570 568 571 - #ifdef USE_SDL 572 569 if (d->is_sdl && sdl.CreateTexture) { 573 570 // Create/recreate texture if framebuffer size changed 574 571 if (!d->sdl_texture || d->sdl_tex_w != screen->width || d->sdl_tex_h != screen->height) { ··· 591 588 if (sdl.RenderPresent) sdl.RenderPresent(d->sdl_renderer); 592 589 return; 593 590 } 594 - #endif 595 591 (void)scale; 596 592 // CPU fallback: scale to back buffer and flip 597 593 fb_copy_scaled(screen, drm_back_buffer(d), ··· 605 601 606 602 ACSecondaryDisplay *drm_init_secondary(ACDisplay *primary) { 607 603 if (!primary || primary->is_fbdev || primary->fd < 0) return NULL; 608 - #ifdef USE_SDL 609 604 if (primary->is_sdl) return NULL; 610 - #endif 611 605 612 606 drmModeRes *res = drmModeGetResources(primary->fd); 613 607 if (!res) return NULL; ··· 870 864 871 865 const char *drm_display_driver(ACDisplay *d) { 872 866 if (!d) return "none"; 873 - #ifdef USE_SDL 874 867 if (d->is_sdl) { 875 868 static char buf[48]; 876 869 snprintf(buf, sizeof(buf), "sdl3:%s", d->sdl_renderer_name); 877 870 return buf; 878 871 } 879 - #endif 880 872 if (d->is_fbdev) return "fbdev"; 881 873 return "drm"; 882 874 } ··· 884 876 void drm_destroy(ACDisplay *d) { 885 877 if (!d) return; 886 878 887 - #ifdef USE_SDL 888 879 if (d->is_sdl) { 889 880 if (d->sdl_texture && sdl.DestroyTexture) sdl.DestroyTexture(d->sdl_texture); 890 881 if (d->sdl_renderer && sdl.DestroyRenderer) sdl.DestroyRenderer(d->sdl_renderer); ··· 893 884 free(d); 894 885 return; 895 886 } 896 - #endif 897 887 898 888 if (d->is_fbdev) { 899 889 // Restore console text mode
+5 -9
fedac/native/src/drm-display.h
··· 7 7 #include "framebuffer.h" 8 8 #include "graph.h" 9 9 10 - #ifdef USE_SDL 11 - #include <SDL3/SDL.h> 12 - #endif 10 + // SDL3 loaded via dlopen at runtime — no header dependency 13 11 14 12 typedef struct { 15 13 int fd; // DRM or fbdev device fd ··· 39 37 int fbdev_stride; // fbdev line length in pixels 40 38 int fbdev_swap_rb; // 1 if need to swap R and B channels (BGR format) 41 39 42 - // SDL3 GPU-accelerated display 43 - #ifdef USE_SDL 40 + // SDL3 GPU-accelerated display (loaded via dlopen — void* to avoid header dep) 44 41 int is_sdl; // 1 if using SDL3 backend 45 - SDL_Window *sdl_window; 46 - SDL_Renderer *sdl_renderer; 47 - SDL_Texture *sdl_texture; 42 + void *sdl_window; 43 + void *sdl_renderer; 44 + void *sdl_texture; 48 45 int sdl_tex_w, sdl_tex_h; // texture dimensions (matches small framebuffer) 49 46 char sdl_renderer_name[32]; // renderer driver name (e.g. "opengl", "vulkan") 50 - #endif 51 47 } ACDisplay; 52 48 53 49 // Get display driver name ("sdl3:opengl", "drm", "fbdev", "wayland")
+1 -1
oven/native-builder.mjs
··· 464 464 addLogLine(job, "stdout", "Phase 2: Compiling C kernel in Docker..."); 465 465 const cidFile = `/tmp/oven-cid-${job.id}`; 466 466 await runPhase(job, "build", "bash", ["-c", [ 467 - `CID=$(docker create -e AC_BUILD_NAME=${buildName} -e AC_BUILD_SDL=1 -v ac-os-ccache:/ccache ac-os-builder)`, 467 + `CID=$(docker create -e AC_BUILD_NAME=${buildName} -v ac-os-ccache:/ccache ac-os-builder)`, 468 468 `echo $CID > ${cidFile}`, 469 469 `docker start -a $CID`, 470 470 ].join(" && ")], repoDir);