[Scummvm-git-logs] scummvm master -> 863f715cfc564a5d9aba6ea920009192c8bd10e3
spleen1981
noreply at scummvm.org
Thu Mar 9 09:53:46 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
863f715cfc LIBRETRO: BUILD: Improve engines selection script
Commit: 863f715cfc564a5d9aba6ea920009192c8bd10e3
https://github.com/scummvm/scummvm/commit/863f715cfc564a5d9aba6ea920009192c8bd10e3
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-03-09T10:20:36+01:00
Commit Message:
LIBRETRO: BUILD: Improve engines selection script
Changed paths:
backends/platform/libretro/Makefile
backends/platform/libretro/Makefile.common
backends/platform/libretro/scripts/configure_engines.sh
diff --git a/backends/platform/libretro/Makefile b/backends/platform/libretro/Makefile
index 23027fdfde0..7e41ea2fc16 100644
--- a/backends/platform/libretro/Makefile
+++ b/backends/platform/libretro/Makefile
@@ -211,7 +211,7 @@ else ifeq ($(platform), gcw0)
USE_LIBCO = 0
USE_CURL = 0
USE_MT32EMU = 0
- NO_HIGH_DEF := 1
+ USE_HIGHRES := 0
# MIYOO
else ifeq ($(platform), miyoo)
@@ -230,7 +230,7 @@ else ifeq ($(platform), miyoo)
USE_LIBCO = 0
USE_CURL = 0
USE_MT32EMU = 0
- NO_HIGH_DEF := 1
+ USE_HIGHRES := 0
# MIYOOMINI
else ifeq ($(platform), miyoomini)
@@ -248,7 +248,7 @@ else ifeq ($(platform), miyoomini)
USE_TREMOR = 1
USE_LIBCO = 0
USE_MT32EMU = 0
- NO_HIGH_DEF = 0
+ USE_HIGHRES = 0
# ARM v7
else ifneq (,$(findstring armv7,$(platform)))
@@ -498,8 +498,6 @@ endif
# Define build flags
DEPDIR = .deps
-HAVE_GCC3 = true
-USE_RGB_COLOR = true
CXXFLAGS += -Wno-reorder
diff --git a/backends/platform/libretro/Makefile.common b/backends/platform/libretro/Makefile.common
index 0950ec71a12..21b21b3b051 100644
--- a/backends/platform/libretro/Makefile.common
+++ b/backends/platform/libretro/Makefile.common
@@ -11,35 +11,49 @@ $(foreach MODULE,$(MODULES),$(MODULE_OBJS-$(MODULE)) :=)
MODULES :=
# Defaults
-USE_ZLIB ?= 1
-USE_TREMOR ?= 0
-USE_VORBIS ?= 1
-USE_FLAC ?= 1
-USE_MAD ?= 1
-USE_FAAD ?= 1
-USE_PNG ?= 1
-USE_JPEG ?= 1
-USE_THEORADEC ?= 1
-USE_FREETYPE2 ?= 1
-USE_MT32EMU ?= 1
-USE_FLUIDSYNTH ?= 1
-USE_LUA ?= 1
-USE_LIBCO ?= 1
+USE_ZLIB = 1
+USE_FLAC = 1
+USE_MAD = 1
+USE_FAAD = 1
+USE_PNG = 1
+USE_JPEG = 1
+USE_FREETYPE2 = 1
+USE_LUA = 1
LOAD_RULES_MK = 1
-USE_TINYGL ?= 1
-USE_BINK ?= 1
-POSIX ?= 1
-NO_HIGH_DEF ?= 0
-NO_WIP ?= 1
-USE_LIBCO ?= 1
-USE_RGB_COLOR ?= 1
+USE_TINYGL = 1
+USE_BINK = 1
+POSIX = 1
+USE_RGB_COLOR = 1
ENABLE_VKEYBD = 1
-USE_CLOUD ?= 0
+HAVE_GCC3 = 1
STATIC_LINKING ?= 0
LITE ?= 0
+NO_WIP ?= 1
+USE_LIBCO ?= 1
+USE_MT32EMU ?= 1
+USE_CLOUD ?= 0
DEBUG_ALLOW_DIRTY_SUBMODULES ?= 0
+# Variable engines dependencies
+UNAVAILABLE_DEPS :=
+check_deps_availability = $(shell [ $(1) = 0 ] && echo $(2))
+
+USE_HIGHRES ?= 1
+UNAVAILABLE_DEPS += $(call check_deps_availability, $(USE_HIGHRES), highres)
+
+USE_FLUIDSYNTH ?= 1
+UNAVAILABLE_DEPS += $(call check_deps_availability, $(USE_FLUIDSYNTH), fluidsynth)
+
+USE_THEORADEC ?= 1
+UNAVAILABLE_DEPS += $(call check_deps_availability, $(USE_THEORADEC), theoradec)
+
+USE_TREMOR ?= 0
+UNAVAILABLE_DEPS += $(call check_deps_availability, $(USE_TREMOR), tremor)
+
+USE_VORBIS ?= 1
+UNAVAILABLE_DEPS += $(call check_deps_availability, $(USE_VORBIS), vorbis)
+
# Paths
SCUMMVM_PATH := $(ROOT_PATH)/../../..
DEPS_PATH := $(ROOT_PATH)/deps
@@ -122,26 +136,17 @@ ifeq ($(STATIC_LINKING),1)
endif
# Engine modules
-# Following script
-# - generates configuration engines files (build/config.mk.engines, engines/engines.mk, engines/plugins_table.h, engines/detection_table.h) from actual source in $(SCUMMVM_PATH).
-# or (if static linking is required)
-# - generates config.mk.engines.lite - static file with a reduced set of engines for minimal builds - from lite_engines.list
-# - generates script.mri engines part
+# Following script generates configuration engines files (build/config.mk.engines, engines/engines.mk, engines/plugins_table.h, engines/detection_table.h) from actual source in $(SCUMMVM_PATH).
ifeq (,$(filter clean datafiles coreinfo,$(MAKECMDGOALS)))
$(info Configuring ScummVM engines...)
-ifneq ($(shell cd $(SCRIPTS_PATH); ./configure_engines.sh $(ROOT_PATH) $(SCUMMVM_PATH) $(NO_HIGH_DEF) $(NO_WIP) $(STATIC_LINKING) $(LITE)),0)
+ifneq ($(shell cd $(SCRIPTS_PATH); ./configure_engines.sh $(ROOT_PATH) $(SCUMMVM_PATH) $(NO_WIP) $(STATIC_LINKING) $(LITE) $(UNAVAILABLE_DEPS)),0)
$(error Configuring ScummVM engines failed)
else
$(info - ScummVM engines configured)
endif
endif
-ifeq ($(LITE), 1)
- -include $(ROOT_PATH)/config.mk.engines.lite
-else
- -include $(SCUMMVM_PATH)/config.mk.engines
-endif
-
+-include $(SCUMMVM_PATH)/config.mk.engines
-include $(SCUMMVM_PATH)/engines/engines.mk
ifeq ($(USE_MT32EMU),1)
diff --git a/backends/platform/libretro/scripts/configure_engines.sh b/backends/platform/libretro/scripts/configure_engines.sh
index 43d4634e4b8..c8d99fd74de 100755
--- a/backends/platform/libretro/scripts/configure_engines.sh
+++ b/backends/platform/libretro/scripts/configure_engines.sh
@@ -17,22 +17,32 @@
# Externally passed variables shall be:
-# $1 [REQ] BUILD_PATH
-# $2 [REQ] SCUMMVM_PATH
-# $3 [REQ] NO_HIGH_DEF [0,1]
-# $4 [REQ] NO_WIP [0,1]
-# $5 [REQ] STATIC_LINKING [0,1]
-# $6 [REQ] LITE [0,1]
+# $1 [REQ] BUILD_PATH
+# $2 [REQ] SCUMMVM_PATH
+# $3 [REQ] NO_WIP [0,1]
+# $4 [REQ] STATIC_LINKING [0,1]
+# $5 [REQ] LITE [0,1]
+# $[...] [OPT] Engines dependencies not available
set -e
# Exit if in parameters are not provided
-if [ -z $1 ] || [ -z $2 ] || [ -z $3 ] || [ -z $4 ] || [ -z $5 ] || [ -z $6 ] ; then
+if [ -z $1 ] || [ -z $2 ] || [ -z $3 ] || [ -z $4 ] || [ -z $5 ] ; then
exit 1
fi
+# Get parameters
BUILD_PATH="$1"
-SCUMMVM_PATH="$2"
+shift
+SCUMMVM_PATH="$1"
+shift
+NO_WIP=$1
+shift
+STATIC_LINKING=$1
+shift
+LITE=$1
+shift
+no_deps=$@
cd "${SCUMMVM_PATH}"
@@ -42,49 +52,38 @@ sed -i.bak -e "s/exit 0/return 0/g" configure
mv configure.bak configure > /dev/null 2>&1
_parent_engines_list=""
-
-# Collect all default engines dependencies and force to yes
tot_deps=""
+
+# Test NO_WIP
+[ $NO_WIP -ne 1 ] && engine_enable_all
+
+# Test LITE
+if [ $LITE -eq 1 ] ; then
+ engine_disable_all
+ for eng in $(cat "${BUILD_PATH}"/lite_engines.list) ; do
+ engine_enable "$eng"
+ done
+fi
+
+# Define engines list
for a in $_engines ; do
- engine_deps_var=_engine_${a}_deps
- for dep in ${!engine_deps_var} ; do
+ # Collect all default engines dependencies and force to yes
+ for dep in $(get_var _engine_${a}_deps) ; do
found=0
for rec_dep in $tot_deps ; do
[ $dep = $rec_dep ] && found=1
done
- [ $found -eq 0 ] && tot_deps+=" $dep"
+ [ $found -eq 0 ] && append_var tot_deps "$dep"
done
-
- # Static linking support files
- not_subengine_var=_engine_${a}_sub
- not_wip_engine_var=_engine_${a}_build_default
- if [ $5 -eq 1 ] && [ -z ${!not_subengine_var} ] ; then
- good_to_go=1
- # Test NO_HIGH_DEF
- [ $3 -eq 1 ] && [ $((echo ${!engine_deps_var} | grep -q highres); echo $?) -eq 0 ] && good_to_go=0
- [ $4 -eq 1 ] && [ $(echo ${!not_wip_engine_var} = no) ] && good_to_go=0
- [ $6 -eq 1 ] && [ $((cat ${BUILD_PATH}/lite_engines.list | grep -wq ${a}); echo $?) -eq 1 ] && good_to_go=0
- [ $good_to_go -eq 1 ] && _parent_engines_list+="ADDLIB libtemp/lib${a}.a"$'\n'
- fi
done
-[ $5 -eq 1 ] && printf "$_parent_engines_list" >> "$BUILD_PATH"/script.mri
-
for dep in $tot_deps ; do
eval _$dep=yes
done
-# Test NO_HIGH_DEF
-if [ $3 -eq 1 ] ; then
- _highres=no
-fi
-
-# Test LITE
-if [ $6 -eq 1 ] ; then
- cp "${BUILD_PATH}"/lite_engines.list "${BUILD_PATH}"/config.mk.engines.lite
- sed -i.bak -e "y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/" -e "s/^/ENABLE_/g;s/$/ = STATIC_PLUGIN/g" "${BUILD_PATH}"/config.mk.engines.lite
- rm "${BUILD_PATH}"/config.mk.engines.lite.bak
-fi
+for dep in $no_deps ; do
+ eval _$dep=no
+done
# Create needed engines build files
awk -f "engines.awk" < /dev/null > /dev/null 2>&1
@@ -95,7 +94,4 @@ copy_if_changed engines/engines.mk.new "engines/engines.mk"
copy_if_changed engines/detection_table.h.new "engines/detection_table.h"
copy_if_changed engines/plugins_table.h.new "engines/plugins_table.h"
-# Test NO_WIP
-[ $4 -ne 1 ] && sed -i.bak -e "s/# \(.*\)/\1 = STATIC_PLUGIN/g" "config.mk.engines"
-
echo 0
More information about the Scummvm-git-logs
mailing list