Commit e3d8cd2f authored by Bkg2k's avatar Bkg2k

feat(build): add maximum optimizations and lto wherever it is possible

parent 8c3bcdd0
include $(BR2_EXTERNAL_RECALBOX_PATH)/package/compiler-commons/compiler-commons.mk
include $(sort $(wildcard $(BR2_EXTERNAL_RECALBOX_PATH)/package/*/*.mk))
config BR2_PACKAGE_COMPILER_COMMONS
bool compiler-commons
......@@ -65,6 +65,9 @@ endef
AMIBERRY_PRE_CONFIGURE_HOOKS += AMIBERRY_RIGHT_PI_PATH
define AMIBERRY_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_EXECUTABLE)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_EXECUTABLE)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_EXECUTABLE)" \
$(MAKE) CXX="$(TARGET_CXX)" \
CC="$(TARGET_CC)" \
STRIP="$(TARGET_STRIP)" \
......
......@@ -36,17 +36,26 @@ COMPILER_COMMONS_BOARD_OPTIONS += $(COMPILER_COMMONS_ARCH) $(COMPILER_COMMONS_AB
COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS += -O3
# Build GCC compiler/linker link optimizations
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_OUTER += -fdata-sections -ffunction-sections -Wl,--gc-sections
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_SECTION += -fdata-sections -ffunction-sections -Wl,--gc-sections
ifeq ($(BR2_GCC_ENABLE_LTO),y)
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_INNER += -flto -fwhole-program -fuse-linker-plugin
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_LTO_EXECUTABLE += -flto -fwhole-program -fuse-linker-plugin
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_LTO_LIBRARIES += -flto -fuse-linker-plugin
endif
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_ALL += $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_OUTER) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_INNER)
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_EXECUTABLE += $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_SECTION) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_LTO_EXECUTABLE)
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_LIBRARIES += $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_SECTION) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_LTO_LIBRARIES)
COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_NOLTO += $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_SECTION)
# Compiler/linker flags for .so: do not use LTO
COMPILER_COMMONS_CFLAGS_SO = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_OUTER)
# Compiler/linker flags for no LTO at all
COMPILER_COMMONS_CFLAGS_NOLTO = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_NOLTO)
COMPILER_COMMONS_CXXFLAGS_NOLTO = $(COMPILER_COMMONS_CFLAGS_NOLTO)
COMPILER_COMMONS_LDFLAGS_NOLTO = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_NOLTO)
# Compiler/linker flags for .so: do not use full LTO
COMPILER_COMMONS_CFLAGS_SO = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_LIBRARIES)
COMPILER_COMMONS_CXXFLAGS_SO = $(COMPILER_COMMONS_CFLAGS_SO)
COMPILER_COMMONS_LDFLAGS_SO = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_OPTIONS_OUTER)
COMPILER_COMMONS_LDFLAGS_SO = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_LIBRARIES)
# Compiler/linker flags for executables: use full optimizations
COMPILER_COMMONS_CFLAGS_EXE = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_ALL)
COMPILER_COMMONS_CFLAGS_EXE = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_EXECUTABLE)
COMPILER_COMMONS_CXXFLAGS_EXE = $(COMPILER_COMMONS_CFLAGS_EXE)
COMPILER_COMMONS_LDFLAGS_EXE = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_ALL)
COMPILER_COMMONS_LDFLAGS_EXE = $(COMPILER_COMMONS_BOARD_OPTIONS) $(COMPILER_COMMONS_GCC_OPTIMIZATION_OPTIONS) $(COMPILER_COMMONS_GCC_LINKER_OPTIMIZATION_EXECUTABLE)
......@@ -12,4 +12,16 @@ DOLPHIN_EMU_DEPENDENCIES = xserver_xorg-server libevdev ffmpeg zlib libpng lzo l
# bluez is disable otherwise a compilation error appears
DOLPHIN_EMU_CONF_OPTS = -DOPENGL_INCLUDE_DIR=$(STAGING_DIR)/usr/include
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_C_ARCHIVE_CREATE="<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>"
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_C_ARCHIVE_FINISH=true
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_CXX_ARCHIVE_CREATE="<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>"
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_CXX_ARCHIVE_FINISH=true
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_AR="$(TARGET_CC)-ar"
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_C_COMPILER="$(TARGET_CC)"
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_CXX_COMPILER="$(TARGET_CXX)"
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_LINKER="$(TARGET_LD)"
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_C_FLAGS="$(COMPILER_COMMONS_CFLAGS_EXE)"
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(COMPILER_COMMONS_CXXFLAGS_EXE)"
DOLPHIN_EMU_CONF_OPTS += -DCMAKE_LINKER_EXE_FLAGS="$(COMPILER_COMMONS_LDFLAGS_EXE)"
$(eval $(cmake-package))
......@@ -19,10 +19,10 @@ define DOSBOX_CONFIGURE_CMDS
(cd $(@D); \
./autogen.sh; \
$(TARGET_CONFIGURE_ARGS) $(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS) $(DOSBOX_CFLAGS)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(DOSBOX_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS) $(DOSBOX_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS) $(DOSBOX_LDFLAGS)" \
CFLAGS="$(TARGET_CFLAGS) $(DOSBOX_CFLAGS) $(COMPILER_COMMONS_CFLAGS_NOLTO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(DOSBOX_CFLAGS) $(COMPILER_COMMONS_CXXFLAGS_NOLTO)" \
CPPFLAGS="$(TARGET_CPPFLAGS) $(DOSBOX_CFLAGS) $(COMPILER_COMMONS_CXXFLAGS_NOLTO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(DOSBOX_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_NOLTO)" \
CROSS_COMPILE="$(HOST_DIR)/usr/bin/" \
LIBS="-lvorbisfile -lvorbis -logg" \
./configure --host="$(GNU_TARGET_NAME)" \
......
......@@ -29,7 +29,9 @@ FREEIMAGE_CFLAGS += -DPNG_ARM_NEON_OPT=0
endif
define FREEIMAGE_BUILD_CMDS
CXXFLAGS="$(FREEIMAGE_CFLAGS)" CFLAGS="$(FREEIMAGE_CFLAGS)" \
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO) $(FREEIMAGE_CFLAGS)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO) $(FREEIMAGE_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" LD="$(TARGET_LD)" -C $(@D)
endef
......
......@@ -21,4 +21,18 @@ endef
HYPSEUS_POST_INSTALL_TARGET_HOOKS += HYPSEUS_CONFIG_LINK
HYPSEUS_CONF_OPTS += -DCMAKE_C_FLAGS="$(COMPILER_COMMONS_CFLAGS_NOLTO)" -DCMAKE_CXX_FLAGS="$(COMPILER_COMMONS_CXXFLAGS_NOLTO)" -DCMAKE_EXE_LINKER_FLAGS="$(COMPILER_COMMONS_LDFLAGS_NOLTO)"
HYPSEUS_CONF_OPTS += -DCMAKE_C_ARCHIVE_CREATE="<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>"
HYPSEUS_CONF_OPTS += -DCMAKE_C_ARCHIVE_FINISH=true
HYPSEUS_CONF_OPTS += -DCMAKE_CXX_ARCHIVE_CREATE="<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>"
HYPSEUS_CONF_OPTS += -DCMAKE_CXX_ARCHIVE_FINISH=true
HYPSEUS_CONF_OPTS += -DCMAKE_AR="$(TARGET_CC)-ar"
HYPSEUS_CONF_OPTS += -DCMAKE_C_COMPILER="$(TARGET_CC)"
HYPSEUS_CONF_OPTS += -DCMAKE_CXX_COMPILER="$(TARGET_CXX)"
HYPSEUS_CONF_OPTS += -DCMAKE_LINKER="$(TARGET_LD)"
HYPSEUS_CONF_OPTS += -DCMAKE_C_FLAGS="$(COMPILER_COMMONS_CFLAGS_EXE)"
HYPSEUS_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(COMPILER_COMMONS_CXXFLAGS_EXE)"
HYPSEUS_CONF_OPTS += -DCMAKE_LINKER_EXE_FLAGS="$(COMPILER_COMMONS_LDFLAGS_EXE)"
$(eval $(cmake-package))
......@@ -19,14 +19,15 @@ endif
define LIBRETRO_4DO_MAKEFILE_PATCHING
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
$(SED) "s|CFLAGS = -mcpu=$(LIBRETRO_4DO_PLATFORM_CPU)|CFLAGS = -mcpu=$(LIBRETRO_4DO_PLATFORM_CPU) $(LIBRETRO_4DO_PLATFORM_OPT)|g" $(@D)/Makefile
endef
#-fno-stack-protector -fno-ident -fno-unwind-tables -fno-asynchronous-unwind-tables
LIBRETRO_4DO_PRE_CONFIGURE_HOOKS += LIBRETRO_4DO_MAKEFILE_PATCHING
define LIBRETRO_4DO_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) -f Makefile platform="unix $(LIBRETRO_4DO_PLATFORM)"
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO) -DARM" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO) -DARM" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) -f Makefile platform="unix"
endef
define LIBRETRO_4DO_INSTALL_TARGET_CMDS
......
......@@ -8,7 +8,10 @@ LIBRETRO_81_VERSION = 7900d647e084edb71ab587bbf34fe8cb83d28bff
LIBRETRO_81_SITE = $(call github,libretro,81-libretro,$(LIBRETRO_81_VERSION))
define LIBRETRO_81_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -9,7 +9,10 @@ LIBRETRO_ATARI800_LICENSE = GPL
LIBRETRO_ATARI800_SITE = $(call github,libretro,libretro-atari800,$(LIBRETRO_ATARI800_VERSION))
define LIBRETRO_ATARI800_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -14,7 +14,10 @@ LIBRETRO_BEETLE_LYNX_PLATFORM=$(RETROARCH_LIBRETRO_PLATFORM)
endif
define LIBRETRO_BEETLE_LYNX_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(LIBRETRO_BEETLE_LYNX_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_BEETLE_NGP_VERSION = b68db9f76f17485e8af97c41560a99025efda1d5
LIBRETRO_BEETLE_NGP_SITE = $(call github,libretro,beetle-ngp-libretro,$(LIBRETRO_BEETLE_NGP_VERSION))
define LIBRETRO_BEETLE_NGP_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_BEETLE_PCE_FAST_VERSION = 433fb7a36fa26996a37f2107fb5189f243024f7d
LIBRETRO_BEETLE_PCE_FAST_SITE = $(call github,libretro,beetle-pce-fast-libretro,$(LIBRETRO_BEETLE_PCE_FAST_VERSION))
define LIBRETRO_BEETLE_PCE_FAST_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) platform="$(RETROARCH_LIBRETRO_BOARD)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_BEETLE_PCFX_VERSION = 84b7ca6af37525af126069f812d53784bc1702fe
LIBRETRO_BEETLE_PCFX_SITE = $(call github,libretro,beetle-pcfx-libretro,$(LIBRETRO_BEETLE_PCFX_VERSION))
define LIBRETRO_BEETLE_PCFX_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" AR="$(TARGET_AR)" LD="$(TARGET_CXX)" RANLIB="$(TARGET_RANLIB)" -C $(@D) platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_BEETLE_PSX_HW_VERSION = 53591985319edc34d83a0858ad9a935b934dcf5c
LIBRETRO_BEETLE_PSX_HW_SITE = $(call github,libretro,beetle-psx-libretro,$(LIBRETRO_BEETLE_PSX_HW_VERSION))
define LIBRETRO_BEETLE_PSX_HW_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)" HAVE_HW=1
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_BEETLE_PSX_VERSION = 53591985319edc34d83a0858ad9a935b934dcf5c
LIBRETRO_BEETLE_PSX_SITE = $(call github,libretro,beetle-psx-libretro,$(LIBRETRO_BEETLE_PSX_VERSION))
define LIBRETRO_BEETLE_PSX_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_BEETLE_SUPERGRAFX_VERSION = a124da8e75f8edba634fcb90ebf08c3d739ac890
LIBRETRO_BEETLE_SUPERGRAFX_SITE = $(call github,libretro,beetle-supergrafx-libretro,$(LIBRETRO_BEETLE_SUPERGRAFX_VERSION))
define LIBRETRO_BEETLE_SUPERGRAFX_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_BEETLE_VB_VERSION = 00accc8a7c3482e5e464c5bb5f0679478024a0dc
LIBRETRO_BEETLE_VB_SITE = $(call github,libretro,beetle-vb-libretro,$(LIBRETRO_BEETLE_VB_VERSION))
define LIBRETRO_BEETLE_VB_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_BEETLE_WSWAN_VERSION = b231cff853da4bf221189df8aaed8bc275459db2
LIBRETRO_BEETLE_WSWAN_SITE = $(call github,libretro,beetle-wswan-libretro,$(LIBRETRO_BEETLE_WSWAN_VERSION))
define LIBRETRO_BEETLE_WSWAN_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_BLUEMSX_VERSION = d0fd4a7bf3f76329ab078e4e1e2db13ea20c106b
LIBRETRO_BLUEMSX_SITE = $(call github,libretro,blueMSX-libretro,$(LIBRETRO_BLUEMSX_VERSION))
define LIBRETRO_BLUEMSX_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile.libretro
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) -f Makefile.libretro platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_CAP32_VERSION = 6ca94b368fbbef074a82c103fa84c494654071c1
LIBRETRO_CAP32_SITE = $(call github,libretro,libretro-cap32,$(LIBRETRO_CAP32_VERSION))
define LIBRETRO_CAP32_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_CROCODS_VERSION = a7d1098000376a39d70db171863c8f46da7de07d
LIBRETRO_CROCODS_SITE = $(call github,libretro,libretro-crocods,$(LIBRETRO_CROCODS_VERSION))
define LIBRETRO_CROCODS_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -13,9 +13,15 @@ else
LIBRETRO_FBALPHA_NEON += "HAVE_NEON=0"
endif
ifeq ($(BR2_arm),y)
LIBRETRO_FBALPHA_USE_CYCLONE = USE_CYCLONE=1
endif
define LIBRETRO_FBALPHA_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) -f makefile.libretro platform="$(RETROARCH_LIBRETRO_BOARD)" $(LIBRETRO_FBALPHA_NEON)
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) -f makefile.libretro platform="$(RETROARCH_LIBRETRO_BOARD)" $(LIBRETRO_FBALPHA_NEON) $(LIBRETRO_FBALPHA_USE_CYCLONE)
endef
define LIBRETRO_FBALPHA_INSTALL_TARGET_CMDS
......
......@@ -14,7 +14,10 @@ LIBRETRO_FCEUMM_PLATFORM=$(RETROARCH_LIBRETRO_PLATFORM)
endif
define LIBRETRO_FCEUMM_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile.libretro
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) -f Makefile.libretro platform="$(LIBRETRO_FCEUMM_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_FCEUNEXT_VERSION = ebd46a592c23a8091abd72e74cf0d9f4517769e1
LIBRETRO_FCEUNEXT_SITE = $(call github,libretro,fceu-next,$(LIBRETRO_FCEUNEXT_VERSION))
define LIBRETRO_FCEUNEXT_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/fceumm-code/Makefile.libretro
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/fceumm-code -f Makefile.libretro platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,8 +8,11 @@ LIBRETRO_FMSX_VERSION = 6b241974ffb4d2a3fc681b65a8ff6b717501cb67
LIBRETRO_FMSX_SITE = $(call github,libretro,fmsx-libretro,$(LIBRETRO_FMSX_VERSION))
define LIBRETRO_FMSX_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) platform="$(RETROARCH_LIBRETRO_PLATFORM)"
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) platform="$(RETROARCH_LIBRETRO_PLATFORM)" PLATFORM_DEFINES="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)"
endef
define LIBRETRO_FMSX_INSTALL_TARGET_CMDS
......
......@@ -8,7 +8,10 @@ LIBRETRO_FREECHAF_VERSION = 0b3e90406e43f6bc78cec3fbd2bb4cad40ad06d5
LIBRETRO_FREECHAF_SITE = $(call github,libretro,FreeChaF,$(LIBRETRO_FREECHAF_VERSION))
define LIBRETRO_FREECHAF_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_NOLTO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_NOLTO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_NOLTO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" LD="$(TARGET_CXX)" AR="$(TARGET_AR)" RANLIB="$(TARGET_RANLIB)" -C $(@D)/ -f Makefile platform="unix"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_FREEINTV_VERSION = b888da9a0dbae404c1fb52a6514c7f6800dfe11b
LIBRETRO_FREEINTV_SITE = $(call github,libretro,FreeIntv,$(LIBRETRO_FREEINTV_VERSION))
define LIBRETRO_FREEINTV_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" LD="$(TARGET_CXX)" AR="$(TARGET_AR)" RANLIB="$(TARGET_RANLIB)" -C $(@D)/ -f Makefile platform="unix"
endef
......
......@@ -7,8 +7,21 @@
LIBRETRO_FUSE_VERSION = 43d01dec6ad26e6014fabf79dbcf6a04ac2c7eea
LIBRETRO_FUSE_SITE = $(call github,libretro,fuse-libretro,$(LIBRETRO_FUSE_VERSION))
ifeq ($(BR2_aarch64),y)
LIBRETRO_FUSE_CFLAGS = $(COMPILER_COMMONS_CFLAGS_NOLTO)
LIBRETRO_FUSE_CXXFLAGS = $(COMPILER_COMMONS_CXXFLAGS_NOLTO)
LIBRETRO_FUSE_LDFLAGS = $(COMPILER_COMMONS_LDFLAGS_NOLTO)
else
LIBRETRO_FUSE_CFLAGS = $(COMPILER_COMMONS_CFLAGS_SO)
LIBRETRO_FUSE_CXXFLAGS = $(COMPILER_COMMONS_CXXFLAGS_SO)
LIBRETRO_FUSE_LDFLAGS = $(COMPILER_COMMONS_LDFLAGS_SO)
endif
define LIBRETRO_FUSE_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile.libretro
CFLAGS="$(TARGET_CFLAGS) $(LIBRETRO_FUSE_CFLAGS)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(LIBRETRO_FUSE_CXXFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS) $(LIBRETRO_FUSE_LDFLAGS)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile.libretro platform="$(RETROARCH_LIBRETRO_BOARD)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_GAMBATTE_VERSION = 611cbfd743615a22b569dfb27c7cf805041d719a
LIBRETRO_GAMBATTE_SITE = $(call github,libretro,gambatte-libretro,$(LIBRETRO_GAMBATTE_VERSION))
define LIBRETRO_GAMBATTE_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile.libretro
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile.libretro platform="$(RETROARCH_LIBRETRO_BOARD)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_GENESISPLUSGX_VERSION = 53e043de0c138dc7308ef9c04e3dfa6f68721931
LIBRETRO_GENESISPLUSGX_SITE = $(call github,libretro,Genesis-Plus-GX,$(LIBRETRO_GENESISPLUSGX_VERSION))
define LIBRETRO_GENESISPLUSGX_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile.libretro
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) -f Makefile.libretro platform="$(RETROARCH_LIBRETRO_BOARD)"
endef
......
......@@ -9,7 +9,7 @@ LIBRETRO_GPSP_SITE = $(call github,libretro,gpsp,$(LIBRETRO_GPSP_VERSION))
define LIBRETRO_GPSP_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) platform="$(RETROARCH_LIBRETRO_BOARD)"
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D) platform="$(RETROARCH_LIBRETRO_BOARD)" OPTIMIZE="$(COMPILER_COMMONS_LDFLAGS_SO)"
endef
define LIBRETRO_GPSP_INSTALL_TARGET_CMDS
......
......@@ -8,7 +8,10 @@ LIBRETRO_GW_VERSION = dc0feaf9a779a9dc4862351584a585d4fc871c3f
LIBRETRO_GW_SITE = $(call github,libretro,gw-libretro,$(LIBRETRO_GW_VERSION))
define LIBRETRO_GW_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile.libretro
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile.libretro platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_HANDY_VERSION = 08cc63376cd8886aea6e6cd38297ba7c9ea0344c
LIBRETRO_HANDY_SITE = $(call github,libretro,libretro-handy,$(LIBRETRO_HANDY_VERSION))
define LIBRETRO_HANDY_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -9,7 +9,11 @@ LIBRETRO_HATARI_SITE = $(call github,libretro,hatari,$(LIBRETRO_HATARI_VERSION))
LIBRETRO_HATARI_DEPENDENCIES = libcapsimage
define LIBRETRO_HATARI_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" ASFLAGS="$(TARGET_ASFLAGS)" PLATFLAGS="$(TARGET_PLATFLAGS)" SHARED="$(TARGET_SHARED)" CXXFLAGS="$(TARGET_CXXFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile.libretro
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
ASFLAGS="$(TARGET_ASFLAGS)" PLATFLAGS="$(TARGET_PLATFLAGS)" SHARED="$(TARGET_SHARED)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile.libretro platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,7 +8,12 @@ LIBRETRO_LUTRO_VERSION = b69dd3e566dfcffee17dd33049674b3d3dcd441c
LIBRETRO_LUTRO_SITE = $(call github,libretro,libretro-lutro,$(LIBRETRO_LUTRO_VERSION))
define LIBRETRO_LUTRO_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
$(SED) "s|^LUA_MYCFLAGS :=|LUA_MYCFLAGS :=$(COMPILER_COMMONS_CFLAGS_SO)|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
LUA_MYCFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -8,8 +8,11 @@ LIBRETRO_MAME2000_VERSION = 90d9909ab60dace88d5ab281fa1e9e43e5f25364
LIBRETRO_MAME2000_SITE = $(call github,libretro,mame2000-libretro,$(LIBRETRO_MAME2000_VERSION))
define LIBRETRO_MAME2000_BUILD_CMDS
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
mkdir -p $(@D)/obj_libretro_libretro/cpu
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CC="$(TARGET_CC)" -C $(@D) -f Makefile ARM=1
endef
......
......@@ -8,8 +8,11 @@ LIBRETRO_MAME2003_PLUS_VERSION = feae837e27ac480dc864c8b03a885a35c4d4d0d2
LIBRETRO_MAME2003_PLUS_SITE = $(call github,libretro,mame2003-plus-libretro,$(LIBRETRO_MAME2003_PLUS_VERSION))
define LIBRETRO_MAME2003_PLUS_BUILD_CMDS
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
mkdir -p $(@D)/obj/mame/cpu/ccpu
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_BOARD)"
endef
......
......@@ -8,8 +8,11 @@ LIBRETRO_MAME2003_VERSION = ddc34e3bcbb8218fbf767fdc98d75089d6a89880
LIBRETRO_MAME2003_SITE = $(call github,libretro,mame2003-libretro,$(LIBRETRO_MAME2003_VERSION))
define LIBRETRO_MAME2003_BUILD_CMDS
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
mkdir -p $(@D)/obj/mame/cpu/ccpu
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_BOARD)"
endef
......
......@@ -22,8 +22,11 @@ LIBRETRO_MAME2010_BUILD_OPTS=VRENDER=soft PTR64=0 ARM_ENABLED=0
endif
define LIBRETRO_MAME2010_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_CXX)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)" $(LIBRETRO_MAME2010_BUILD_OPTS)
$(SED) "s|^CONLYFLAGS =|CONLYFLAGS = $(COMPILER_COMMONS_CFLAGS_SO)|g" $(@D)/Makefile
$(SED) "s|^CPPONLYFLAGS =|CPPONLYFLAGS = $(COMPILER_COMMONS_CXXFLAGS_SO)|g" $(@D)/Makefile
$(SED) "s|^LDFLAGS =|LDFLAGS = $(COMPILER_COMMONS_LDFLAGS_SO)|g" $(@D)/Makefile
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_CXX)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)" $(LIBRETRO_MAME2010_BUILD_OPTS)
endef
define LIBRETRO_MAME2010_INSTALL_TARGET_CMDS
......
......@@ -8,9 +8,16 @@ LIBRETRO_MELONDS_VERSION = f3a42da78908edf4500055f4cb895e144094643d
LIBRETRO_MELONDS_SITE = $(call github,libretro,melonds,$(LIBRETRO_MELONDS_VERSION))
LIBRETRO_MELONDS_LICENSE = GPLv3
ifeq ($(BR2_arm),y)
LIBRETRO_MELONDS_PIC = -fPIC
endif
define LIBRETRO_MELONDS_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO) $(LIBRETRO_MELONDS_PIC)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO) $(LIBRETRO_MELONDS_PIC)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO) $(LIBRETRO_MELONDS_PIC)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="unix"
endef
define LIBRETRO_MELONDS_INSTALL_TARGET_CMDS
......
......@@ -8,7 +8,10 @@ LIBRETRO_METEOR_VERSION = f8ab66ce5f68991bf9f926bf1dd5b662abd9d74b
LIBRETRO_METEOR_SITE = $(call github,libretro,meteor-libretro,$(LIBRETRO_METEOR_VERSION))
define LIBRETRO_METEOR_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/libretro/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" LD="$(TARGET_LD)" AR="$(TARGET_AR)" RANLIB="$(TARGET_RANLIB)" -C $(@D)/libretro platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -20,7 +20,10 @@ LIBRETRO_MGBA_PLATFORM=$(RETROARCH_LIBRETRO_PLATFORM)
endif
define LIBRETRO_MGBA_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile.libretro
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile.libretro platform="$(LIBRETRO_MGBA_PLATFORM)" $(LIBRETRO_MGBA_NEON)
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_MINIVMAC_VERSION = 91e6ee6e7b32e71cb3ecf60a04d187690b3e06f9
LIBRETRO_MINIVMAC_SITE = $(call github,libretro,libretro-minivmac,$(LIBRETRO_MINIVMAC_VERSION))
define LIBRETRO_MINIVMAC_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" LD="$(TARGET_CXX)" AR="$(TARGET_AR)" RANLIB="$(TARGET_RANLIB)" -C $(@D)/ -f Makefile platform="unix"
endef
......
......@@ -11,11 +11,14 @@ LIBRETRO_MUPEN64_DEPENDENCIES = rpi-userland
ifeq ($(BR2_cortex_a7),y)
LIBRETRO_MUPEN64_PLATFORM=rpi2
else
LIBRETRO_MUPEN64_PLATFORM=rpi
LIBRETRO_MUPEN64_PLATFORM=rpi3
endif
define LIBRETRO_MUPEN64_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO) -fpermissive" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(LIBRETRO_MUPEN64_PLATFORM)" WITH_DYNAREC=arm
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_NESTOPIA_VERSION = 44800c5f6336894a8307cc03a38403dbfda83d29
LIBRETRO_NESTOPIA_SITE = $(call github,libretro,nestopia,$(LIBRETRO_NESTOPIA_VERSION))
define LIBRETRO_NESTOPIA_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/libretro/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/libretro/ platform="$(RETROARCH_LIBRETRO_BOARD)"
endef
......
......@@ -19,7 +19,10 @@ LIBRETRO_NP2KAI_PLATFORM=unix
endif
define LIBRETRO_NP2KAI_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/sdl2/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/sdl2 -f Makefile.libretro platform="$(LIBRETRO_NP2KAI_PLATFORM)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_NXENGINE_VERSION = f83ccdc9a3c14bdcc5e9c291230a603e4686cfec
LIBRETRO_NXENGINE_SITE = $(call github,libretro,nxengine-libretro,$(LIBRETRO_NXENGINE_VERSION))
define LIBRETRO_NXENGINE_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_BOARD)"
endef
......
......@@ -8,7 +8,10 @@ LIBRETRO_O2EM_VERSION = 32182d2b2d2a8c2455db3b06b65aa7e01505c020
LIBRETRO_O2EM_SITE = $(call github,libretro,libretro-o2em,$(LIBRETRO_O2EM_VERSION))
define LIBRETRO_O2EM_BUILD_CMDS
CFLAGS="$(TARGET_CFLAGS)" CXXFLAGS="$(TARGET_CXXFLAGS)" \
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)" \
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(RETROARCH_LIBRETRO_PLATFORM)"
endef
......
......@@ -18,7 +18,7 @@ define LIBRETRO_PARALLEL64_BUILD_CMDS
$(SED) "s|-O2|-O3|g" $(@D)/Makefile
CFLAGS="$(TARGET_CFLAGS) $(COMPILER_COMMONS_CFLAGS_SO)" \
CXXFLAGS="$(TARGET_CXXFLAGS) $(COMPILER_COMMONS_CXXFLAGS_SO)" \
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)"
LDFLAGS="$(TARGET_LDFLAGS) $(COMPILER_COMMONS_LDFLAGS_SO)"
$(MAKE) CXX="$(TARGET_CXX)" CC="$(TARGET_CC)" -C $(@D)/ -f Makefile platform="$(LIBRETRO_PARALLEL64_PLATFORM)" WITH_DYNAREC=arm
endef
......