1 ################################################################################
5 ################################################################################
7 SUNXI_MALI_VERSION = c2491fe952354ba44538064e534ed7c731cedb1e
8 SUNXI_MALI_SITE = $(call github,linux-sunxi,sunxi-mali,$(SUNXI_MALI_VERSION))
10 SUNXI_MALI_INSTALL_STAGING = YES
11 SUNXI_MALI_DEPENDENCIES = sunxi-mali-prop
12 SUNXI_MALI_PROVIDES = libegl libgles
14 # The options below must be provided in the environment. Providing these
15 # through options overrides the value and prevents the makefiles from
16 # appending to these variables. This is used throughout the sunxi-mali build
19 # Furthermore, the -lm -dl -lpthread options are included due to a possible bug
20 # in the way the linaro 2013.06 toolchain handles shared libraries.
21 SUNXI_MALI_MAKE_ENV = \
23 CFLAGS="$(TARGET_CFLAGS) -lm -ldl -lpthread" \
26 ifeq ($(BR2_ARM_EABIHF),y)
27 SUNXI_MALI_MAKE_OPTS += ABI=armhf
29 SUNXI_MALI_MAKE_OPTS += ABI=armel
32 SUNXI_MALI_MAKE_OPTS += EGL_TYPE=framebuffer
34 ifeq ($(BR2_PACKAGE_SUNXI_MALI_R2P4),y)
35 SUNXI_MALI_MAKE_OPTS += VERSION=r2p4
37 ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P0),y)
38 SUNXI_MALI_MAKE_OPTS += VERSION=r3p0
40 ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P1),y)
41 SUNXI_MALI_MAKE_OPTS += VERSION=r3p1
44 define SUNXI_MALI_GIT_SUBMODULE_FIXUP
46 cp -rf $(SUNXI_MALI_PROP_SRCDIR) $(@D)/lib/mali
49 SUNXI_MALI_PRE_CONFIGURE_HOOKS += SUNXI_MALI_GIT_SUBMODULE_FIXUP
51 define SUNXI_MALI_BUILD_CMDS
52 $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) all
53 $(TARGET_CC) $(TARGET_CFLAGS) -o $(@D)/version/version \
54 $(@D)/version/version.c
57 define SUNXI_MALI_INSTALL_STAGING_CMDS
58 $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) \
59 $(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install
60 # test must be built after install because it depends on headers that are
61 # generated during the install above.
62 $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) test
63 $(INSTALL) -D -m 0644 package/sunxi-mali/egl.pc \
64 $(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
65 $(INSTALL) -D -m 0644 package/sunxi-mali/glesv2.pc \
66 $(STAGING_DIR)/usr/lib/pkgconfig/glesv2.pc
69 define SUNXI_MALI_INSTALL_TARGET_CMDS
70 $(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D)/lib \
71 $(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
72 $(if $(BR2_PACKAGE_SUNXI_MALI_DBG),
73 $(INSTALL) -m 755 $(@D)/version/version $(TARGET_DIR)/usr/bin/maliver; \
74 $(INSTALL) -m 755 $(@D)/test/test $(TARGET_DIR)/usr/bin/malitest
78 define SUNXI_MALI_INSTALL_INIT_SYSV
79 $(INSTALL) -D -m 0755 package/sunxi-mali/S80mali \
80 $(TARGET_DIR)/etc/init.d/S80mali
83 $(eval $(generic-package))