Skip to content

Commit

Permalink
fixed core downloading location
Browse files Browse the repository at this point in the history
ship SDL2 prebuilt automatically
warning for out-dated toolchain
  • Loading branch information
mariotaku authored and csdougliss committed Mar 1, 2024
1 parent e797fca commit 32ae0b8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 18 deletions.
52 changes: 35 additions & 17 deletions Makefile.webos
Original file line number Diff line number Diff line change
@@ -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

#########################
#########################

Expand Down Expand Up @@ -122,15 +132,15 @@ 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
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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down

0 comments on commit 32ae0b8

Please sign in to comment.