1################################################################################
2#
3# sdl
4#
5################################################################################
6
7SDL_VERSION = 1.2.15
8SDL_SOURCE = SDL-$(SDL_VERSION).tar.gz
9SDL_SITE = http://www.libsdl.org/release
10SDL_LICENSE = LGPL-2.1+
11SDL_LICENSE_FILES = COPYING
12SDL_CPE_ID_VENDOR = libsdl
13SDL_CPE_ID_PRODUCT = simple_directmedia_layer
14SDL_INSTALL_STAGING = YES
15
16# 0003-SDL_x11yuv.c-fix-possible-use-after-free.patch
17SDL_IGNORE_CVES += CVE-2022-34568
18
19# we're patching configure.in, but package cannot autoreconf with our version of
20# autotools, so we have to do it manually instead of setting SDL_AUTORECONF = YES
21define SDL_RUN_AUTOGEN
22	cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
23endef
24
25SDL_PRE_CONFIGURE_HOOKS += SDL_RUN_AUTOGEN
26HOST_SDL_PRE_CONFIGURE_HOOKS += SDL_RUN_AUTOGEN
27
28SDL_DEPENDENCIES += host-automake host-autoconf host-libtool
29HOST_SDL_DEPENDENCIES += host-automake host-autoconf host-libtool
30
31SDL_CONF_OPTS += --enable-video-qtopia=no
32
33ifeq ($(BR2_PACKAGE_SDL_FBCON),y)
34SDL_CONF_OPTS += --enable-video-fbcon=yes
35else
36SDL_CONF_OPTS += --enable-video-fbcon=no
37endif
38
39ifeq ($(BR2_PACKAGE_SDL_DIRECTFB),y)
40SDL_DEPENDENCIES += directfb
41SDL_CONF_OPTS += --enable-video-directfb=yes
42SDL_CONF_ENV = ac_cv_path_DIRECTFBCONFIG=$(STAGING_DIR)/usr/bin/directfb-config
43else
44SDL_CONF_OPTS += --enable-video-directfb=no
45endif
46
47ifeq ($(BR2_PACKAGE_SDL_X11),y)
48SDL_CONF_OPTS += --enable-video-x11=yes
49SDL_DEPENDENCIES += \
50	xlib_libX11 xlib_libXext \
51	$(if $(BR2_PACKAGE_XLIB_LIBXRENDER), xlib_libXrender) \
52	$(if $(BR2_PACKAGE_XLIB_LIBXRANDR), xlib_libXrandr)
53else
54SDL_CONF_OPTS += --enable-video-x11=no
55endif
56
57ifneq ($(BR2_USE_MMU),y)
58SDL_CONF_OPTS += --enable-dga=no
59endif
60
61# overwrite autodection (prevents confusion with host libpth version)
62ifeq ($(BR2_PACKAGE_LIBPTHSEM_COMPAT),y)
63SDL_CONF_OPTS += --enable-pth
64SDL_CONF_ENV += ac_cv_path_PTH_CONFIG=$(STAGING_DIR)/usr/bin/pth-config
65SDL_DEPENDENCIES += libpthsem
66else
67SDL_CONF_OPTS += --disable-pth
68endif
69
70ifeq ($(BR2_PACKAGE_TSLIB),y)
71SDL_DEPENDENCIES += tslib
72endif
73
74ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
75SDL_DEPENDENCIES += alsa-lib
76endif
77
78ifeq ($(BR2_PACKAGE_MESA3D),y)
79SDL_DEPENDENCIES += mesa3d
80endif
81
82SDL_CONF_OPTS += \
83	--disable-rpath \
84	--enable-pulseaudio=no \
85	--disable-arts \
86	--disable-esd \
87	--disable-nasm \
88	--disable-video-ps3
89
90HOST_SDL_CONF_OPTS += \
91	--enable-pulseaudio=no \
92	--enable-video-x11=no \
93	--disable-arts \
94	--disable-esd \
95	--disable-nasm \
96	--disable-video-ps3
97
98SDL_CONFIG_SCRIPTS = sdl-config
99
100$(eval $(autotools-package))
101$(eval $(host-autotools-package))
102