kumquat-buildroot/package/sunxi-mali/sunxi-mali.mk
Thomas Petazzoni 12d150727a Strip *.so* and not only executable files
Our current stripping strategy requires that shared libraries have the
executable permission. However, this is by far not something
recognized as a standard behavior: Debian/Ubuntu distributions for
example do not have executable permissions on their
libraries. Therefore, pushing to upstream packages fixes that add the
executable permissions is not easy.

As a result, this commit improves the stripping logic so that it not
only strips the files that are executable, but also the ones that
match '*.so*', which should match both the shared libraries and the
dlopen()'able plugins, as long as they have a .so extension.

Thanks to this addition, a number of manual "chmod +x" done by various
packages can be removed.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-04 18:10:15 +01:00

83 lines
2.6 KiB
Makefile

################################################################################
#
# sunxi-mali
#
################################################################################
SUNXI_MALI_VERSION = c2491fe952354ba44538064e534ed7c731cedb1e
SUNXI_MALI_SITE = $(call github,linux-sunxi,sunxi-mali,$(SUNXI_MALI_VERSION))
SUNXI_MALI_INSTALL_STAGING = YES
SUNXI_MALI_DEPENDENCIES = sunxi-mali-prop
# The options below must be provided in the environment. Providing these
# through options overrides the value and prevents the makefiles from
# appending to these variables. This is used throughout the sunxi-mali build
# system.
#
# Furthermore, the -lm -dl -lpthread options are included due to a possible bug
# in the way the linaro 2013.06 toolchain handles shared libraries.
SUNXI_MALI_MAKE_ENV = \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS) -lm -ldl -lpthread" \
$(TARGET_MAKE_ENV)
ifeq ($(BR2_ARM_EABIHF),y)
SUNXI_MALI_MAKE_OPTS += ABI=armhf
else
SUNXI_MALI_MAKE_OPTS += ABI=armel
endif
SUNXI_MALI_MAKE_OPTS += EGL_TYPE=framebuffer
ifeq ($(BR2_PACKAGE_SUNXI_MALI_R2P4),y)
SUNXI_MALI_MAKE_OPTS += VERSION=r2p4
endif
ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P0),y)
SUNXI_MALI_MAKE_OPTS += VERSION=r3p0
endif
ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P1),y)
SUNXI_MALI_MAKE_OPTS += VERSION=r3p1
endif
define SUNXI_MALI_GIT_SUBMODULE_FIXUP
rm -rf $(@D)/lib/mali
cp -rf $(SUNXI_MALI_PROP_SRCDIR) $(@D)/lib/mali
endef
SUNXI_MALI_PRE_CONFIGURE_HOOKS += SUNXI_MALI_GIT_SUBMODULE_FIXUP
define SUNXI_MALI_BUILD_CMDS
$(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) all
$(TARGET_CC) $(TARGET_CFLAGS) -o $(@D)/version/version \
$(@D)/version/version.c
endef
define SUNXI_MALI_INSTALL_STAGING_CMDS
$(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) \
$(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install
# test must be built after install because it depends on headers that are
# generated during the install above.
$(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) test
$(INSTALL) -D -m 0644 package/sunxi-mali/egl.pc \
$(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
$(INSTALL) -D -m 0644 package/sunxi-mali/glesv2.pc \
$(STAGING_DIR)/usr/lib/pkgconfig/glesv2.pc
endef
define SUNXI_MALI_INSTALL_TARGET_CMDS
$(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D)/lib \
$(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
$(if $(BR2_PACKAGE_SUNXI_MALI_DBG),
$(INSTALL) -m 755 $(@D)/version/version $(TARGET_DIR)/usr/bin/maliver; \
$(INSTALL) -m 755 $(@D)/test/test $(TARGET_DIR)/usr/bin/malitest
)
endef
define SUNXI_MALI_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/sunxi-mali/S80mali \
$(TARGET_DIR)/etc/init.d/S80mali
endef
$(eval $(generic-package))