aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
Diffstat (limited to 'applets')
-rw-r--r--applets/applet_tables.c10
-rwxr-xr-xapplets/busybox.mkscripts16
2 files changed, 25 insertions, 1 deletions
diff --git a/applets/applet_tables.c b/applets/applet_tables.c
index b997194ad..6a20c8b38 100644
--- a/applets/applet_tables.c
+++ b/applets/applet_tables.c
@@ -85,7 +85,15 @@ int main(int argc, char **argv)
85 85
86 qsort(applets, NUM_APPLETS, sizeof(applets[0]), cmp_name); 86 qsort(applets, NUM_APPLETS, sizeof(applets[0]), cmp_name);
87 87
88 if (!argv[1]) 88 for (i = j = 0; i < NUM_APPLETS-1; ++i) {
89 if (cmp_name(applets+i, applets+i+1) == 0) {
90 fprintf(stderr, "%s: duplicate applet name '%s'\n", argv[0],
91 applets[i].name);
92 j = 1;
93 }
94 }
95
96 if (j != 0 || !argv[1])
89 return 1; 97 return 1;
90 snprintf(tmp1, PATH_MAX, "%s.%u.new", argv[1], (int) getpid()); 98 snprintf(tmp1, PATH_MAX, "%s.%u.new", argv[1], (int) getpid());
91 i = open(tmp1, O_WRONLY | O_TRUNC | O_CREAT, 0666); 99 i = open(tmp1, O_WRONLY | O_TRUNC | O_CREAT, 0666);
diff --git a/applets/busybox.mkscripts b/applets/busybox.mkscripts
new file mode 100755
index 000000000..935685cba
--- /dev/null
+++ b/applets/busybox.mkscripts
@@ -0,0 +1,16 @@
1#!/bin/sh
2# Make busybox scripted applet list file.
3
4# input $1: full path to Config.h
5# input $2: full path to applets.h
6# output (stdout): list of pathnames that should be linked to busybox
7
8export LC_ALL=POSIX
9export LC_CTYPE=POSIX
10
11CONFIG_H=${1:-include/autoconf.h}
12APPLETS_H=${2:-include/applets.h}
13$HOSTCC -E -DMAKE_SCRIPTS -include $CONFIG_H $APPLETS_H |
14 awk '/^[ \t]*SCRIPT/{
15 print $2
16 }'