kumquat-buildroot/package/prboom/prboom.mk
Giulio Benetti 801c83da19 package/prboom: work around gcc bug 85180
With Microblaze Gcc version < 8.x the build hangs due to gcc bug
85180: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. The bug
shows up when building prboom with optimization but not when building
with -O0. To work around this, if BR2_TOOLCHAIN_HAS_GCC_BUG_85180=y we
force using -O0.

Fixes:
http://autobuild.buildroot.net/results/e72/e72a2070ab7e9a093c3c70002ee94ee57a6154f6/

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-08-03 12:57:46 +02:00

58 lines
1.7 KiB
Makefile

################################################################################
#
# prboom
#
################################################################################
PRBOOM_VERSION = 2.5.0
PRBOOM_SITE = http://downloads.sourceforge.net/project/prboom/prboom%20stable/$(PRBOOM_VERSION)
PRBOOM_CONF_ENV = ac_cv_type_uid_t=yes
PRBOOM_DEPENDENCIES = sdl sdl_net sdl_mixer
PRBOOM_LICENSE = GPL-2.0+
PRBOOM_LICENSE_FILES = COPYING
PRBOOM_AUTORECONF = YES
PRBOOM_CFLAGS = $(TARGET_CFLAGS)
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
PRBOOM_CFLAGS += -O0
endif
PRBOOM_CONF_ENV += CFLAGS="$(PRBOOM_CFLAGS)"
ifeq ($(BR2_PACKAGE_LIBPNG),y)
PRBOOM_DEPENDENCIES += libpng
endif
ifeq ($(BR2_STATIC_LIBS),y)
# SDL_mixer uses symbols from SDL, but ends up after it on the link
# cmdline. Fix it by forcing the SDL libs at the very end
PRBOOM_CONF_ENV += LIBS="`$(STAGING_DIR)/usr/bin/sdl-config --static-libs`"
endif
PRBOOM_CONF_OPTS = \
--oldincludedir=$(STAGING_DIR)/usr/include \
--with-sdl-prefix=$(STAGING_DIR)/usr \
--with-sdl-exec-prefix=$(STAGING_DIR)/usr \
--disable-cpu-opt \
--disable-sdltest \
--disable-gl
# endianness detection isn't used when cross compiling
define PRBOOM_BIG_ENDIAN_FIXUP
$(SED) 's,.*#undef WORDS_BIGENDIAN.*,#define WORDS_BIGENDIAN 1,g' \
$(PRBOOM_DIR)/config.h
endef
ifeq ($(BR2_ENDIAN),"BIG")
PRBOOM_POST_CONFIGURE_HOOKS += PRBOOM_BIG_ENDIAN_FIXUP
endif
define PRBOOM_INSTALL_TARGET_CMDS
$(INSTALL) -D $(@D)/src/prboom $(TARGET_DIR)/usr/games/prboom
$(INSTALL) -D $(@D)/src/prboom-game-server $(TARGET_DIR)/usr/games/prboom-game-server
$(INSTALL) -D $(@D)/data/prboom.wad $(TARGET_DIR)/usr/share/games/doom/prboom.wad
endef
$(eval $(autotools-package))