The configure system's save function edited out sub-menus that wouldn't be
displayed in the current configuration, meaning config.h wouldn't have #udef
entries for those symbols, meaning bb_config.h would have the relevant
ENABLE_ missing instead of defined to 0. This broke the build.
So I fixed it, and then reorganized the applets.c and busybox.c to take
away the warnings this revealed (code that would be optimized out was making
calls to functions that hadn't been prototyped. So I added an #else case
to those #ifdefs to #define the relevant functions to empty macros to
placate the warnings.
I also reorganized the applets.c code to make adding such an #else case less
of a pain (and make the need for prototyping go away by moving the functions
up before they were used, and generally wind up with fewer #ifdefs in
the code by putting all the logic in one place). This resulted in a huge
seeming patch, when most if it just moves code from one place to another
without touching it...
Upside: make allyesconfig and make allnoconfig should both work now.
(I.E. any argv[0] that starts with "busybox" winds up in busybox_main().)
Added testing/busybox.tests which tests the following permutations:
./busybox
./busybox-suffix
./busybox cat
./busybox-suffix cat
./busybox --help
./busybox-suffix --help
./busybox --help cat
./busybox-suffix --help cat
./busybox --help unknown
./busybox-suffix --help unknown
./unknown
Also repair the test suite so ./runtest calls the ".tests" scripts properly.
Note: you can now go "busybox busybox busbox ls -l" and it'll take it. The
new code is pretty generic. I can block that if anybody can come up with a
good reason to...
Very minimal last corrections:
1) busybox.c: fix warining
2) docs/: add applets for list from pwd_grp
3) usage.h: add -n option for route
4) run_parts.c: many todo fix for busybox style
5) addgroup.c: add #ifdef CONFIG_FEATURE_SHADOWPASSWDS, reduce one
perror_msg
6) adduser.c: fix bug "variable i not initialize" and
add #ifdef CONFIG_FEATURE_SHADOWPASSWDS
make it general. Now all leading single hyphens are ignored for
purposed of applet name matching, while argv[0] is still passed
unaltered to applets, so leading-hyphen sensitive applets (such as sh)
can react accordingly.
-Erik
This way, we can new get rid of all that tedious #define rubbish we used to
need to enable specific messages. This way is enormously simpler, and as a
bonus also ends up saving us 96 bytes.
-Erik
busybox.h which slowed compiles. I left only what was needed and then fixed up
all the apps to include their own header files. I also fixed naming for pwd.h
and grp.h functions. Tested to compile and run with libc5, glibc, and uClibc.
-Erik