3d131cdd46d7186f0873dc04a41531ef1d222729
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / prboom / prboom.mk
1 ################################################################################
2 #
3 # prboom
4 #
5 ################################################################################
6
7 PRBOOM_VERSION = 2.5.0
8 PRBOOM_SITE = http://downloads.sourceforge.net/project/prboom/prboom%20stable/$(PRBOOM_VERSION)
9 PRBOOM_CONF_ENV = ac_cv_type_uid_t=yes
10 PRBOOM_DEPENDENCIES = sdl sdl_net sdl_mixer
11 PRBOOM_LICENSE = GPLv2+
12 PRBOOM_LICENSE_FILES = COPYING
13
14 ifeq ($(BR2_PACKAGE_LIBPNG),y)
15 PRBOOM_DEPENDENCIES += libpng
16 endif
17
18 ifeq ($(BR2_STATIC_LIBS),y)
19 # SDL_mixer uses symbols from SDL, but ends up after it on the link
20 # cmdline. Fix it by forcing the SDL libs at the very end
21 PRBOOM_CONF_ENV += LIBS="$(shell $(STAGING_DIR)/usr/bin/sdl-config --static-libs)"
22 endif
23
24 PRBOOM_CONF_OPTS = \
25         --oldincludedir=$(STAGING_DIR)/usr/include \
26         --with-sdl-prefix=$(STAGING_DIR)/usr \
27         --with-sdl-exec-prefix=$(STAGING_DIR)/usr \
28         --disable-cpu-opt \
29         --disable-sdltest \
30         --disable-gl
31
32 # endianness detection isn't used when cross compiling
33 define PRBOOM_BIG_ENDIAN_FIXUP
34         $(SED) 's,.*#undef WORDS_BIGENDIAN.*,#define WORDS_BIGENDIAN 1,g' \
35                 $(PRBOOM_DIR)/config.h
36 endef
37
38 ifeq ($(BR2_ENDIAN),"BIG")
39 PRBOOM_POST_CONFIGURE_HOOKS += PRBOOM_BIG_ENDIAN_FIXUP
40 endif
41
42 define PRBOOM_INSTALL_TARGET_CMDS
43         $(INSTALL) -D $(@D)/src/prboom $(TARGET_DIR)/usr/games/prboom
44         $(INSTALL) -D $(@D)/src/prboom-game-server $(TARGET_DIR)/usr/games/prboom-game-server
45         $(INSTALL) -D $(@D)/data/prboom.wad $(TARGET_DIR)/usr/share/games/doom/prboom.wad
46 endef
47
48 $(eval $(autotools-package))