Commit Graph

80 Commits

Author SHA1 Message Date
Denis Vlasenko
15cb4a4272 fix a problem with two different applet_name's 2007-10-11 10:06:26 +00:00
Denis Vlasenko
9b49a5ed85 add -fvisibility=hidden to CC flags, mark XXX_main functions
EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
2007-10-11 10:05:36 +00:00
Denis Vlasenko
724d196c75 Move applets/applet.c into libbb, allows to get rid of --whole-archive
(smaller code). Tested in static and shared mode.
2007-10-10 14:41:07 +00:00
Denis Vlasenko
642a52d65e make --help work for "individual applets" too. 2007-10-07 21:00:41 +00:00
Denis Vlasenko
d62fd84d4b libbusybox: move (possibly compressed) help stuff into libbusybox.
Makes individual binaries much smaller.
2007-10-07 20:46:34 +00:00
Denis Vlasenko
03fc408de6 fix typo in comment 2007-04-11 07:36:31 +00:00
Denis Vlasenko
80d14beae9 Rename two config options:
FEATURE_SH_STANDALONE_SHELL => FEATURE_SH_STANDALONE
FEATURE_EXEC_PREFER_APPLETS => FEATURE_PREFER_APPLETS
Make SH_STANDALONE depend on PREFER_APPLETS.
getopt.c: more randomconfig-induced fixes
2007-04-10 23:03:30 +00:00
Denis Vlasenko
335b63d8d1 make a few struct bb_applet members conditional
rename sllep_and_die -> xfunc_die
make fflush_stdout_and_exit NOFORK-safe
fix some buglets found by randomconfig
2007-04-10 21:38:30 +00:00
Denis Vlasenko
c44ab01b75 Improve STANDALONE_SHELL. "safe" applets are renamed NOEXEC applets
and now this fact is recorded in applets.h, not ash.c.

Several fixes to "--help + STANDALONE_SHELL" scenarios.

function                                             old     new   delta
run_current_applet_and_exit                            -     355    +355
arith                                               2064    2073      +9
refresh                                             1148    1156      +8
getopt32                                            1068    1073      +5
telnet_main                                         1510    1514      +4
md5_sha1_sum_main                                    565     566      +1
xstrtoul_range_sfx                                   255     251      -4
packed_usage                                       22523   22514      -9
tryexec                                              255     203     -52
static.safe_applets                                  152       -    -152
.rodata                                           131320  131128    -192
run_applet_by_name                                   869     506    -363
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 5/5 up/down: 382/-772)         Total: -390 bytes

./busybox ash -c 'i=20000; while test $i != 0; do touch z; i=$((i-1)); done'
runs more than twice as fast with STANDALONE_SHELL versus without.
2007-04-09 03:11:58 +00:00
Denis Vlasenko
32b633aa3f merge busybox.c into applets.c 2007-04-09 03:05:48 +00:00
Denis Vlasenko
c7ba8b9d6c do not put all <applet>_main() declarations
in busybox.h - this produces false dependencies
2007-02-03 17:27:14 +00:00
Denis Vlasenko
765996aaea Cleanup usage messages (-200 bytes).
Remove busybox_main from applet table since
it is called via separate check
2006-12-24 16:59:27 +00:00
Denis Vlasenko
0ee3999d13 random tiny size savings 2006-12-24 15:23:28 +00:00
Denis Vlasenko
7d219aab70 build system overhaul 2006-10-05 10:17:08 +00:00
Paul Fox
6ba8bbe88a add ordering warning on enum Location 2006-06-09 12:25:10 +00:00
Rob Landley
b623a542df Header file cleanup. platform.h apparently needs to be included early on so it
can figure out what header files to include, and override stuff that comes
later.  But applets shouldn't include platform.h directly, they should include
busybox.h or libbb.h.  Since busybox.h already includes libbb.h, move libbb.h
to the top of busybox.h and platform.h near the top of libbb.h (right after
bbconfig.h, which is something platform.h also needs access to).

While we're at it, move some stuff from busybox.h to libbb.h so we have one
big file to audit/clean up/try to make sense of instead of many.
2006-05-31 22:09:03 +00:00
Bernhard Reutner-Fischer
e00fc16aaa - move libc checks from busybox.h to platform.h
- add ATTRIBUTE_ALWAYS_INLINE, endian handling for DEC UNIX, some more
  compiler dependent defines to platform.h
- add conditional bb_setpgrp define to platform.h
- remove superfluous specifying args from "#define fdprintf dprintf"
2006-05-26 13:10:10 +00:00
Bernhard Reutner-Fischer
421d9e5941 - move buffer allocation schemes to libbb.h
- include the correct headers: applets need busybox.h while lib* need libbb.h
2006-04-03 16:39:31 +00:00
"Vladimir N. Oleynik"
dd1ccddf1b moved BB_BANNER to applets/version.c file: make kernel like version,
removed depend loop: busybox.h depend with BB_BT, and all sources depend with busybox.h
2006-02-16 15:40:24 +00:00
Bernhard Reutner-Fischer
86f5c9906b - add platform.h.
- use shorter boilerplate while at it.
2006-01-22 22:55:11 +00:00
"Vladimir N. Oleynik"
843c5ef0f9 reorder include <sys/types.h> and <sys/types.h>. 2005-09-29 07:55:51 +00:00
Bernhard Reutner-Fischer
d4cffd1cc3 - make sure to include dmalloc.h at the very end of busybox.h or libbb.h. 2005-09-21 17:38:30 +00:00
Rob Landley
193c8c7383 #ifdef reduction infrastructure, based on an argument between Shaun Jackman,
Rob Landley, and others.

