05d9a547015273c35b2c94f6c27d2f446639a6fc
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / sdl / sdl.mk
1 ################################################################################
2 #
3 # sdl
4 #
5 ################################################################################
6
7 SDL_VERSION = 1.2.15
8 SDL_SOURCE = SDL-$(SDL_VERSION).tar.gz
9 SDL_SITE = http://www.libsdl.org/release
10 SDL_LICENSE = LGPLv2.1+
11 SDL_LICENSE_FILES = COPYING
12 SDL_INSTALL_STAGING = YES
13
14 # we're patching configure.in, but package cannot autoreconf with our version of
15 # autotools, so we have to do it manually instead of setting SDL_AUTORECONF = YES
16 define SDL_RUN_AUTOGEN
17         cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
18 endef
19
20 SDL_PRE_CONFIGURE_HOOKS += SDL_RUN_AUTOGEN
21 HOST_SDL_PRE_CONFIGURE_HOOKS += SDL_RUN_AUTOGEN
22
23 SDL_DEPENDENCIES += host-automake host-autoconf host-libtool
24 HOST_SDL_DEPENDENCIES += host-automake host-autoconf host-libtool
25
26 ifeq ($(BR2_PACKAGE_SDL_FBCON),y)
27 SDL_CONF_OPTS += --enable-video-fbcon=yes
28 else
29 SDL_CONF_OPTS += --enable-video-fbcon=no
30 endif
31
32 ifeq ($(BR2_PACKAGE_SDL_DIRECTFB),y)
33 SDL_DEPENDENCIES += directfb
34 SDL_CONF_OPTS += --enable-video-directfb=yes
35 SDL_CONF_ENV = ac_cv_path_DIRECTFBCONFIG=$(STAGING_DIR)/usr/bin/directfb-config
36 else
37 SDL_CONF_OPTS = --enable-video-directfb=no
38 endif
39
40 ifeq ($(BR2_PACKAGE_SDL_QTOPIA),y)
41 SDL_CONF_OPTS += --enable-video-qtopia=yes
42 SDL_DEPENDENCIES += qt
43 else
44 SDL_CONF_OPTS += --enable-video-qtopia=no
45 endif
46
47 ifeq ($(BR2_PACKAGE_SDL_X11),y)
48 SDL_CONF_OPTS += --enable-video-x11=yes
49 SDL_DEPENDENCIES += \
50         xlib_libX11 xlib_libXext \
51         $(if $(BR2_PACKAGE_XLIB_LIBXRENDER), xlib_libXrender) \
52         $(if $(BR2_PACKAGE_XLIB_LIBXRANDR), xlib_libXrandr)
53 else
54 SDL_CONF_OPTS += --enable-video-x11=no
55 endif
56
57 ifneq ($(BR2_USE_MMU),y)
58 SDL_CONF_OPTS += --enable-dga=no
59 endif
60
61 ifeq ($(BR2_PACKAGE_TSLIB),y)
62 SDL_DEPENDENCIES += tslib
63 endif
64
65 ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
66 SDL_DEPENDENCIES += alsa-lib
67 endif
68
69 ifeq ($(BR2_PACKAGE_MESA3D),y)
70 SDL_DEPENDENCIES += mesa3d
71 endif
72
73 SDL_CONF_OPTS += \
74         --enable-pulseaudio=no \
75         --disable-arts \
76         --disable-esd \
77         --disable-nasm \
78         --disable-video-ps3
79
80 HOST_SDL_CONF_OPTS += \
81         --enable-pulseaudio=no \
82         --enable-video-x11=no \
83         --disable-arts \
84         --disable-esd \
85         --disable-nasm \
86         --disable-video-ps3
87
88 SDL_CONFIG_SCRIPTS = sdl-config
89
90 # Remove the -Wl,-rpath option.
91 define SDL_FIXUP_SDL_CONFIG
92         $(SED) 's%-Wl,-rpath,\$${libdir}%%' \
93                 $(STAGING_DIR)/usr/bin/sdl-config
94 endef
95
96 SDL_POST_INSTALL_STAGING_HOOKS += SDL_FIXUP_SDL_CONFIG
97
98 $(eval $(autotools-package))
99 $(eval $(host-autotools-package))