From 32ae0b8644f6c4c35ab0ca31e43da34daa83e5c8 Mon Sep 17 00:00:00 2001 From: Ningyuan Li Date: Fri, 1 Mar 2024 00:25:33 +0900 Subject: [PATCH] fixed core downloading location ship SDL2 prebuilt automatically warning for out-dated toolchain --- Makefile.webos | 52 +++++++++++++++++++++++++++++++++----------------- config.def.h | 2 +- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/Makefile.webos b/Makefile.webos index c772fc4231b..620cf0bcfa8 100644 --- a/Makefile.webos +++ b/Makefile.webos @@ -1,14 +1,24 @@ include version.all -$(call assert,$(call seq,$(TARGET_PREFIX),arm-webos-linux-gnueabi-),webOS SDK isn't setup properly. See https://github.com/webosbrew/meta-lg-webos-ndk#compile-program-by-command-line) +ifneq ($(CROSS_COMPILE),arm-webos-linux-gnueabi-) + $(error You need webOS toolchain to build this. See https://github.com/webosbrew/native-toolchain) +endif + +ifdef SDKTARGETSYSROOT + $(warning OE-based toolchain isn't supported anymore. Please use https://github.com/webosbrew/native-toolchain) + STAGING_DIR = $(SDKTARGETSYSROOT) +else ifndef STAGING_DIR + $(error Can't find buildroot based toolchain. Please use https://github.com/webosbrew/native-toolchain) +endif + +WEBOS_FREETYPE_CONFIG ?= $(STAGING_DIR)/usr/bin/freetype-config -WEBOS_FREETYPE_CONFIG ?= $(SDKTARGETSYSROOT)/usr/bin/freetype-config +WEBOS_INC_DIR ?= $(STAGING_DIR)/usr/include +WEBOS_LIB_DIR ?= $(STAGING_DIR)/usr/lib -WEBOS_INC_DIR ?= $(SDKTARGETSYSROOT)/usr/include -WEBOS_LIB_DIR ?= $(SDKTARGETSYSROOT)/usr/lib +ADD_SDL2_LIB ?= 0 +SDL2_PREBUILT_ARCHIVE ?= https://github.com/webosbrew/SDL-webOS/releases/download/release-2.30.0-2/SDL2-2.30.0-webos.tar.gz -ADD_SDL2_LIB ?= 0 - ######################### ######################### @@ -122,7 +132,7 @@ OS = Linux TARGET = retroarch OBJ := -LINK := $(CXX) +LINK := $(CC) DEF_FLAGS += -ffunction-sections -fdata-sections DEF_FLAGS += -I. -Ideps -Ideps/stb -DWEBOS=1 -MMD DEF_FLAGS += -Wall -Wno-unused-variable @@ -130,7 +140,7 @@ LIBS := -ldl -lz -lrt -pthread CFLAGS := CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS ASFLAGS := -LDFLAGS := -Wl,-rpath=\$$ORIGIN/lib,--gc-sections +LDFLAGS := -Wl,-rpath=\$$ORIGIN/lib,--gc-sections INCLUDE_DIRS = -I$(WEBOS_INC_DIR) LIBRARY_DIRS = -L$(WEBOS_LIB_DIR) DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY @@ -142,12 +152,12 @@ DEFINES += -DHAVE_PULSE DEFINES += -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES DEFINES += -DHAVE_UPDATE_CORE_INFO -PKG_CONFIG=$(SDKTARGETSYSROOT)/../../bin/pkg-config - -SDL2_CFLAGS := $(shell $(PKG_CONFIG) --cflags sdl2) -SDL2_LIBS := $(shell $(PKG_CONFIG) --libs sdl2) +PKG_CONFIG=pkg-config + +SDL2_CFLAGS := $(shell $(PKG_CONFIG) --cflags sdl2) +SDL2_LIBS := $(shell $(PKG_CONFIG) --libs sdl2) OPENGLES_LIBS = -lGLESv2 -PULSE_LIBS = $(shell $(PKG_CONFIG) --libs libpulse) +PULSE_LIBS = $(shell $(PKG_CONFIG) --libs libpulse) MMAP_LIBS = -lc NEON_CFLAGS = -mfpu=neon NEON_ASFLAGS = -mfpu=neon @@ -225,18 +235,26 @@ clean: rm -rf $(OBJDIR_BASE) rm -f $(TARGET) rm -f *.d + rm -rf SDL rm -rf webos/*.ipk rm -rf webos/dist -ipk: $(TARGET) +sdl2: $(TARGET) +ifeq ($(ADD_SDL2_LIB), 1) + @echo "Downloading SDL2 prebuilt" + mkdir -p SDL + wget -qO - $(SDL2_PREBUILT_ARCHIVE) | tar -C SDL -zxvf - +endif + +ipk: $(TARGET) sdl2 rm -rf webos/dist mkdir -p webos/dist/lib echo "$$APPINFO" > webos/dist/appinfo.json cp -t webos/dist -vf $(TARGET) webos/icon160.png cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libstdc++.so.6 -ifeq ($(ADD_SDL2_LIB), 1) - cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libSDL2-2.0.so.0 -endif +ifeq ($(ADD_SDL2_LIB), 1) + cp -t webos/dist/lib -vf SDL/lib/libSDL2-2.0.so.0 +endif $(STRIP) webos/dist/$(TARGET) cd webos && ares-package dist diff --git a/config.def.h b/config.def.h index 13bf3763aa1..17f948b80db 100644 --- a/config.def.h +++ b/config.def.h @@ -1688,7 +1688,7 @@ #if defined(HAKCHI) #define DEFAULT_BUILDBOT_SERVER_URL "http://hakchicloud.com/Libretro_Cores/" #elif defined(WEBOS) -#define DEFAULT_BUILDBOT_SERVER_URL "https://www.webosbrew.org/retroarch-cores/armv7a/" +#define DEFAULT_BUILDBOT_SERVER_URL "http://retroarch-cores.webosbrew.org/armv7a/" #elif defined(ANDROID) #if defined(ANDROID_ARM_V7) #define DEFAULT_BUILDBOT_SERVER_URL "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/"