aboutsummaryrefslogtreecommitdiff
path: root/scripts (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeRon Yorston2023-04-091-1/+5
|\
| * fixdep: avoid underflow when end of entry doesn't coincide with EOFArsen Arsenović2023-02-271-0/+5
| | | | | | | | | | | | | | Bug: https://bugs.gentoo.org/893776 Closes: https://bugs.busybox.net/show_bug.cgi?id=15326 Signed-off-by: Arsen Arsenović <arsen@gentoo.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | build system: allow monochrome 'make menuconfig'Ron Yorston2022-11-161-0/+3
| | | | | | | | | | | | | | | | | | 'make menuconfig' uses a hardcoded colour palette which may be difficult to read. Add support for the 'COLORS' environment variable. Setting this to '0' will cause 'make menuconfig' to be displayed in black and white. (GitHub issue #273)
* | win32: native make menuconfig: support searchAvi Halachmi (:avih)2022-11-131-5/+21
| | | | | | | | | | | | | | Previously, pressing slash to search at the menu aborted the menu program ('mconf'), because regexp is not available with native mingw. Now it works, but the search is of plain string rather than regexp.
* | build system: try harder to detect w64devkitRon Yorston2022-11-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to build the supplied PDCurses code when using w64devkit. This was being detected by checking for the W64DEVKIT environment variable, but this is only defined if w64devkit is started via w64devkit.exe. Set W64DEVKIT ourselves if HOSTCC targets the mingw32 platform. This won't be the case when cross-compiling on Linux but will for w64devkit and MSYS2 MINGW32/64. The build won't work properly for MSYS2 MINGW32/64, but it doesn't work when using the supplied curses library either. 'make menuconfig' requires the use of MSYS2 MSYS, and HOSTCC there targets msys.
* | build system: silence compiler warningFRP-4784-g5507c8744Ron Yorston2022-11-081-0/+1
| | | | | | | | | | | | The compiler in MSYS2 warns that strcasecmp(3) isn't declared in scripts/kconfig/lxdialog/checklist.c. Add the appropriate include to silence this warning.
* | win32: fix ESC/CR handling in 'make menuconfig'Ron Yorston2022-11-071-1/+1
| | | | | | | | | | | | | | The WIN32 code in the 'mconf' build program should truncate the exit status from dialogs as if it were passed through WEXITSTATUS. The text dialog, for example, returns a status of -1 when ESC or CR is pressed. 'mconf' expects to see this as 255.
* | Provide PDCurses source for w64devkit buildRon Yorston2022-11-0740-0/+10615
| | | | | | | | | | | | w64devkit doesn't ship a curses library. Provide a cut-down copy of PDCurses which is sufficient to allow 'make menuconfig' to work in w64devkit.
* | win32: allow 'make menuconfig' in native buildsRon Yorston2022-11-071-6/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'make menuconfig' is a build option to allow changes to be made to the BusyBox configuration. It's a bit friendlier than using a text editor on the .config file. Previously 'menuconfig' was only available when cross-compiling on a Linux/Unix platform. The 'mconf' build program has been ported to WIN32 so it's now able to run the 'lxdialog' program which displays the configuration dialogs. Building 'lxdialog' is somewhat awkward in MSYS2. The MINGW32/64 build environments generate WIN32 executables for 'lxdialog'. These doesn't work properly in the MSYS2 console. For 'menuconfig' to work it's necessary to run it in an MSYS build environment. This generates an MSYS binary which works in the MSYS2 console. busybox-w32 should then be built in a MINGW32/64 build environment. Doing so will generate additional copies of the build programs without a '.exe' suffix: the MSYS build environment adds '.exe' to binaries it builds. This breaks 'menuconfig'. To configure an MSYS build environment use: pacman -S gcc ncurses-devel
* | build system: fix breakage affecting MSYS2 buildRon Yorston2022-10-302-4/+4
| | | | | | | | | | | | | | | | | | | | Upstream changes to the embedded_scripts and mkconfigs scripts resulted in busybox-w32 failing to build with MSYS2. bzip2 in MSYS2 detects stdout redirected to /dev/null as a terminal and returns a non-zero exit status. Since the test is only for the existence of bzip2, not its functionality, even an exit status of 1 is OK. Only fail if the exit status is 127.
* | build system: allow building with w64devkitRon Yorston2022-10-304-7/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make some adjustments to the build system to allow busybox-w32 to be built with w64devkit: - Strip drive prefix from CURDIR in Makefile to avoid confusing make with colons. - Limit file redirection to a subshell in the usage_compressed and embedded_scripts scripts. Otherwise it isn't possible to move the open generated file on Windows. - Change the option tests in Kbuild.include to allow for /dev/null not existing on Windows. - Create host binaries without a '.exe' extension. Otherwise they're rebuilt more often than necessary. - Modify split-include.c to allow for Windows' popen() not expanding wildcards. (GitHub issue #239)
* | Merge branch 'busybox' into mergeRon Yorston2022-05-121-0/+1
|\|
| * kbuild: fix building sha256Bernhard Reutner-Fischer2022-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | Pass down the correct EXTRA_CFLAGS to the compiler driver when building assembler source. Otherwise building busybox for a multilib other than the default failed to link since hash_md5_sha256_x86-64_shaNI.o and hash_md5_sha_x86-64_shaNI.o were built for the default arch which might not what we requested in the EXTRA_CFLAGS. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* | Merge busybox into mergeRon Yorston2022-01-064-17/+41
|\| | | | | | | | | | | Fix merge conflict in miscutils/less.c. Use exit_SUCCESS() where possible.
| * build system: detect if build host has no bzip2Denys Vlasenko2022-01-043-3/+20
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * scripts/echo.c: fix NUL handling in "abc\0 def"Denys Vlasenko2021-12-281-14/+21
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-08-172-5/+8
|\|
| * scripts/randomtest.loop: let user know about SKIP_MOUNT_MAND_TESTSDenys Vlasenko2021-08-161-3/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: remove remains of FEATURE_TOUCH_NODEREFDenys Vlasenko2021-08-151-2/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-06-072-3/+16
|\|
| * build system: use SOURCE_DATE_EPOCH for timestamp if availablePaul Spooren2021-06-051-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SOURCE_DATE_EPOCH is an effort of the Reproducible Builds organization to make timestamps/build dates in compiled tools deterministic over several repetitive builds. Busybox shows by default the build date timestamp which changes whenever compiled. To have a reasonable accurate build date while staying reproducible, it's possible to use the *date of last source modification* rather than the current time and date. Further information on SOURCE_DATE_EPOCH are available online [1]. This patch modifies `confdata.c` so that the content of the SOURCE_DATE_EPOCH env variable is used as timestamp. To be independent of different timezones between builds, whenever SOURCE_DATE_EPOCH is defined the GMT time is used. [1]: https://reproducible-builds.org/docs/source-date-epoch/ Signed-off-by: Paul Spooren <mail@aparcar.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gen_build_files: Use C locale when calling sed on globbed filesKhem Raj2021-06-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When include/applets.h is re-generated it generates code macros in include/applets.h e.g. IF_XZCAT(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat)) ... IF_CHVT(APPLET_NOEXEC(chvt, chvt, BB_DIR_USR_BIN, BB_SUID_DROP, chvt)) ... sed is used to process source files like below to feed into this header generation sed -n 's@^//applet:@@p' "$srctree"/*/*.c "$srctree"/*/*/*.c this means we let shell decide the order of .c files being fed into sed tool, applets.h has code snippets thats generated out of code fragments from these .c files and the order of the generated code depends on the order of .c files being fed to sed and then piped to generate tool, even though the generated code is logically same, it does result in re-odered code in applets.h based on which shell was used during build on exact busybox sources since sort order is different based on chosen locale and also default shell being bash or dash This sets the environment variable LC_ALL to the value C, which will enforce bytewise sorting, irrespective of the shell Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-05-147-24/+24
|\|
| * gcc-version.sh: fix for "invalid number" message during Android NDK buildsChris Renshaw2021-04-221-2/+2
| | | | | | | | | | | | | | | | | | A CR in the gcc output would cause the following to show throughout build: : invalid numberbox-1.32.1/scripts/gcc-version.sh: line 12: printf: 9 Signed-off-by: Chris Renshaw <osm0sis@outlook.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gcc-version.sh: Cygwin fixDenys Vlasenko2021-04-181-1/+1
| | | | | | | | | | | | | | On Cygwin, "echo __GNUC__ __GNUC_MINOR__ | gcc -E -xc -" can print extra empty trailing line. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fix "warning array subscript has type 'char'"Denys Vlasenko2021-04-146-21/+21
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * build system: avoid build failure during bisectionRon Yorston2021-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4bdc914ff (build system: fix compiler warnings) added a test on the return value of fgets() in split-include.c. During bisection it's possible to go back to a state where a configuration value didn't exist. This results in an empty include file corresponding to the missing feature. If a subsequent bisection returns to a state where the feature exists split-include treats the empty file as an error and the build fails. Add a call to ferror() to distinguish between fgets() failing due to an error and due to there being no data to read. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bloat-o-meter: avoid double countingRon Yorston2021-03-091-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable 'echo' in the default config, run 'make baseline', then re-enable 'echo' and run 'make bloatcheck': function old new delta .rodata 182521 182622 +101 packed_usage 33714 33792 +78 applet_main 3168 3176 +8 applet_names 2730 2735 +5 applet_suid 99 100 +1 applet_install_loc 198 199 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/0 up/down: 194/0) Total: 194 bytes text data bss dec hex filename 955052 4195 1808 961055 eaa1f busybox_old 955153 4195 1808 961156 eaa84 busybox_unstripped The Total bytes value doesn't equal the change in the size of the binary. The packed_usage and applet_* items are in .rodata and are counted twice. With this modified bloat-o-meter the size of named items is deducted from .rodata: function old new delta packed_usage 33714 33792 +78 applet_main 3168 3176 +8 .rodata 105105 105113 +8 applet_names 2730 2735 +5 applet_suid 99 100 +1 applet_install_loc 198 199 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/0 up/down: 101/0) Total: 101 bytes text data bss dec hex filename 955052 4195 1808 961055 eaa1f busybox_old 955153 4195 1808 961156 eaa84 busybox_unstripped v2: Sections numbered less than 10 were always being omitted from consideration because splitting "[ 1] .interp" leaves "1]" in x[1] where the section name is expected. This wasn't a problem for .rodata (numbered 15 in my testing) but let's fix it anyway. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | build system: add support for 'make bloatcheck'Ron Yorston2021-03-101-0/+25
| | | | | | | | Plus a few other make targets that make measurements on the binary.
* | bloat-o-meter: avoid double countingRon Yorston2021-03-101-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable 'echo' in the default config, run 'make baseline', then re-enable 'echo' and run 'make bloatcheck': function old new delta .rodata 182521 182622 +101 packed_usage 33714 33792 +78 applet_main 3168 3176 +8 applet_names 2730 2735 +5 applet_suid 99 100 +1 applet_install_loc 198 199 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/0 up/down: 194/0) Total: 194 bytes text data bss dec hex filename 955052 4195 1808 961055 eaa1f busybox_old 955153 4195 1808 961156 eaa84 busybox_unstripped The Total bytes value doesn't equal the change in the size of the binary. The packed_usage and applet_* items are in .rodata and are counted twice. With this modified bloat-o-meter the size of named items is deducted from .rodata: function old new delta packed_usage 33714 33792 +78 applet_main 3168 3176 +8 .rodata 105105 105113 +8 applet_names 2730 2735 +5 applet_suid 99 100 +1 applet_install_loc 198 199 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/0 up/down: 101/0) Total: 101 bytes text data bss dec hex filename 955052 4195 1808 961055 eaa1f busybox_old 955153 4195 1808 961156 eaa84 busybox_unstripped v2: Sections numbered less than 10 were always being omitted from consideration because splitting "[ 1] .interp" leaves "1]" in x[1] where the section name is expected. This wasn't a problem for .rodata (numbered 15 in my testing) but let's fix it anyway. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-03-011-5/+12
|\|
| * trylink: do not drop libs from CONFIG_EXTRA_LDLIBSDenys Vlasenko2021-02-231-5/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | .gitignore: support building on WindowsJohannes Schindelin2021-02-212-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These items are already listed, albeit without `.exe` suffix. Presumably, this is because BusyBox-w32 is traditionally cross-compiled on Linux. However, we are about to introduce a CI build definition that builds BusyBox-w32 in MSYS2 (using mingw-w64-gcc), meaning that those executables might very well exist _with_ `.exe` suffix. Let's ignore those, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | win32: fixes to build on Windows/MSYS2/mingw-w64Ron Yorston2021-02-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | To investigate GitHub issue #200 it was necessary to perform build on Window using the MSYS2/mingw-w64 toolchain. This threw up some issues: - The settings for _WIN32_WINNT and __USE_MINGW_ANSI_STDIO differ from those in Fedora resulting in compiler errors and warnings. Force the defaults I'm used to. - The workaround to allow native compilation of mconf.c was broken by a subsequent upstream change. Make it work again.
* | Merge branch 'busybox' into mergeRon Yorston2021-01-141-0/+1
|\|
| * tar: add TODO about a bug with non-writable directories on extractDenys Vlasenko2021-01-011-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2020-07-091-0/+25
|\|
| * randomconfig fixesDenys Vlasenko2020-06-241-0/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * randomconfig fixesDenys Vlasenko2020-06-231-0/+22
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeFRP-3466-g53c09d0e1Ron Yorston2020-05-294-8/+5
|\|
| * build system: remove KBUILD_STR()Jean-Philippe Brucker2020-04-294-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using GNU Make >=4.3, the KBUILD_STR() definition interferes badly with dependency checks during build, and forces a complete rebuild every time Make runs. In if_changed_rule, Kconfig checks if the command used to build a file has changed since last execution. The previous command is stored in the generated .<file>.o.cmd file. For example applets/.applets.o.cmd defines a "cmd_applets/applets.o" variable: cmd_applets/applets.o := gcc ... -D"KBUILD_STR(s)=#s" ... Here the '#' should be escaped with a backslash, otherwise GNU Make interprets it as starting a comment, and ignore the rest of the variable. As a result of this truncation, the previous command doesn't equal the new command and Make rebuilds each target. The problem started to appear when GNU Make 4.3 (released January 2020), introduced a backward-incompatible fix to macros containing a '#'. While the above use of '#', a simple Make variable, still needs to be escaped, a '#' within a function invocation doesn't need to be escaped anymore. As Martin Dorey explained on the GNU Make discussion [1], the above declaration is generated from make-cmd, defined as: make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1)))) Since GNU Make 4.3, the first argument of subst should not have a backslash. make-cmd now looks for literally \# and doesn't find it, and as a result doesn't add the backslash when generating .o.cmd files. [1] http://savannah.gnu.org/bugs/?20513 We could fix it by changing make-cmd to "$(subst #,\#,...)", but to avoid compatibility headaches, simply get rid of the KBUILD_STR definition, as done in Linux by b42841b7bb62 ("kbuild: Get rid of KBUILD_STR"). Quote the string arguments directly rather than asking the preprocessor to quote them. Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-03-121-0/+1
|\|
| * scripts/echo.c: resolve implicit declaration of function 'dup2'Nicolas Hüppelshäuser2019-03-051-0/+1
| | | | | | | | | | Signed-off-by: Nicolas Hüppelshäuser <nicolas.hueppelshaeuser@emlix.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-02-121-32/+76
|\|
| * checkstack.pl: tweak bfin reBernhard Reutner-Fischer2019-01-181-1/+1
| | | | | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * checkstack: pull from upstreamBernhard Reutner-Fischer2019-01-171-32/+75
| | | | | | | | | | | | merge upstream changes Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * checkstack.pl: fix arch autodetectionBernhard Reutner-Fischer2019-01-171-0/+1
| | | | | | | | | | | | chomp trailing newlines Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-01-104-6/+12
|\|
| * build system: fix compiler warningsDenys Vlasenko2019-01-064-6/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-11-283-13/+154
|\|