]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/sdl2/sdl2.mk
sdl2: rpi video support needs OpenGL ES
[coffee/buildroot.git] / package / sdl2 / sdl2.mk
1 ################################################################################
2 #
3 # sdl2
4 #
5 ################################################################################
6
7 SDL2_VERSION = 2.0.7
8 SDL2_SOURCE = SDL2-$(SDL2_VERSION).tar.gz
9 SDL2_SITE = http://www.libsdl.org/release
10 SDL2_LICENSE = Zlib
11 SDL2_LICENSE_FILES = COPYING.txt
12 SDL2_INSTALL_STAGING = YES
13 SDL2_CONFIG_SCRIPTS = sdl2-config
14
15 SDL2_CONF_OPTS += \
16         --disable-rpath \
17         --disable-arts \
18         --disable-esd \
19         --disable-dbus \
20         --disable-pulseaudio \
21         --disable-video-wayland
22
23 # We must enable static build to get compilation successful.
24 SDL2_CONF_OPTS += --enable-static
25
26 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
27 SDL2_DEPENDENCIES += udev
28 SDL2_CONF_OPTS += --enable-libudev
29 else
30 SDL2_CONF_OPTS += --disable-libudev
31 endif
32
33 ifeq ($(BR2_PACKAGE_SDL2_DIRECTFB),y)
34 SDL2_DEPENDENCIES += directfb
35 SDL2_CONF_OPTS += --enable-video-directfb
36 SDL2_CONF_ENV = ac_cv_path_DIRECTFBCONFIG=$(STAGING_DIR)/usr/bin/directfb-config
37 else
38 SDL2_CONF_OPTS += --disable-video-directfb
39 endif
40
41 ifeq ($(BR2_PACKAGE_SDL2_OPENGLES)$(BR2_PACKAGE_RPI_USERLAND),yy)
42 SDL2_DEPENDENCIES += rpi-userland
43 SDL2_CONF_OPTS += --enable-video-rpi
44 else
45 SDL2_CONF_OPTS += --disable-video-rpi
46 endif
47
48 # x-includes and x-libraries must be set for cross-compiling
49 # By default x_includes and x_libraries contains unsafe paths.
50 # (/usr/X11R6/include and /usr/X11R6/lib)
51 ifeq ($(BR2_PACKAGE_SDL2_X11),y)
52 SDL2_DEPENDENCIES += xlib_libX11 xlib_libXext
53
54 # X11/extensions/shape.h is provided by libXext.
55 SDL2_CONF_OPTS += --enable-video-x11 \
56         --with-x=$(STAGING_DIR) \
57         --x-includes=$(STAGING_DIR)/usr/include \
58         --x-libraries=$(STAGING_DIR)/usr/lib \
59         --enable-video-x11-xshape
60
61 ifeq ($(BR2_PACKAGE_XLIB_LIBXCURSOR),y)
62 SDL2_DEPENDENCIES += xlib_libXcursor
63 SDL2_CONF_OPTS += --enable-video-x11-xcursor
64 else
65 SDL2_CONF_OPTS += --disable-video-x11-xcursor
66 endif
67
68 ifeq ($(BR2_PACKAGE_XLIB_LIBXINERAMA),y)
69 SDL2_DEPENDENCIES += xlib_libXinerama
70 SDL2_CONF_OPTS += --enable-video-x11-xinerama
71 else
72 SDL2_CONF_OPTS += --disable-video-x11-xinerama
73 endif
74
75 ifeq ($(BR2_PACKAGE_XLIB_LIBXI),y)
76 SDL2_DEPENDENCIES += xlib_libXi
77 SDL2_CONF_OPTS += --enable-video-x11-xinput
78 else
79 SDL2_CONF_OPTS += --disable-video-x11-xinput
80 endif
81
82 ifeq ($(BR2_PACKAGE_XLIB_LIBXRANDR),y)
83 SDL2_DEPENDENCIES += xlib_libXrandr
84 SDL2_CONF_OPTS += --enable-video-x11-xrandr
85 else
86 SDL2_CONF_OPTS += --disable-video-x11-xrandr
87 endif
88
89 ifeq ($(BR2_PACKAGE_XLIB_LIBXSCRNSAVER),y)
90 SDL2_DEPENDENCIES += xlib_libXScrnSaver
91 SDL2_CONF_OPTS += --enable-video-x11-scrnsaver
92 else
93 SDL2_CONF_OPTS += --disable-video-x11-scrnsaver
94 endif
95
96 ifeq ($(BR2_PACKAGE_XLIB_LIBXXF86VM),y)
97 SDL2_DEPENDENCIES += xlib_libXxf86vm
98 SDL2_CONF_OPTS += --enable-video-x11-vm
99 else
100 SDL2_CONF_OPTS += --disable-video-x11-vm
101 endif
102
103 else
104 SDL2_CONF_OPTS += --disable-video-x11 --without-x
105 endif
106
107 ifeq ($(BR2_PACKAGE_SDL2_OPENGL),y)
108 SDL2_CONF_OPTS += --enable-video-opengl
109 SDL2_DEPENDENCIES += libgl
110 else
111 SDL2_CONF_OPTS += --disable-video-opengl
112 endif
113
114 ifeq ($(BR2_PACKAGE_SDL2_OPENGLES),y)
115 SDL2_CONF_OPTS += --enable-video-opengles
116 SDL2_DEPENDENCIES += libgles
117 else
118 SDL2_CONF_OPTS += --disable-video-opengles
119 endif
120
121 ifeq ($(BR2_PACKAGE_TSLIB),y)
122 SDL2_DEPENDENCIES += tslib
123 SDL2_CONF_OPTS += --enable-input-tslib
124 else
125 SDL2_CONF_OPTS += --disable-input-tslib
126 endif
127
128 ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
129 SDL2_DEPENDENCIES += alsa-lib
130 SDL2_CONF_OPTS += --enable-alsa
131 else
132 SDL2_CONF_OPTS += --disable-alsa
133 endif
134
135 ifeq ($(BR2_PACKAGE_SDL2_KMSDRM),y)
136 SDL2_DEPENDENCIES += libdrm
137 SDL2_CONF_OPTS += --enable-video-kmsdrm
138 else
139 SDL2_CONF_OPTS += --disable-video-kmsdrm
140 endif
141
142 $(eval $(autotools-package))