diff options
Diffstat (limited to 'applets')
-rw-r--r-- | applets/Kbuild.src | 2 | ||||
-rw-r--r-- | applets/applet_tables.c | 24 | ||||
-rw-r--r-- | applets/applets.c | 2 | ||||
-rwxr-xr-x | applets/usage_compressed | 4 |
4 files changed, 26 insertions, 6 deletions
diff --git a/applets/Kbuild.src b/applets/Kbuild.src index e3bac9681..31fee8d1e 100644 --- a/applets/Kbuild.src +++ b/applets/Kbuild.src | |||
@@ -38,7 +38,7 @@ include/usage_compressed.h: applets/usage $(srctree_slash)applets/usage_compress | |||
38 | $(call cmd,gen_usage_compressed) | 38 | $(call cmd,gen_usage_compressed) |
39 | 39 | ||
40 | quiet_cmd_gen_applet_tables = GEN include/applet_tables.h | 40 | quiet_cmd_gen_applet_tables = GEN include/applet_tables.h |
41 | cmd_gen_applet_tables = applets/applet_tables include/applet_tables.h | 41 | cmd_gen_applet_tables = applets/applet_tables include/applet_tables.h include/NUM_APPLETS.h |
42 | 42 | ||
43 | include/applet_tables.h: applets/applet_tables | 43 | include/applet_tables.h: applets/applet_tables |
44 | $(call cmd,gen_applet_tables) | 44 | $(call cmd,gen_applet_tables) |
diff --git a/applets/applet_tables.c b/applets/applet_tables.c index e48be4682..338dc20f9 100644 --- a/applets/applet_tables.c +++ b/applets/applet_tables.c | |||
@@ -79,7 +79,7 @@ int main(int argc, char **argv) | |||
79 | } | 79 | } |
80 | printf("\n"); | 80 | printf("\n"); |
81 | 81 | ||
82 | printf("#ifndef SKIP_definitions\n"); | 82 | //printf("#ifndef SKIP_definitions\n"); |
83 | printf("const char applet_names[] ALIGN1 = \"\"\n"); | 83 | printf("const char applet_names[] ALIGN1 = \"\"\n"); |
84 | for (i = 0; i < NUM_APPLETS; i++) { | 84 | for (i = 0; i < NUM_APPLETS; i++) { |
85 | printf("\"%s\" \"\\0\"\n", applets[i].name); | 85 | printf("\"%s\" \"\\0\"\n", applets[i].name); |
@@ -123,9 +123,29 @@ int main(int argc, char **argv) | |||
123 | } | 123 | } |
124 | printf("};\n"); | 124 | printf("};\n"); |
125 | #endif | 125 | #endif |
126 | printf("#endif /* SKIP_definitions */\n"); | 126 | //printf("#endif /* SKIP_definitions */\n"); |
127 | printf("\n"); | 127 | printf("\n"); |
128 | printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN); | 128 | printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN); |
129 | 129 | ||
130 | if (argv[2]) { | ||
131 | char line_old[80]; | ||
132 | char line_new[80]; | ||
133 | FILE *fp; | ||
134 | |||
135 | line_old[0] = 0; | ||
136 | fp = fopen(argv[2], "r"); | ||
137 | if (fp) { | ||
138 | fgets(line_old, sizeof(line_old), fp); | ||
139 | fclose(fp); | ||
140 | } | ||
141 | sprintf(line_new, "#define NUM_APPLETS %u\n", NUM_APPLETS); | ||
142 | if (strcmp(line_old, line_new) != 0) { | ||
143 | fp = fopen(argv[2], "w"); | ||
144 | if (!fp) | ||
145 | return 1; | ||
146 | fputs(line_new, fp); | ||
147 | } | ||
148 | } | ||
149 | |||
130 | return 0; | 150 | return 0; |
131 | } | 151 | } |
diff --git a/applets/applets.c b/applets/applets.c index 133a21575..6a3996272 100644 --- a/applets/applets.c +++ b/applets/applets.c | |||
@@ -6,8 +6,6 @@ | |||
6 | * | 6 | * |
7 | * Licensed under GPLv2, see file License in this tarball for details. | 7 | * Licensed under GPLv2, see file License in this tarball for details. |
8 | */ | 8 | */ |
9 | |||
10 | #include <assert.h> | ||
11 | #include "busybox.h" | 9 | #include "busybox.h" |
12 | 10 | ||
13 | #if ENABLE_BUILD_LIBBUSYBOX | 11 | #if ENABLE_BUILD_LIBBUSYBOX |
diff --git a/applets/usage_compressed b/applets/usage_compressed index bfd5aa873..e1fd0d94d 100755 --- a/applets/usage_compressed +++ b/applets/usage_compressed | |||
@@ -9,7 +9,7 @@ test -x "$loc/usage" || exit 1 | |||
9 | test "$SED" || SED=sed | 9 | test "$SED" || SED=sed |
10 | test "$DD" || DD=dd | 10 | test "$DD" || DD=dd |
11 | 11 | ||
12 | exec >"$target" | 12 | exec >"$target.$$" |
13 | 13 | ||
14 | echo '#define UNPACKED_USAGE "" \' | 14 | echo '#define UNPACKED_USAGE "" \' |
15 | "$loc/usage" | od -v -t x1 \ | 15 | "$loc/usage" | od -v -t x1 \ |
@@ -39,3 +39,5 @@ echo '#define PACKED_USAGE \' | |||
39 | -e 's/\(..\)/0x\1,/g' \ | 39 | -e 's/\(..\)/0x\1,/g' \ |
40 | -e 's/$/ \\/' | 40 | -e 's/$/ \\/' |
41 | echo '' | 41 | echo '' |
42 | |||
43 | mv -- "$target.$$" "$target" | ||