From 1497484839efd4c57d63c07e2b92413193a3977f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 23 Mar 2010 01:08:26 +0100 Subject: ash,hush: make it possible to build them individually Signed-off-by: Denys Vlasenko --- shell/ash.c | 9 +++++---- shell/hush.c | 8 ++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'shell') 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 @@ #endif #include "busybox.h" /* for applet_names */ -//TODO: pull in some .h and find out do we have SINGLE_APPLET_MAIN? -//#include "applet_tables.h" doesn't work #include #include #include @@ -59,12 +57,15 @@ # define CLEAR_RANDOM_T(rnd) ((void)0) #endif -#if defined SINGLE_APPLET_MAIN +#define SKIP_definitions 1 +#include "applet_tables.h" +#undef SKIP_definitions +#if NUM_APPLETS == 1 /* STANDALONE does not make sense, and won't compile */ # undef CONFIG_FEATURE_SH_STANDALONE # undef ENABLE_FEATURE_SH_STANDALONE # undef IF_FEATURE_SH_STANDALONE -# undef IF_NOT_FEATURE_SH_STANDALONE(...) +# undef IF_NOT_FEATURE_SH_STANDALONE # define ENABLE_FEATURE_SH_STANDALONE 0 # define IF_FEATURE_SH_STANDALONE(...) # 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 @@ # define USE_FOR_MMU(...) #endif -#if defined SINGLE_APPLET_MAIN +#define SKIP_definitions 1 +#include "applet_tables.h" +#undef SKIP_definitions +#if NUM_APPLETS == 1 /* STANDALONE does not make sense, and won't compile */ # undef CONFIG_FEATURE_SH_STANDALONE # undef ENABLE_FEATURE_SH_STANDALONE # undef IF_FEATURE_SH_STANDALONE +# undef IF_NOT_FEATURE_SH_STANDALONE +# define ENABLE_FEATURE_SH_STANDALONE 0 # define IF_FEATURE_SH_STANDALONE(...) # define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__ -# define ENABLE_FEATURE_SH_STANDALONE 0 #endif #if !ENABLE_HUSH_INTERACTIVE -- cgit v1.2.3-55-g6feb