aboutsummaryrefslogtreecommitdiffstats
path: root/include/prereq.mk
Commit message (Collapse)AuthorAgeFilesLines
* prereq-build: replace relative symlinks only if brokenMichael Pratt2023-06-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Some programs installed to staging_dir/host/bin also install some symlinks to itself for an alternative name. Some of those new symlinks are overwriting symlinks that were installed by prereq stage. If prereq stage were to somehow be run again, it should not be overwriting symlinks that point to programs that are already built. To filter that out, catch all symlinks after first catching all symlinks that have an absolute target after all other cases in the case statement, make sure it is not broken, and if so exit successfully. Suggested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> Signed-off-by: Michael Pratt <mcpratt@pm.me> (cherry picked from commit b890e2fbf9211648ad4a74f3e8b47bbf04a3cc7a)
* prereq-build: do not replace binaries with symlinksMichael Pratt2023-06-121-0/+4
| | | | | | | | | | | | | | | | | Some programs, like bash and patch, are checked by prereq stage and have a symlink installed, but then is later built from source. Now that the prereq-build checks are not successful just by finding the file alone, it is possible for a new symlink to overwrite the installed binary. If a normal file is found in staging_dir/host/bin, let the check look for the associated stampfile, and if found, skip creation of a symlink and exit successfully. Suggested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> Signed-off-by: Michael Pratt <mcpratt@pm.me> (cherry picked from commit 729909c07fae4201591e51895833112cb88485e1)
* prereq-build: fix inconsistent value of $PATHMichael Pratt2023-06-121-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the recipe SetupHostCommand for checking and creating symlinks, $PATH was only overridden for one of several commands. This causes the symlinks to be included in the paths to pick a program from when the check was repeated, because staging_dir/host/bin was included in $PATH, but only *sometimes*. When the check ran again, the command succeded with a $PATH including the symlink, (eval "$$$$$$$$cmd") while the path to the program was evaluated with a $PATH NOT including the symlink, (bin=...) causing the symlink to be relinked incorrectly, instead of passing as exactly the same. Coincidentally, this was only a problem if the symlink targeted the alternative program with a different name. By overriding the value of $PATH at the invocation of Make, it will apply to the entire environment of the checks. Signed-off-by: Michael Pratt <mcpratt@pm.me> (cherry picked from commit 665fe2f818300f0b84c8c458fc49ae58ff8853aa)
* prereq: SetupHostCommand: fix wrong check resultPetr Štetiar2023-05-231-1/+1
| | | | | | | | | | | | | | | Tony has reported, that CI tools job is failing for him in macOS container due to prereq check failure for GNU `install` utility. Michael diagnosed it and from his traces it was clear, that the issue is caused by a wrong return value in the success check case, so lets fix it accordingly. Fixes: f75204036ccc ("prereq-build: allow host command symlinks to update") Reported-by: Tony Ambardar <itugrok@yahoo.com> Diagnosed-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Petr Štetiar <ynezz@true.cz> (cherry picked from commit 7855378fcd7ed7cb0a223238a99bac0b8e46c380)
* prereq-build: remove python 2 cleanup recipeMichael Pratt2023-05-211-12/+0
| | | | | | | | | | | This reverts commit 3b68fb57c938af3948ae4c2da61501183fbef649. After refactoring build checks to update old symlinks, and after a long time of no python 2 support, this is no longer needed. Signed-off-by: Michael Pratt <mcpratt@pm.me> (cherry picked from commit e2f9fa42044a2660f702a9b51b14cbde24a13702)
* prereq-build: allow host command symlinks to updateMichael Pratt2023-05-211-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the prereq stage update the symlinks installed into staging_dir/host/bin by rearrainging the way they are verified. Before, seeing or installing a symlink would result in a successful exit code, and not installing a symlink would result is a failed exit code. However, that is not able to account for the difference between existing good and bad links, or whether the link would be the same if it was reinstalled, because the check can match the program to a different path. Instead, let a success exit code represent identifying an existing symlink as exactly the same as what would be installed if it did not exist, and let a fail exit code represent needing to install the symlink or not having a match to the check criteria. The failing exit code is caught by a new second attempt for all of the check-* targets which will then indicate to the user that there was an update by having a success exit code when the check is run again and the link is the same. When there is nothing to update, the checks will run only once. This relies on the ls command to be POSIX-conformant with long format: "path/to/link -> target/of/link" Also, make sure the symlink is executable, not just a file, and the directory only needs to be created once. Fixes: #12610 Signed-off-by: Michael Pratt <mcpratt@pm.me> (cherry picked from commit f75204036ccc56700df18258602cc65726dd653b)
* include/prereq.mk: add RequireCHeader helperChristian Marangi2023-01-091-0/+12
| | | | | | | | | | | | Add RequireCHeader helper that will try to compile a fake c program with the requested header included. This is useful to check if a specific header is present in the system without checking for the specific path. This is a generilized version of the current ncurses test. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* treewide: drop use of whichAnsuel Smith2022-01-171-2/+2
| | | | | | | | | | | | | | Ubuntu started to flag which as deprecated and it seems which is not really standard and may vary across Distro. Drop the use of which and use the standard 'command -v' for this simple task. Which is still present in the prereq if some package/script still use which. A utility script called command_all.sh is implemented that will just mimic the output of which -a. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* Revert "build: replace which with Bash command built-in"Clemens Fruhwirth2021-03-031-2/+2
| | | | | | | | | | | This reverts commit c7aec47e5e3a3ff7b5fdaa11cd1e62cae6746acb. The original commit replaces 'which' with 'command'. Sadly most of them are not equivalent and for 'which -a', there is no easy replacements that would not reimplement PATH parsing logic. Hence revert. Keeping a dependency on which is absolutely fine. Signed-off-by: Clemens Fruhwirth <clemens@endorphin.org>
* build: use SPDX license tagsPaul Spooren2021-02-051-5/+2
| | | | | | | | | The license folder is a core part of OpenWrt and all GPL-2.0 licensed. Use SPDX license tags to allow machines to check licenses. Signed-off-by: Paul Spooren <mail@aparcar.org> [rebase, keep some Copyright lines, sharpen commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* build: replace which with Bash command built-inPetr Štetiar2021-01-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | `which` utility is not shipped by default for example on recent Arch Linux and then any steps relying on its presence fails, like for example following Python3 prereq build check: $ python3 --version Python 3.9.1 $ make /bin/sh: line 1: which: command not found /bin/sh: line 1: which: command not found /bin/sh: line 1: which: command not found ... Checking 'python3'... failed. ... Fix this by switching to Bash builtin `command` which should provide same functionality. Fixes: FS#3525 Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: cleanup possibly dangling Python 2 host symlinkPetr Štetiar2019-07-261-0/+12
| | | | | | | | | | | | When bumping buildroot to Python 3, we need to assure, that Python symlink in staging bin directory points to Python >= 3.5 as well. We can't rely completly just on SetupHostCommand as its executed only in cases when the $(STAGING_DIR_HOST)/bin/python doesn't already exist, so we need to remove it before running SetupHostCommand. Acked-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Petr Štetiar <ynezz@true.cz>
* include: extend SetupHostCommand macro to accept more argumentsJo-Philipp Wich2018-04-051-1/+2
| | | | | | | | | | | | | Commit d6d3db0543 added more gcc version probes, exceeding the argument limit of the SetupHostCommand macro, leading to failing GCC/LLVM tests on OS X. Extend the handled number of arguments to restore proper functionality. Fixes FS#1470 Fixes d6d3db0543 ("build: Improve GCC version detection") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: do not overwrite already existing host commandsFelix Fietkau2015-09-161-0/+1
| | | | | | | | | This prevents a later prereq check from overwriting the installed tar binary. Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 46982
* include: remove trailing whitespacesLuka Perkov2015-03-291-2/+2
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 45127
* build: accept apple llvm as fallback for gcc/g++Felix Fietkau2015-02-071-1/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 44298
* include/prereq.mk: fix echo commands with simple /bin/shFelix Fietkau2015-02-071-2/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 44297
* include: don't rely on perl for printing prereq errorsJo-Philipp Wich2015-02-051-1/+1
| | | | | | | | | Perl might not be present while checking prereqs, e.g. on a fresh FreeBSD install. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44276
* include: add TestHostCommand and SetupHostCommand macrosJo-Philipp Wich2015-02-051-2/+46
| | | | | | | | | Those macros allow testing various commands on the host system, also process the prereq tests in the order they're declared. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44269
* prereq.mk: only define .NOTPARALLEL when processing prereq checksFelix Fietkau2014-10-121-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42877
* some minor fixes, cleanups, package build abstractionFelix Fietkau2007-09-281-0/+4
| | | | SVN-Revision: 9051
* Add a requireheader for squid, should fix it (#2205)Florian Fainelli2007-08-121-0/+8
| | | | SVN-Revision: 8404
* next round of cleanup, convert target/ - make -j works now ;)Felix Fietkau2007-07-301-1/+2
| | | | SVN-Revision: 8242
* print package name when prereq failsMike Baker2007-01-311-1/+1
| | | | SVN-Revision: 6236
* allow newlines in prereq error messagesFelix Fietkau2007-01-201-1/+1
| | | | SVN-Revision: 6147
* make target/linux/* directories self-contained, use the selected kernel ↵Felix Fietkau2006-11-111-8/+3
| | | | | | version for the toolchain, autogenerate menuconfig and makefile code for target selection SVN-Revision: 5498
* finally move buildroot-ng to trunkFelix Fietkau2016-03-201-0/+54