1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
diff --git a/apps/plugins/SOURCES.app_build b/apps/plugins/SOURCES.app_build
new file mode 100644
index 0000000..d4fcfa6
--- /dev/null
+++ b/apps/plugins/SOURCES.app_build
@@ -0,0 +1,40 @@
+/* plugins common to all models */
+credits.c
+properties.c
+search.c
+sort.c
+theme_remove.c
+vbrfix.c
+
+#ifdef HAVE_TEST_PLUGINS /* enable in advanced build options */
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+test_boost.c
+#endif
+#if CONFIG_CODEC == SWCODEC
+test_codec.c
+#endif
+#ifdef HAVE_JPEG
+test_core_jpeg.c
+#endif
+test_disk.c
+#ifdef HAVE_LCD_BITMAP
+#if LCD_DEPTH < 4 && !defined(SIMULATOR)
+test_scanrate.c
+#endif
+#ifndef HAVE_LCD_COLOR
+test_grey.c
+test_greylib_bitmap_scale.c
+#endif
+#endif
+test_mem.c
+#ifdef HAVE_LCD_BITMAP
+test_mem_jpeg.c
+#endif
+#ifdef HAVE_LCD_COLOR
+test_resize.c
+#endif
+#if CONFIG_CODEC == SWCODEC
+test_sampr.c
+#endif
+test_viewports.c
+#endif /* HAVE_TEST_PLUGINS */
diff --git a/apps/plugins/SUBDIRS.app_build b/apps/plugins/SUBDIRS.app_build
new file mode 100644
index 0000000..dbf4382
--- /dev/null
+++ b/apps/plugins/SUBDIRS.app_build
@@ -0,0 +1,17 @@
+/* For all targets with a bitmap display */
+#ifdef HAVE_LCD_BITMAP
+
+#ifdef HAVE_TAGCACHE
+pictureflow
+#endif
+
+#endif /* HAVE_LCD_BITMAP */
+
+/* For all the swcodec targets */
+#if CONFIG_CODEC == SWCODEC
+
+#if MEMORYSIZE > 2 /* we need a lot of RAM for instruments */
+mikmod
+#endif
+
+#endif /* CONFIG_CODEC == SWCODEC */
diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make
index 30cf26f..a7630ea 100644
--- a/apps/plugins/plugins.make
+++ b/apps/plugins/plugins.make
@@ -8,7 +8,11 @@
 #

 # single-file plugins:
+ifdef APP_TYPE
+PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES.app_build)
+else
 PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES)
+endif
 OTHER_SRC += $(PLUGINS_SRC)
 ROCKS1 := $(PLUGINS_SRC:.c=.rock)
 ROCKS1 := $(subst $(ROOTDIR),$(BUILDDIR),$(ROCKS1))
@@ -36,7 +40,11 @@ endif
 OTHER_SRC += $(ROOTDIR)/apps/plugins/plugin_crt0.c
 PLUGIN_CRT0 := $(BUILDDIR)/apps/plugins/plugin_crt0.o
 # multifile plugins (subdirs):
+ifdef APP_TYPE
+PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS.app_build)
+else
 PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS)
+endif

 # include <dir>.make from each subdir (yay!)
 $(foreach dir,$(PLUGINSUBDIRS),$(eval include $(dir)/$(notdir $(dir)).make))
diff --git a/firmware/export/config/application.h b/firmware/export/config/application.h
index 64ebbf3..52fdc64 100644
--- a/firmware/export/config/application.h
+++ b/firmware/export/config/application.h
@@ -79,6 +79,11 @@
 /* Define this if you do software codec */
 #define CONFIG_CODEC SWCODEC

+/* Work around broken debug macro expansion in scratchbox */
+#if (CONFIG_PLATFORM & PLATFORM_MAEMO)
+#define _HAVE_STRING_ARCH_strncmp
+#endif
+
 #if (CONFIG_PLATFORM & (PLATFORM_ANDROID|PLATFORM_MAEMO))
 #define HAVE_MULTIMEDIA_KEYS
 #endif
diff --git a/tools/configure b/tools/configure
index 5648438..2f5eb30 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2918,7 +2918,7 @@ fi
     output="rockbox"
     bootoutput="rockbox"
     appextra="recorder:gui:radio"
-    plugins=""
+    plugins="yes"
     swcodec="yes"
     # architecture, manufacturer and model for the target-tree build
     t_cpu="hosted"
@@ -2974,7 +2974,7 @@ fi
     output="rockbox"
     bootoutput="rockbox"
     appextra="recorder:gui:radio"
-    plugins=""
+    plugins="yes"
     swcodec="yes"
     # architecture, manufacturer and model for the target-tree build
     t_cpu="hosted"
@@ -3002,7 +3002,7 @@ fi
     output="rockbox"
     bootoutput="rockbox"
     appextra="recorder:gui:radio"
-    plugins=""
+    plugins="yes"
     swcodec="yes"
     # architecture, manufacturer and model for the target-tree build
     t_cpu="hosted"