build system: FEATURE_LIBBUSYBOX_STATIC - try to pull libc/libm into libbusybox
[oweals/busybox.git] / Config.in
1 #
2 # For a description of the syntax of this configuration file,
3 # see scripts/kbuild/config-language.txt.
4 #
5
6 mainmenu "BusyBox Configuration"
7
8 config HAVE_DOT_CONFIG
9         bool
10         default y
11
12 menu "Busybox Settings"
13
14 config DESKTOP
15         bool "Enable options for full-blown desktop systems"
16         default y
17         help
18           Enable options and features which are not essential.
19           Select this if you plan to use busybox on full-blown desktop machine
20           with common Linux distro, which needs higher level of command-line
21           compatibility.
22
23           If you are preparing your build to be used on an embedded box
24           where you have tighter control over the entire set of userspace
25           tools, you can unselect this option for smaller code size.
26
27 config EXTRA_COMPAT
28         bool "Provide compatible behavior for rare corner cases (bigger code)"
29         default n
30         help
31           This option makes grep, sed etc handle rare corner cases
32           (embedded NUL bytes and such). This makes code bigger and uses
33           some GNU extensions in libc. You probably only need this option
34           if you plan to run busybox on desktop.
35
36 config INCLUDE_SUSv2
37         bool "Enable obsolete features removed before SUSv3"
38         default y
39         help
40           This option will enable backwards compatibility with SuSv2,
41           specifically, old-style numeric options ('command -1 <file>')
42           will be supported in head, tail, and fold. (Note: should
43           affect renice too.)
44
45 config USE_PORTABLE_CODE
46         bool "Avoid using GCC-specific code constructs"
47         default n
48         help
49           Use this option if you are trying to compile busybox with
50           compiler other than gcc.
51           If you do use gcc, this option may needlessly increase code size.
52
53 config SHOW_USAGE
54         bool "Show applet usage messages"
55         default y
56         help
57           Enabling this option, BusyBox applets will show terse help messages
58           when invoked with wrong arguments.
59           If you do not want to show any (helpful) usage message when
60           issuing wrong command syntax, you can say 'N' here,
61           saving approximately 7k.
62
63 config FEATURE_VERBOSE_USAGE
64         bool "Show verbose applet usage messages"
65         default y
66         depends on SHOW_USAGE
67         help
68           All BusyBox applets will show verbose help messages when
69           busybox is invoked with --help. This will add a lot of text to the
70           busybox binary. In the default configuration, this will add about
71           13k, but it can add much more depending on your configuration.
72
73 config FEATURE_COMPRESS_USAGE
74         bool "Store applet usage messages in compressed form"
75         default y
76         depends on SHOW_USAGE
77         help
78           Store usage messages in .bz compressed form, uncompress them
79           on-the-fly when <applet> --help is called.
80
81           If you have a really tiny busybox with few applets enabled (and
82           bunzip2 isn't one of them), the overhead of the decompressor might
83           be noticeable. Also, if you run executables directly from ROM
84           and have very little memory, this might not be a win. Otherwise,
85           you probably want this.
86
87 config BUSYBOX
88         bool "Include busybox applet"
89         default y
90         help
91           The busybox applet provides general help regarding busybox and
92           allows the included applets to be listed.  It's also required
93           if applet links are to be installed at runtime.
94
95           If you can live without these features disabling this will save
96           some space.
97
98 config FEATURE_INSTALLER
99         bool "Support --install [-s] to install applet links at runtime"
100         default y
101         depends on BUSYBOX
102         help
103           Enable 'busybox --install [-s]' support. This will allow you to use
104           busybox at runtime to create hard links or symlinks for all the
105           applets that are compiled into busybox.
106
107 config INSTALL_NO_USR
108         bool "Don't use /usr"
109         default n
110         help
111           Disable use of /usr. busybox --install and "make install"
112           will install applets only to /bin and /sbin,
113           never to /usr/bin or /usr/sbin.
114
115 config PAM
116         bool "Support PAM (Pluggable Authentication Modules)"
117         default n
118         help
119           Use PAM in some busybox applets (currently login and httpd) instead
120           of direct access to password database.
121
122 config LONG_OPTS
123         bool "Support --long-options"
124         default y
125         help
126           Enable this if you want busybox applets to use the gnu --long-option
127           style, in addition to single character -a -b -c style options.
128
129 config FEATURE_DEVPTS
130         bool "Use the devpts filesystem for Unix98 PTYs"
131         default y
132         help
133           Enable if you want BusyBox to use Unix98 PTY support. If enabled,
134           busybox will use /dev/ptmx for the master side of the pseudoterminal
135           and /dev/pts/<number> for the slave side. Otherwise, BSD style
136           /dev/ttyp<number> will be used. To use this option, you should have
137           devpts mounted.
138
139 config FEATURE_CLEAN_UP
140         bool "Clean up all memory before exiting (usually not needed)"
141         default n
142         help
143           As a size optimization, busybox normally exits without explicitly
144           freeing dynamically allocated memory or closing files. This saves
145           space since the OS will clean up for us, but it can confuse debuggers
146           like valgrind, which report tons of memory and resource leaks.
147
148           Don't enable this unless you have a really good reason to clean
149           things up manually.
150
151 config FEATURE_UTMP
152         bool "Support utmp file"
153         default y
154         help
155           The file /var/run/utmp is used to track who is currently logged in.
156           With this option on, certain applets (getty, login, telnetd etc)
157           will create and delete entries there.
158           "who" applet requires this option.
159
160 config FEATURE_WTMP
161         bool "Support wtmp file"
162         default y
163         depends on FEATURE_UTMP
164         help
165           The file /var/run/wtmp is used to track when users have logged into
166           and logged out of the system.
167           With this option on, certain applets (getty, login, telnetd etc)
168           will append new entries there.
169           "last" applet requires this option.
170
171 config FEATURE_PIDFILE
172         bool "Support writing pidfiles"
173         default y
174         help
175           This option makes some applets (e.g. crond, syslogd, inetd) write
176           a pidfile at the configured PID_FILE_PATH.  It has no effect
177           on applets which require pidfiles to run.
178
179 config PID_FILE_PATH
180         string "Path to directory for pidfile"
181         default "/var/run"
182         depends on FEATURE_PIDFILE
183         help
184           This is the default path where pidfiles are created.  Applets which
185           allow you to set the pidfile path on the command line will override
186           this value.  The option has no effect on applets that require you to
187           specify a pidfile path.
188
189 config FEATURE_SUID
190         bool "Support SUID/SGID handling"
191         default y
192         help
193           With this option you can install the busybox binary belonging
194           to root with the suid bit set, enabling some applets to perform
195           root-level operations even when run by ordinary users
196           (for example, mounting of user mounts in fstab needs this).
197
198           Busybox will automatically drop privileges for applets
199           that don't need root access.
200
201           If you are really paranoid and don't want to do this, build two
202           busybox binaries with different applets in them (and the appropriate
203           symlinks pointing to each binary), and only set the suid bit on the
204           one that needs it.
205
206           The applets which require root rights (need suid bit or
207           to be run by root) and will refuse to execute otherwise:
208           crontab, login, passwd, su, vlock, wall.
209
210           The applets which will use root rights if they have them
211           (via suid bit, or because run by root), but would try to work
212           without root right nevertheless:
213           findfs, ping[6], traceroute[6], mount.
214
215           Note that if you DONT select this option, but DO make busybox
216           suid root, ALL applets will run under root, which is a huge
217           security hole (think "cp /some/file /etc/passwd").
218
219 config FEATURE_SUID_CONFIG
220         bool "Runtime SUID/SGID configuration via /etc/busybox.conf"
221         default y
222         depends on FEATURE_SUID
223         help
224           Allow the SUID / SGID state of an applet to be determined at runtime
225           by checking /etc/busybox.conf. (This is sort of a poor man's sudo.)
226           The format of this file is as follows:
227
228           APPLET = [Ssx-][Ssx-][x-] [USER.GROUP]
229
230           s: USER or GROUP is allowed to execute APPLET.
231              APPLET will run under USER or GROUP
232              (reagardless of who's running it).
233           S: USER or GROUP is NOT allowed to execute APPLET.
234              APPLET will run under USER or GROUP.
235              This option is not very sensical.
236           x: USER/GROUP/others are allowed to execute APPLET.
237              No UID/GID change will be done when it is run.
238           -: USER/GROUP/others are not allowed to execute APPLET.
239
240           An example might help:
241
242           [SUID]
243           su = ssx root.0 # applet su can be run by anyone and runs with
244                           # euid=0/egid=0
245           su = ssx        # exactly the same
246
247           mount = sx- root.disk # applet mount can be run by root and members
248                                 # of group disk (but not anyone else)
249                                 # and runs with euid=0 (egid is not changed)
250
251           cp = --- # disable applet cp for everyone
252
253           The file has to be owned by user root, group root and has to be
254           writeable only by root:
255                 (chown 0.0 /etc/busybox.conf; chmod 600 /etc/busybox.conf)
256           The busybox executable has to be owned by user root, group
257           root and has to be setuid root for this to work:
258                 (chown 0.0 /bin/busybox; chmod 4755 /bin/busybox)
259
260           Robert 'sandman' Griebl has more information here:
261           <url: http://www.softforge.de/bb/suid.html >.
262
263 config FEATURE_SUID_CONFIG_QUIET
264         bool "Suppress warning message if /etc/busybox.conf is not readable"
265         default y
266         depends on FEATURE_SUID_CONFIG
267         help
268           /etc/busybox.conf should be readable by the user needing the SUID,
269           check this option to avoid users to be notified about missing
270           permissions.
271
272 config SELINUX
273         bool "Support NSA Security Enhanced Linux"
274         default n
275         select PLATFORM_LINUX
276         help
277           Enable support for SELinux in applets ls, ps, and id. Also provide
278           the option of compiling in SELinux applets.
279
280           If you do not have a complete SELinux userland installed, this stuff
281           will not compile.  Specifially, libselinux 1.28 or better is
282           directly required by busybox. If the installation is located in a
283           non-standard directory, provide it by invoking make as follows:
284                 CFLAGS=-I<libselinux-include-path> \
285                 LDFLAGS=-L<libselinux-lib-path> \
286                 make
287
288           Most people will leave this set to 'N'.
289
290 config FEATURE_PREFER_APPLETS
291         bool "exec prefers applets"
292         default n
293         help
294           This is an experimental option which directs applets about to
295           call 'exec' to try and find an applicable busybox applet before
296           searching the PATH. This is typically done by exec'ing
297           /proc/self/exe.
298           This may affect shell, find -exec, xargs and similar applets.
299           They will use applets even if /bin/<applet> -> busybox link
300           is missing (or is not a link to busybox). However, this causes
301           problems in chroot jails without mounted /proc and with ps/top
302           (command name can be shown as 'exe' for applets started this way).
303
304 config BUSYBOX_EXEC_PATH
305         string "Path to BusyBox executable"
306         default "/proc/self/exe"
307         help
308           When Busybox applets need to run other busybox applets, BusyBox
309           sometimes needs to exec() itself. When the /proc filesystem is
310           mounted, /proc/self/exe always points to the currently running
311           executable. If you haven't got /proc, set this to wherever you
312           want to run BusyBox from.
313
314 # These are auto-selected by other options
315
316 config FEATURE_SYSLOG
317         bool #No description makes it a hidden option
318         default n
319         #help
320         #  This option is auto-selected when you select any applet which may
321         #  send its output to syslog. You do not need to select it manually.
322
323 config FEATURE_HAVE_RPC
324         bool #No description makes it a hidden option
325         default n
326         #help
327         #  This is automatically selected if any of enabled applets need it.
328         #  You do not need to select it manually.
329
330 config PLATFORM_LINUX
331         bool #No description makes it a hidden option
332         default n
333         #help
334         #  For the most part, busybox requires only POSIX compatibility
335         #  from the target system, but some applets and features use
336         #  Linux-specific interfaces.
337         #
338         #  This is automatically selected if any applet or feature requires
339         #  Linux-specific interfaces. You do not need to select it manually.
340
341 comment 'Build Options'
342
343 config STATIC
344         bool "Build BusyBox as a static binary (no shared libs)"
345         default n
346         help
347           If you want to build a static BusyBox binary, which does not
348           use or require any shared libraries, then enable this option.
349           This can cause BusyBox to be considerably larger, so you should
350           leave this option false unless you have a good reason (i.e.
351           your target platform does not support shared libraries, or
352           you are building an initrd which doesn't need anything but
353           BusyBox, etc).
354
355           Most people will leave this set to 'N'.
356
357 config PIE
358         bool "Build BusyBox as a position independent executable"
359         default n
360         depends on !STATIC
361         help
362           Hardened code option. PIE binaries are loaded at a different
363           address at each invocation. This has some overhead,
364           particularly on x86-32 which is short on registers.
365
366           Most people will leave this set to 'N'.
367
368 config NOMMU
369         bool "Force NOMMU build"
370         default n
371         help
372           Busybox tries to detect whether architecture it is being
373           built against supports MMU or not. If this detection fails,
374           or if you want to build NOMMU version of busybox for testing,
375           you may force NOMMU build here.
376
377           Most people will leave this set to 'N'.
378
379 # PIE can be made to work with BUILD_LIBBUSYBOX, but currently
380 # build system does not support that
381 config BUILD_LIBBUSYBOX
382         bool "Build shared libbusybox"
383         default n
384         depends on !FEATURE_PREFER_APPLETS && !PIE && !STATIC
385         help
386           Build a shared library libbusybox.so.N.N.N which contains all
387           busybox code.
388
389           This feature allows every applet to be built as a really tiny
390           separate executable linked against the library:
391
392           $ size 0_lib/l*
393             text  data   bss     dec    hex filename
394              939   212    28    1179    49b 0_lib/last
395              939   212    28    1179    49b 0_lib/less
396           919138  8328  1556  929022  e2cfe 0_lib/libbusybox.so.1.N.M
397
398           This is useful on NOMMU systems which are not capable
399           of sharing executables, but are capable of sharing code
400           in dynamic libraries.
401
402 config FEATURE_LIBBUSYBOX_STATIC
403         bool "Pull in all external references into libbusybox"
404         default n
405         depends on BUILD_LIBBUSYBOX
406         help
407           Make libbusybox library independent, not using or requiring
408           any other shared libraries.
409
410 config FEATURE_INDIVIDUAL
411         bool "Produce a binary for each applet, linked against libbusybox"
412         default y
413         depends on BUILD_LIBBUSYBOX
414         help
415           If your CPU architecture doesn't allow for sharing text/rodata
416           sections of running binaries, but allows for runtime dynamic
417           libraries, this option will allow you to reduce memory footprint
418           when you have many different applets running at once.
419
420           If your CPU architecture allows for sharing text/rodata,
421           having single binary is more optimal.
422
423           Each applet will be a tiny program, dynamically linked
424           against libbusybox.so.N.N.N.
425
426           You need to have a working dynamic linker.
427
428 config FEATURE_SHARED_BUSYBOX
429         bool "Produce additional busybox binary linked against libbusybox"
430         default y
431         depends on BUILD_LIBBUSYBOX
432         help
433           Build busybox, dynamically linked against libbusybox.so.N.N.N.
434
435           You need to have a working dynamic linker.
436
437 ### config BUILD_AT_ONCE
438 ###     bool "Compile all sources at once"
439 ###     default n
440 ###     help
441 ###       Normally each source-file is compiled with one invocation of
442 ###       the compiler.
443 ###       If you set this option, all sources are compiled at once.
444 ###       This gives the compiler more opportunities to optimize which can
445 ###       result in smaller and/or faster binaries.
446 ###
447 ###       Setting this option will consume alot of memory, e.g. if you
448 ###       enable all applets with all features, gcc uses more than 300MB
449 ###       RAM during compilation of busybox.
450 ###
451 ###       This option is most likely only beneficial for newer compilers
452 ###       such as gcc-4.1 and above.
453 ###
454 ###       Say 'N' unless you know what you are doing.
455
456 config LFS
457         bool "Build with Large File Support (for accessing files > 2 GB)"
458         default y
459         help
460           If you want to build BusyBox with large file support, then enable
461           this option. This will have no effect if your kernel or your C
462           library lacks large file support for large files. Some of the
463           programs that can benefit from large file support include dd, gzip,
464           cp, mount, tar, and many others. If you want to access files larger
465           than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'.
466
467 config CROSS_COMPILER_PREFIX
468         string "Cross Compiler prefix"
469         default ""
470         help
471           If you want to build BusyBox with a cross compiler, then you
472           will need to set this to the cross-compiler prefix, for example,
473           "i386-uclibc-".
474
475           Note that CROSS_COMPILE environment variable or
476           "make CROSS_COMPILE=xxx ..." will override this selection.
477
478           Native builds leave this empty.
479
480 config SYSROOT
481         string "Path to sysroot"
482         default ""
483         help
484           If you want to build BusyBox with a cross compiler, then you
485           might also need to specify where /usr/include and /usr/lib
486           will be found.
487
488           For example, BusyBox can be built against an installed
489           Android NDK, platform version 9, for ARM ABI with
490
491           CONFIG_SYSROOT=/opt/android-ndk/platforms/android-9/arch-arm
492
493           Native builds leave this empty.
494
495 config EXTRA_CFLAGS
496         string "Additional CFLAGS"
497         default ""
498         help
499           Additional CFLAGS to pass to the compiler verbatim.
500
501 config EXTRA_LDFLAGS
502         string "Additional LDFLAGS"
503         default ""
504         help
505           Additional LDFLAGS to pass to the linker verbatim.
506
507 config EXTRA_LDLIBS
508         string "Additional LDLIBS"
509         default ""
510         help
511           Additional LDLIBS to pass to the linker with -l.
512
513 comment 'Installation Options ("make install" behavior)'
514
515 choice
516         prompt "What kind of applet links to install"
517         default INSTALL_APPLET_SYMLINKS
518         help
519           Choose what kind of links to applets are created by "make install".
520
521 config INSTALL_APPLET_SYMLINKS
522         bool "as soft-links"
523         help
524           Install applets as soft-links to the busybox binary. This needs some
525           free inodes on the filesystem, but might help with filesystem
526           generators that can't cope with hard-links.
527
528 config INSTALL_APPLET_HARDLINKS
529         bool "as hard-links"
530         help
531           Install applets as hard-links to the busybox binary. This might
532           count on a filesystem with few inodes.
533
534 config INSTALL_APPLET_SCRIPT_WRAPPERS
535         bool "as script wrappers"
536         help
537           Install applets as script wrappers that call the busybox binary.
538
539 config INSTALL_APPLET_DONT
540         bool "not installed"
541         help
542           Do not install applet links. Useful when you plan to use
543           busybox --install for installing links, or plan to use
544           a standalone shell and thus don't need applet links.
545
546 endchoice
547
548 choice
549         prompt "/bin/sh applet link"
550         default INSTALL_SH_APPLET_SYMLINK
551         depends on INSTALL_APPLET_SCRIPT_WRAPPERS
552         help
553           Choose how you install /bin/sh applet link.
554
555 config INSTALL_SH_APPLET_SYMLINK
556         bool "as soft-link"
557         help
558           Install /bin/sh applet as soft-link to the busybox binary.
559
560 config INSTALL_SH_APPLET_HARDLINK
561         bool "as hard-link"
562         help
563           Install /bin/sh applet as hard-link to the busybox binary.
564
565 config INSTALL_SH_APPLET_SCRIPT_WRAPPER
566         bool "as script wrapper"
567         help
568           Install /bin/sh applet as script wrapper that calls
569           the busybox binary.
570
571 endchoice
572
573 config PREFIX
574         string "BusyBox installation prefix"
575         default "./_install"
576         help
577           Define your directory to install BusyBox files/subdirs in.
578
579 comment 'Debugging Options'
580
581 config DEBUG
582         bool "Build BusyBox with extra Debugging symbols"
583         default n
584         help
585           Say Y here if you wish to examine BusyBox internals while applets are
586           running. This increases the size of the binary considerably, and
587           should only be used when doing development. If you are doing
588           development and want to debug BusyBox, answer Y.
589
590           Most people should answer N.
591
592 config DEBUG_PESSIMIZE
593         bool "Disable compiler optimizations"
594         default n
595         depends on DEBUG
596         help
597           The compiler's optimization of source code can eliminate and reorder
598           code, resulting in an executable that's hard to understand when
599           stepping through it with a debugger. This switches it off, resulting
600           in a much bigger executable that more closely matches the source
601           code.
602
603 config DEBUG_SANITIZE
604         bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)"
605         default n
606         help
607           Say Y here if you want to enable runtime sanitizers. These help
608           catch bad memory accesses (e.g. buffer overflows), but will make
609           the executable larger and slow down runtime a bit.
610
611           This adds -fsanitize=foo options to gcc command line.
612
613           If you aren't developing/testing busybox, say N here.
614
615 config UNIT_TEST
616         bool "Build unit tests"
617         default n
618         help
619           Say Y here if you want to build unit tests (both the framework and
620           test cases) as a Busybox applet. This results in bigger code, so you
621           probably don't want this option in production builds.
622
623 config WERROR
624         bool "Abort compilation on any warning"
625         default n
626         help
627           This adds -Werror to gcc command line.
628
629           Most people should answer N.
630
631 choice
632         prompt "Additional debugging library"
633         default NO_DEBUG_LIB
634         help
635           Using an additional debugging library will make BusyBox become
636           considerable larger and will cause it to run more slowly. You
637           should always leave this option disabled for production use.
638
639           dmalloc support:
640           ----------------
641           This enables compiling with dmalloc ( http://dmalloc.com/ )
642           which is an excellent public domain mem leak and malloc problem
643           detector. To enable dmalloc, before running busybox you will
644           want to properly set your environment, for example:
645             export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
646           The 'debug=' value is generated using the following command
647             dmalloc -p log-stats -p log-non-free -p log-bad-space \
648                -p log-elapsed-time -p check-fence -p check-heap \
649                -p check-lists -p check-blank -p check-funcs -p realloc-copy \
650                -p allow-free-null
651
652           Electric-fence support:
653           -----------------------
654           This enables compiling with Electric-fence support. Electric
655           fence is another very useful malloc debugging library which uses
656           your computer's virtual memory hardware to detect illegal memory
657           accesses. This support will make BusyBox be considerable larger
658           and run slower, so you should leave this option disabled unless
659           you are hunting a hard to find memory problem.
660
661
662 config NO_DEBUG_LIB
663         bool "None"
664
665 config DMALLOC
666         bool "Dmalloc"
667
668 config EFENCE
669         bool "Electric-fence"
670
671 endchoice
672
673 endmenu
674
675 source libbb/Config.in
676
677 comment "Applets"
678
679 source archival/Config.in
680 source coreutils/Config.in
681 source console-tools/Config.in
682 source debianutils/Config.in
683 source editors/Config.in
684 source findutils/Config.in
685 source init/Config.in
686 source loginutils/Config.in
687 source e2fsprogs/Config.in
688 source modutils/Config.in
689 source util-linux/Config.in
690 source miscutils/Config.in
691 source networking/Config.in
692 source printutils/Config.in
693 source mailutils/Config.in
694 source procps/Config.in
695 source runit/Config.in
696 source selinux/Config.in
697 source shell/Config.in
698 source sysklogd/Config.in