1*4882a593Smuzhiyun################################################################################ 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# sdl2 4*4882a593Smuzhiyun# 5*4882a593Smuzhiyun################################################################################ 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunSDL2_VERSION = 2.0.22 8*4882a593SmuzhiyunSDL2_SOURCE = SDL2-$(SDL2_VERSION).tar.gz 9*4882a593SmuzhiyunSDL2_SITE = http://www.libsdl.org/release 10*4882a593SmuzhiyunSDL2_LICENSE = Zlib 11*4882a593SmuzhiyunSDL2_LICENSE_FILES = LICENSE.txt 12*4882a593SmuzhiyunSDL2_CPE_ID_VENDOR = libsdl 13*4882a593SmuzhiyunSDL2_CPE_ID_PRODUCT = simple_directmedia_layer 14*4882a593SmuzhiyunSDL2_INSTALL_STAGING = YES 15*4882a593SmuzhiyunSDL2_SUPPORTS_IN_SOURCE_BUILD = NO 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunSDL2_CONF_OPTS += \ 18*4882a593Smuzhiyun -DSDL_RPATH=OFF 19*4882a593Smuzhiyun -DSDL_ARTS=OFF 20*4882a593Smuzhiyun -DSDL_ESD=OFF 21*4882a593Smuzhiyun -DSDL_PULSEAUDIO=OFF 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun# We must enable static build to get compilation successful. 24*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_STATIC=ON 25*4882a593Smuzhiyun 26*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_HAS_UDEV),y) 27*4882a593SmuzhiyunSDL2_DEPENDENCIES += udev 28*4882a593Smuzhiyunendif 29*4882a593Smuzhiyun 30*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_SSE),y) 31*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_SSE=ON 32*4882a593Smuzhiyunelse 33*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_SSE=OFF 34*4882a593Smuzhiyunendif 35*4882a593Smuzhiyun 36*4882a593Smuzhiyunifeq ($(BR2_X86_CPU_HAS_3DNOW),y) 37*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_3DNOW=ON 38*4882a593Smuzhiyunelse 39*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_3DNOW=OFF 40*4882a593Smuzhiyunendif 41*4882a593Smuzhiyun 42*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SDL2_DIRECTFB),y) 43*4882a593SmuzhiyunSDL2_DEPENDENCIES += directfb 44*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_DIRECTFB=ON 45*4882a593Smuzhiyunelse 46*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_DIRECTFB=OFF 47*4882a593Smuzhiyunendif 48*4882a593Smuzhiyun 49*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SDL2_OPENGLES)$(BR2_PACKAGE_RPI_USERLAND),yy) 50*4882a593SmuzhiyunSDL2_DEPENDENCIES += rpi-userland 51*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_RPI=ON 52*4882a593Smuzhiyunelse 53*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_RPI=OFF 54*4882a593Smuzhiyunendif 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun# x-includes and x-libraries must be set for cross-compiling 57*4882a593Smuzhiyun# By default x_includes and x_libraries contains unsafe paths. 58*4882a593Smuzhiyun# (/usr/X11R6/include and /usr/X11R6/lib) 59*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SDL2_X11),y) 60*4882a593SmuzhiyunSDL2_DEPENDENCIES += xlib_libX11 xlib_libXext 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun# X11/extensions/shape.h is provided by libXext. 63*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11=ON 64*4882a593Smuzhiyun -DSDL_X11_XSHAPE=ON 65*4882a593Smuzhiyun 66*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_XLIB_LIBXCURSOR),y) 67*4882a593SmuzhiyunSDL2_DEPENDENCIES += xlib_libXcursor 68*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XCURSOR=ON 69*4882a593Smuzhiyunelse 70*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XCURSOR=OFF 71*4882a593Smuzhiyunendif 72*4882a593Smuzhiyun 73*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_XLIB_LIBXINERAMA),y) 74*4882a593SmuzhiyunSDL2_DEPENDENCIES += xlib_libXinerama 75*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XINERAMA=ON 76*4882a593Smuzhiyunelse 77*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XINERAMA=OFF 78*4882a593Smuzhiyunendif 79*4882a593Smuzhiyun 80*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_XLIB_LIBXI),y) 81*4882a593SmuzhiyunSDL2_DEPENDENCIES += xlib_libXi 82*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XINPUT=ON 83*4882a593Smuzhiyunelse 84*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XINPUT=OFF 85*4882a593Smuzhiyunendif 86*4882a593Smuzhiyun 87*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_XLIB_LIBXRANDR),y) 88*4882a593SmuzhiyunSDL2_DEPENDENCIES += xlib_libXrandr 89*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XRANDR=ON 90*4882a593Smuzhiyunelse 91*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XRANDR=OFF 92*4882a593Smuzhiyunendif 93*4882a593Smuzhiyun 94*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_XLIB_LIBXSCRNSAVER),y) 95*4882a593SmuzhiyunSDL2_DEPENDENCIES += xlib_libXScrnSaver 96*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XSCRNSAVER=ON 97*4882a593Smuzhiyunelse 98*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XSCRNSAVER=OFF 99*4882a593Smuzhiyunendif 100*4882a593Smuzhiyun 101*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_XLIB_LIBXXF86VM),y) 102*4882a593SmuzhiyunSDL2_DEPENDENCIES += xlib_libXxf86vm 103*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XVM=ON 104*4882a593Smuzhiyunelse 105*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11_XVM=OFF 106*4882a593Smuzhiyunendif 107*4882a593Smuzhiyun 108*4882a593Smuzhiyunelse 109*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_X11=OFF 110*4882a593SmuzhiyunSDL2_CONF_ENV += CFLAGS=" -DMESA_EGL_NO_X11_HEADERS " 111*4882a593Smuzhiyunendif 112*4882a593Smuzhiyun 113*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SDL2_OPENGL),y) 114*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_OPENGL=ON 115*4882a593SmuzhiyunSDL2_DEPENDENCIES += libgl 116*4882a593Smuzhiyunelse 117*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_OPENGL=OFF 118*4882a593Smuzhiyunendif 119*4882a593Smuzhiyun 120*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SDL2_OPENGLES),y) 121*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_OPENGLES=ON 122*4882a593SmuzhiyunSDL2_DEPENDENCIES += libgles 123*4882a593Smuzhiyunelse 124*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_OPENGLES=OFF 125*4882a593Smuzhiyunendif 126*4882a593Smuzhiyun 127*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ALSA_LIB),y) 128*4882a593SmuzhiyunSDL2_DEPENDENCIES += alsa-lib 129*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_ALSA=ON 130*4882a593Smuzhiyunelse 131*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_ALSA=OFF 132*4882a593Smuzhiyunendif 133*4882a593Smuzhiyun 134*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SDL2_KMSDRM),y) 135*4882a593SmuzhiyunSDL2_DEPENDENCIES += libdrm libgbm 136*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_KMSDRM=ON 137*4882a593Smuzhiyunelse 138*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_KMSDRM=OFF 139*4882a593Smuzhiyunendif 140*4882a593Smuzhiyun 141*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SDL2_WAYLAND),y) 142*4882a593SmuzhiyunSDL2_DEPENDENCIES += wayland 143*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_WAYLAND=ON 144*4882a593Smuzhiyunelse 145*4882a593SmuzhiyunSDL2_CONF_OPTS += -DSDL_WAYLAND=OFF 146*4882a593Smuzhiyunendif 147*4882a593Smuzhiyun 148*4882a593Smuzhiyun$(eval $(cmake-package)) 149