aboutsummaryrefslogtreecommitdiff
path: root/tools/coreutils/Makefile
Commit message (Collapse)AuthorAge
* tools/coreutils: provide the rmdir utilityMichael Pratt2025-07-26
| | | | | | | | | | | | Use the rmdir utility provided by GNU coreutils for macOS in order to be able to use the option "--ignore-fail-on-non-empty". Some other tools such as elfutils use this while building. Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/16522 Signed-off-by: Robert Marko <robimarko@gmail.com>
* tools/coreutils: replace symlinks to build prerequisitesMichael Pratt2025-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before building, symlinks are made from existing utilities on the host machine, because they are necessary before coreutils can be built. Instead of leaving these utilities as symlinks, replace them with the copy provided by the coreutils build in order to increase version control for these utilities and to have a real copy for targets like the SDK. The utilities required before building and provided by coreutils are cp, install, realpath, seq, and stat. Let all of the utilities be installed with the "g" prefix, then, existing symlinks named without the "g" prefix are safely replaced with a new symlink using the coreutils version of `ln` just built in order to prevent an inconsistent state of the file since these utilities must always be available. While at it, sort the list alphabetically. Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/16522 Signed-off-by: Robert Marko <robimarko@gmail.com>
* tools/coreutils: disable uninstall targetMichael Pratt2025-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | GNU coreutils is a unique case where we require some of the utilities on the host machine before anything is built. The prerequisite is handled by symlinks to the host binaries in the staging directory that are installed by the build system and that are expected to remain as long as the corresponding stampfile exists. Because the binaries built by coreutils will replace the symlinks, the uninstall target will actually delete the symlinks long before the build finishes whenever it is ran. This can cause the utilities to be temporarily missing from the controlled part of the shell's PATH, so disable the removal of the coreutils utilities. The appropriate way to clear all of the programs and links would be `make dirclean`. Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/16522 Signed-off-by: Robert Marko <robimarko@gmail.com>
* tools/coreutils: add maintainer-clean to clean targetMichael Pratt2025-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the clean recipe during build, so that files already generated by the bootstrapping within the release are removed before the bootstrap script is run again. Automake with modified rules must be ran in order to generate a Makefile that does not delete itself. Override an automake variable "am__CONFIG_DISTCLEAN_FILES" in order to prevent removing config.status and other configure files so that configure stage does not need to be ran twice. Redefine MAINTAINERCLEANFILES with Make functions to avoid deleting the targets of gettext and gperf rules. In order to prevent an inconsistent state of `install` since this utility must always be available as a prerequisite, do not allow it to be removed. Instead of preventing the removal of the config.h header, the Makefile supports regenerating it quickly. Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/16522 Signed-off-by: Robert Marko <robimarko@gmail.com>
* tools/coreutils: use automake during bootstrapMichael Pratt2025-07-26
| | | | | | | | | | | | | | | | | | | | | | | | This was previously not possible because part of the source code for coreutils in the form of extra gnulib modules was missing from the release distribution. Now that the local modules from coreutils source is included in coreutils releases, the bootstrap script can be ran without skipping automake in the autoreconf stage after importing modules by using fake paths to each autotools program, and instead use the real paths to our modified autotools. Because we do not require tools for building documentation, continue to fake the paths to autopoint and gtkdocize. Remove the skipping of imports of some source files which is no longer necessary. Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/16522 Signed-off-by: Robert Marko <robimarko@gmail.com>
* tools/coreutils: update to 9.6Michael Pratt2025-07-26
| | | | | | | | | | | | | | | | | | | | | | Update to the next stable release. Prevent the need for gperf to build gperf based headers due to new gnulib versions by skipping replacement of gperf files. Without Automake, there are some existing macro conflicts due to the new version of gnulib, causing build errors with some source files, so skip those file replacements. All patches are automatically refreshed. Link: https://lists.gnu.org/archive/html/coreutils/2025-01/msg00049.html Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/16522 Signed-off-by: Robert Marko <robimarko@gmail.com>
* Revert "tools/coreutils: update to 9.6"Robert Marko2025-03-15
| | | | | | | | | | This reverts commit 160e0b7ad866c9f52b81d95588c7b0a40cffd109. It seems that this was not tested on MacOS and will fail to compile, so revert it until a proper update is done. Fixes: 160e0b7ad866 ("tools/coreutils: update to 9.6") Signed-off-by: Robert Marko <robimarko@gmail.com>
* Revert "tools/coreutils: fix wrong PKG_HASH after update to version 9.6"Robert Marko2025-03-15
| | | | | | This reverts commit c2a58fe875ff04ce956c7da8f42412053bfc7597. Signed-off-by: Robert Marko <robimarko@gmail.com>
* tools/coreutils: fix wrong PKG_HASH after update to version 9.6Petr Štetiar2025-03-15
| | | | | | | | | | | | | | | | Currently macOS builds are failing due to hash mismatch. Lets fix it by using proper hash: Here are the SHA1 and SHA256 checksums: File: coreutils-9.6.tar.gz SHA1 sum: 1da82e96486e0eedbd5257c8190f2cf9fcb71c2e SHA256 sum: 2bec616375002c92c1ed5ead32a092b174fe44c14bc736d32e5961053b821d84 References: https://lists.gnu.org/archive/html/coreutils/2025-01/msg00049.html Fixes: 160e0b7ad866 ("tools/coreutils: update to 9.6") Reported-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Signed-off-by: Petr Štetiar <ynezz@true.cz>
* tools/coreutils: update to 9.6John Audia2025-03-13
| | | | | | | | | | Update to latest stable release https://lists.gnu.org/archive/html/coreutils/2025-01/msg00049.html Signed-off-by: John Audia <therealgraysky@proton.me> Link: https://github.com/openwrt/openwrt/pull/18191 Signed-off-by: Nick Hainke <vincent@systemli.org>
* tools/coreutils: remove 64-bit time disable flagMichael Pratt2024-06-27
| | | | | | | | | | | | | | | This was added to support building coreutils on host systems that still only have 32-bit time support. Because other tools now also require the flag for building with 32-bit time when support for 64-bit time is not present, this flag is now added to all host builds on a variable basis using the same test before building, so it can now be removed from specific tools. Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/15799 Signed-off-by: Robert Marko <robimarko@gmail.com>
* tools/coreutils: ignore gnulib changes to fcntl.hMichael Pratt2024-06-19
| | | | | | | | | | | | | As a side-effect to adding a gnulib module for posix_fallocate(), there are changes to the input file for fcntl.h which are not handled here since autoreconf is not ran. Skip updating the fcntl.h header from gnulib and use the version shipped with the release. Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/15690 Signed-off-by: Robert Marko <robimarko@gmail.com>
* tools/coreutils: update to 9.5Michael Pratt2024-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Update to latest stable release. The following commits in gnulib caused a conflict in locally bootstrapped coreutils with stable gnulib: 8f4b4e52c991de2233b471f8e35a068866b31f01 2749234203959df8d72cd8638d4e00a9fff450db A module (strftime) was marked deprecated and replaced by another module (nstrftime) in the version of gnulib that coreutils was released with compared to the stable branch that we use for importing. Conflicts from the previous version of coreutils are now gone, so other imported headers are now good. Refresh patch: - 000-bootstrap.patch Remove upstreamed patch: - 001-bootstrap-sync.patch Link: https://lists.gnu.org/archive/html/coreutils/2024-03/msg00132.html Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* tools/coreutils: update to 9.4Michael Pratt2024-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update to latest stable release. Add configure option to disable support for the Year 2038 problem. (for now, as some versions of GCC do not yet support it) Syncing bootstrap script fails, backport an upstream patch which can be removed at next coreutils update. Several headers from the stable gnulib branch cause build failure because the changes in the imported versions are incompatible with the Makefile that gets generated for coreutils. This version of coreutils was released after being bootstrapped and autoreconf'ed with a significantly different version of gnulib compared to our local gnulib, so skip importing them (and restore the backup). While at it, organize restoring the originally shipped version of files into a Make foreach function. Refresh patch: - 000-bootstrap.patch New patch: - 001-bootstrap-sync.patch Link: https://lists.gnu.org/archive/html/coreutils/2023-08/msg00099.html Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS Signed-off-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* tools: prefer gz or bz2 tarballsRobert Marko2024-04-06
| | | | | | | | | | | | | | In the light of recent XZ events, and fundamental XZ issues lets work on moving away from using XZ. So, use gz compressed tarballs as sources whenever possible. dwarves only offers bz2 compressed tarballs, so use those as size difference is minor compared to XZ. Signed-off-by: Robert Marko <robimarko@gmail.com> dwarves
* tools/coreutils: rename list of installed programsMichael Pratt2023-06-05
| | | | | | | | | | | Rename the list of programs installed by coreutils to PKG_PROGRAMS, which will create a stampfile for each through a new feature in host-build.mk. Also, cleanup a bit to save lines regarding the usage of this list. Signed-off-by: Michael Pratt <mcpratt@pm.me>
* tools/coreutils: bootstrap to local gnulib sourceMichael Pratt2023-05-04
| | | | | | | | | | | | | | | | | | | | | Using the local gnulib source during bootstrap allows for fine-grained control over the macros and source files for use with coreutils but part of gnulib instead of coreutils, without having to wait for a release or deal with gnulib as a git submodule. In this case, the execution of autotools must be skipped by force. Autoconf and Automake during bootstrap on coreutils only works right when using directly checked-out source. There is a symbol in gnulib, @GNULIB_TIME@ that is not yet defined in coreutils source, so we use the backup of lib/time.in.h instead of the one provided by gnulib source. Signed-off-by: Michael Pratt <mcpratt@pm.me>
* tools/coreutils: update to 9.3Nick Hainke2023-04-29
| | | | | | | | | | Update to latest bugfix release. Remove upstreamed patches: - 001-copy-fix-reflink-auto-to-fallback-in-more-cases.patch - 002-date-diagnose-f-read-errors.patch Signed-off-by: Nick Hainke <vincent@systemli.org>
* tools/coreutils: update to 9.2Georgi Valkov2023-04-02
| | | | | | | | | | | | | | | | | | | | | This resolves an error when building toolchain/musl on macOS due to improper hole-detection caused by a bug in macOS/APFS [1]. As long as we don't reconfigure, 001-m4.patch is not needed. If we keep it, it will force reconfigure the project, since m4 files are changed. This works, but may not be optimal, because the build should use files from coreutils/m4, but OpenWRT uses legacy files from staging_dir/host/share/aclocal [2]. backport a couple of upstream patches date: diagnose -f read errors copy: fix --reflink=auto to fallback in more cases [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61386 [2] https://github.com/openwrt/openwrt/pull/12233#issuecomment-1481097456 Co-developed-by: Michael Pratt <mcpratt@pm.me> Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
* tools/coreutils: update to 9.1John Audia2023-02-05
| | | | | | | | | | | In addition to version update, this commit applies a fixup to allow building on MacOS involving renaming: [gt_TYPE_WINT_T] --> [gt_TYPE_WINT_T_GNUTLS] suggested by zhanhb. Build system: x86_64 Build-tested: bcm2711/RPi4B Signed-off-by: John Audia <graysky@archlinux.us>
* tools: add Host/Uninstall where possibleRosen Penev2022-10-20
| | | | | | This cleans staging_dir when calling tool/x/clean. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* tools/coreutils: enable ginstall utilityFelix Fietkau2022-07-13
| | | | | | | | | For some reason, current coreutils version installed on x86 macOS via homebrew have a bug, where at least the cc1 binary from gcc gets corrupted during install to the staging dir. Using the install utility from tools/coreutils fixes this Signed-off-by: Felix Fietkau <nbd@nbd.name>
* tools/coreutils: build chownFelix Fietkau2022-01-27
| | | | | | | On ARM macOS, injecting extra shared libraries does not work for system binaries. This causes fakeroot to fail for chown calls Signed-off-by: Felix Fietkau <nbd@nbd.name>
* tools/coreutils: update to 8.32Hannu Nyman2020-08-30
| | | | | | | Update coreutils to version 8.32. Remove upstreamed patch. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
* tools/coreutils: install lnFelix Fietkau2020-08-13
| | | | | | It is needed for libsepol on non-GNU systems Signed-off-by: Felix Fietkau <nbd@nbd.name>
* tools/coreutils: install "touch"Felix Fietkau2019-09-25
| | | | | | | Fixes error in setting SOURCE_DATE_EPOCH timestamp on files on rootfs prepare on non-Linux systems Signed-off-by: Felix Fietkau <nbd@nbd.name>
* add PKG_CPE_ID ids to package and toolsAlexander Couzens2017-11-17
| | | | | | | | | | | CPE ids helps to tracks CVE in packages. https://cpe.mitre.org/specification/ Thanks to swalker for CPE to package mapping and keep tracking CVEs. Acked-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* tools/coreutils: install readlinkFelix Fietkau2017-11-09
| | | | | | Parts of the build system use non-portable invocation of readlink Signed-off-by: Felix Fietkau <nbd@nbd.name>
* tools/coreutils: Update to 8.27Daniel Engberg2017-03-20
| | | | | | Update coreutils to 8.27 Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
* treewide: clean up download hashesFelix Fietkau2016-12-16
| | | | | | Replace *MD5SUM with *HASH, replace MD5 hashes with SHA256 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* tools: build GNU date from coreutils on non-Linux systemsFelix Fietkau2016-08-23
Required for reproducible builds in the kernel build system Signed-off-by: Felix Fietkau <nbd@nbd.name>