configure: add ability to select plugins to build in --plugins flag

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit aea9e1b63fc957355ba3447c9551d567c710d56b
Author: Roman Artiukhin <[email protected]>
Date:   Mon Feb 16 11:11:19 2026 +0200

    configure: add ability to select plugins to build in --plugins flag
    
    Use ":" as the separator. Useful for plugin development and debugging.
    
    Example:
    ../tools/configure --target=hibyr1 --type=ADS --plugins="properties.c:imageviewer"
    
    This creates a debug simulator build for Hiby R1 with the properties.c file and the imageviewer directory plugins enabled.
    
    Change-Id: If974cfb0c54bd2c1a53ae11cc3f942c698ef2fe4

diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make
index 8620d3f9c0..55a6946c61 100644
--- a/apps/plugins/plugins.make
+++ b/apps/plugins/plugins.make
@@ -20,11 +20,15 @@ ifeq ($(APP_TYPE),ctru-app)
     is_app_build =
 endif
 
+ifdef SELECTED_PLUGINS_SRC
+PLUGINS_SRC = $(SELECTED_PLUGINS_SRC)
+else
 ifdef is_app_build
 PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES.app_build)
 else
 PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES)
 endif
+endif # ifdef SELECTED_PLUGINS_SRC
 OTHER_SRC += $(PLUGINS_SRC)
 ROCKS1 := $(PLUGINS_SRC:.c=.rock)
 ROCKS1 := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(ROCKS1))
@@ -58,11 +62,15 @@ endif
 OTHER_SRC += $(ROOTDIR)/apps/plugins/plugin_crt0.c
 PLUGIN_CRT0 := $(BUILDDIR)/apps/plugins/plugin_crt0.o
 # multifile plugins (subdirs):
+ifdef SELECTED_PLUGINS_SUBDIRS
+PLUGINSUBDIRS := $(SELECTED_PLUGINS_SUBDIRS)
+else
 ifdef is_app_build
 PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS.app_build)
 else
 PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS)
 endif
+endif # ifdef SELECTED_PLUGINS_SUBDIRS
 
 PLUGIN_LIBS := $(PLUGINLIB) $(PLUGINBITMAPLIB) $(SETJMPLIB) $(FIXEDPOINTLIB)
 
diff --git a/tools/configure b/tools/configure
index 8d7739f0cc..b68709b90a 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1557,6 +1557,7 @@ ARG_THREAD_SUPPORT=
 ARG_32BIT=
 ARG_ADDR_SAN=
 ARG_UBSAN=
+ARG_PLUGINS=
 err=
 for arg in "$@"; do
 	case "$arg" in
@@ -1573,6 +1574,7 @@ for arg in "$@"; do
 		--ttsopts=*)  ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;;
 		--type=*)     ARG_TYPE=`echo "$arg" | cut -d = -f 2`;;
 		--voice=*)    ARG_VOICE=`echo "$arg" | cut -d = -f 2`;;
+		--plugins=*)  ARG_PLUGINS=`echo "$arg" | cut -d = -f 2`;;
 		--thumb)      ARG_ARM_THUMB=1;;
 		--no-thumb)   ARG_ARM_THUMB=0;;
 		--32-bit)     ARG_32BIT=1;;
@@ -4828,11 +4830,34 @@ cmdline=`echo $cmdline | sed -e s,--target=[a-zA-Z_0-9]\*,,g \
                             -e s,--type=[a-zA-Z0-9]\*,,g`
 cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
 
+if [ -n "$ARG_PLUGINS" ]; then
+    echo "Selected plugins: $ARG_PLUGINS"
+    plugins="yes"
+
+    selected_src=""
+    selected_subdirs=""
+    chk_plugin_dir="${rootdir}/apps/plugins"
+
+    IFS=":"
+    for p in $ARG_PLUGINS; do
+        if [ -d "$chk_plugin_dir/$p" ]; then
+             selected_subdirs="$selected_subdirs \$(ROOTDIR)/apps/plugins/$p"
+        elif [ -f "$chk_plugin_dir/$p" ]; then
+             selected_src="$selected_src \$(ROOTDIR)/apps/plugins/$p"
+        else
+             echo "Warning: Plugin '$p' found neither as file nor directory in $chk_plugin_dir. Use ':' as the separator."
+        fi
+    done
+fi
+
 ### end of cmdline
 
 cat > Makefile <<EOF
 ## Automatically generated. http://www.rockbox.org/
 
+export SELECTED_PLUGINS_SRC=${selected_src}
+export SELECTED_PLUGINS_SUBDIRS=${selected_subdirs}
+
 export ROOTDIR=${rootdir}
 export FIRMDIR=\$(ROOTDIR)/firmware
 export APPSDIR=${appsdir}
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.