aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-03-23 01:08:26 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-03-23 01:08:26 +0100
commit1497484839efd4c57d63c07e2b92413193a3977f (patch)
tree5287750a4c55b433f73c3636d8aa8cffe6ecc71b
parent85dbf190c69f747cea3f8cdabecb3464ab1351be (diff)
downloadbusybox-w32-1497484839efd4c57d63c07e2b92413193a3977f.tar.gz
busybox-w32-1497484839efd4c57d63c07e2b92413193a3977f.tar.bz2
busybox-w32-1497484839efd4c57d63c07e2b92413193a3977f.zip
ash,hush: make it possible to build them individually
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--applets/applet_tables.c6
-rw-r--r--shell/ash.c9
-rw-r--r--shell/hush.c8
3 files changed, 15 insertions, 8 deletions
diff --git a/applets/applet_tables.c b/applets/applet_tables.c
index e67f017e7..e48be4682 100644
--- a/applets/applet_tables.c
+++ b/applets/applet_tables.c
@@ -79,6 +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("const char applet_names[] ALIGN1 = \"\"\n"); 83 printf("const char applet_names[] ALIGN1 = \"\"\n");
83 for (i = 0; i < NUM_APPLETS; i++) { 84 for (i = 0; i < NUM_APPLETS; i++) {
84 printf("\"%s\" \"\\0\"\n", applets[i].name); 85 printf("\"%s\" \"\\0\"\n", applets[i].name);
@@ -120,9 +121,10 @@ int main(int argc, char **argv)
120 printf("0x%02x,\n", v); 121 printf("0x%02x,\n", v);
121 i++; 122 i++;
122 } 123 }
123 printf("};\n\n"); 124 printf("};\n");
124#endif 125#endif
125 126 printf("#endif /* SKIP_definitions */\n");
127 printf("\n");
126 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);
127 129
128 return 0; 130 return 0;
diff --git a/shell/ash.c b/shell/ash.c
index ce82a965c..e2851305b 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -43,8 +43,6 @@
43#endif 43#endif
44 44
45#include "busybox.h" /* for applet_names */ 45#include "busybox.h" /* for applet_names */
46//TODO: pull in some .h and find out do we have SINGLE_APPLET_MAIN?
47//#include "applet_tables.h" doesn't work
48#include <paths.h> 46#include <paths.h>
49#include <setjmp.h> 47#include <setjmp.h>
50#include <fnmatch.h> 48#include <fnmatch.h>
@@ -59,12 +57,15 @@
59# define CLEAR_RANDOM_T(rnd) ((void)0) 57# define CLEAR_RANDOM_T(rnd) ((void)0)
60#endif 58#endif
61 59
62#if defined SINGLE_APPLET_MAIN 60#define SKIP_definitions 1
61#include "applet_tables.h"
62#undef SKIP_definitions
63#if NUM_APPLETS == 1
63/* STANDALONE does not make sense, and won't compile */ 64/* STANDALONE does not make sense, and won't compile */
64# undef CONFIG_FEATURE_SH_STANDALONE 65# undef CONFIG_FEATURE_SH_STANDALONE
65# undef ENABLE_FEATURE_SH_STANDALONE 66# undef ENABLE_FEATURE_SH_STANDALONE
66# undef IF_FEATURE_SH_STANDALONE 67# undef IF_FEATURE_SH_STANDALONE
67# undef IF_NOT_FEATURE_SH_STANDALONE(...) 68# undef IF_NOT_FEATURE_SH_STANDALONE
68# define ENABLE_FEATURE_SH_STANDALONE 0 69# define ENABLE_FEATURE_SH_STANDALONE 0
69# define IF_FEATURE_SH_STANDALONE(...) 70# define IF_FEATURE_SH_STANDALONE(...)
70# define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__ 71# define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__
diff --git a/shell/hush.c b/shell/hush.c
index 6f391b881..048085b3e 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -125,14 +125,18 @@
125# define USE_FOR_MMU(...) 125# define USE_FOR_MMU(...)
126#endif 126#endif
127 127
128#if defined SINGLE_APPLET_MAIN 128#define SKIP_definitions 1
129#include "applet_tables.h"
130#undef SKIP_definitions
131#if NUM_APPLETS == 1
129/* STANDALONE does not make sense, and won't compile */ 132/* STANDALONE does not make sense, and won't compile */
130# undef CONFIG_FEATURE_SH_STANDALONE 133# undef CONFIG_FEATURE_SH_STANDALONE
131# undef ENABLE_FEATURE_SH_STANDALONE 134# undef ENABLE_FEATURE_SH_STANDALONE
132# undef IF_FEATURE_SH_STANDALONE 135# undef IF_FEATURE_SH_STANDALONE
136# undef IF_NOT_FEATURE_SH_STANDALONE
137# define ENABLE_FEATURE_SH_STANDALONE 0
133# define IF_FEATURE_SH_STANDALONE(...) 138# define IF_FEATURE_SH_STANDALONE(...)
134# define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__ 139# define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__
135# define ENABLE_FEATURE_SH_STANDALONE 0
136#endif 140#endif
137 141
138#if !ENABLE_HUSH_INTERACTIVE 142#if !ENABLE_HUSH_INTERACTIVE