Currently CONFIG options are defined or undefined, so we chop out code with
#ifdefs, ala:
#ifdef CONFIG_THING
  stuff();
#endif

This creates a new header file, bb_config.h, which sets the CONFIG entry to 1
or 0, and lets us do:

  if(CONFIG_THING) stuff();

And let the compiler do dead code elimination to get rid of it.  (Note: #ifdef
will still work because for the 1 case it's a static const int, not a #define.)
2005-07-27 06:55:36 +00:00
Mike Frysinger
ca1b6fc745 newlib fixe from Shaun Jackman 2005-03-04 01:09:43 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Manuel Novoa III
68474f3b36 Make sure stdlib.h is always included before dmalloc.h to avoid problems
parsing problems.
2004-02-05 14:45:58 +00:00
Glenn L McGrath
7c87b67c08 Patch from Bastian Blank, allow the buildtime to be overriden with a
different string, used by the debian busybox-cvs to specify the debian
date based version number.
2004-01-13 10:57:32 +00:00
Eric Andersen
85e5e72bc1 Remove remaining libc5 support code 2003-07-22 08:56:55 +00:00
Glenn L McGrath
a88cb5025c Patch from mathuria, compatability with solaris 2003-02-08 23:36:16 +00:00
Glenn L McGrath
60a22addea Remove unwanted comments, run through indent 2002-08-22 15:54:22 +00:00
Robert Griebl
c9aca4561d Implement two types of suid/sgid support for BusyBox:
1) tinylogin like with compile time selection and a chown root.root
2) Runtime configurable via /etc/busybox.conf (docu is in the works)
[Parts of this patch may overlap with my other two patches]
2002-06-04 20:06:25 +00:00
Eric Andersen
38ddbed4c1 Try to pull in PATH_MAX properly 2002-03-16 02:12:30 +00:00
Eric Andersen
20d739adf7 If PATH_MAX isn't defined, define it outselves 2002-01-26 23:58:22 +00:00
Eric Andersen
bdfd0d78bc Major rework of the directory structure and the entire build system.
-Erik
2001-10-24 05:00:29 +00:00
Matt Kraai
c1cda4a609 Add a RELEASE_BB_BUFFER macro and use it to fix a memory leak in syslogd.c
(noted by Adam Slattery).
2001-07-19 15:00:14 +00:00
Matt Kraai
9ff9325e60 Move applet_name declaration from busybox.h to libbb.h. 2001-04-24 01:12:33 +00:00
Mark Whitley
3e310ac309 Applied patch from Larry Doolittle to give users the third option of putting
buffers in BSS (in addition to stack and heap).
2001-04-20 17:40:33 +00:00
Matt Kraai
6ba1a80c26 Use date -u instead of date --utc and consolidate version string.
Patch by Larry Doolittle <ldoolitt@recycle.lbl.gov>.
2001-04-12 20:11:55 +00:00
Mark Whitley
5cd2a2d53e In fact, socklen_t *is* defined by libc5. 2001-03-27 18:22:00 +00:00
Eric Andersen
aad1a88c76 Convert utility.c into libbb.a. It is now a whole pile of .c
files.  Clean up the resulting damage and fix up the makefile.
 -Erik
2001-03-16 22:47:14 +00:00
Eric Andersen
2b1c367a98 Amazing the difference between an "and" and an "or". 2001-03-14 01:36:52 +00:00
Eric Andersen
c319601db5 Some updates for libc5 2001-03-14 01:15:06 +00:00
Mark Whitley
e0bf91d7c6 Applied patch from Christophe Boyanique to add -i support to rm. 2001-03-13 00:40:19 +00:00
Mark Whitley
6317c4baf7 Applied patch from Gennady Feldman to split up syslogd.c into syslogd and
klogd (as it should be).
2001-03-12 22:51:50 +00:00
Eric Andersen
13d1fa1d01 Add in 'trim' routine. Fix up sh.c so it works when wordexp
is not available.
 -Erik
2001-03-08 23:59:45 +00:00
Mark Whitley
4cc8f31ffe Changed KILOBYTE, MEGABYTE, and GIGABYTE from #define to enum. 2001-03-07 18:00:44 +00:00
Mark Whitley
ae5612ca6e Some minor cleanups to df.c. Also, with Erik's blessing, changed name of
'format' function to 'make_human_readable_str'.
2001-03-07 17:42:07 +00:00
Mark Whitley
39842defda Applied patch from David Douthitt to fix build error in df.c when
BB_FEATURE_HUMAN_READABLE was disabled.
2001-03-01 18:51:33 +00:00
Eric Andersen
4142d4dc66 Patch from Vladimir N. Oleynik to save 128 bytes by moving error
checking for some my_* functions to utility.c
2001-02-27 18:22:03 +00:00
Eric Andersen
c163e5107f Turn off the printf attribute for the ?error_msg* functions, since it
is ok to pass them a NULL, unlike printf.  This silences a pointless
warning message.
 -Erik
2001-02-22 23:38:48 +00:00