aboutsummaryrefslogtreecommitdiffstats
path: root/include/host-build.mk
Commit message (Collapse)AuthorAgeFilesLines
* build: disable automake dependency trackingMichael Pratt2023-03-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent versions of Automake have changed dependency tracking significantly (reference commit below) causing breakage in some package builds when using newer Automake with packages that need autoreconf that were bootstrapped with an old version of Automake. Those changes cause a great inconsistency between packages over time where some packages may or may not use this feature, and may or may not update the .ac and .am files to work with the new methods. This problem might exist in many packages where autoreconf is not currently required, but would cause build failure if autoreconf is used. Fortunately, this feature is practically useless for the purposes of Openwrt and the average developer, so we can disable it. GNU Automake manual states in part: "Because dependencies are only computed as a side-effect of compilation... no dependency information exists the first time a package is built... dependency tracking is completely useless for one-time builds..." A nice side-effect is that build times are slightly faster. Ref: 6a675ef17edf7109da189f5ae70e2dc6b7665896 (automake.git) Signed-off-by: Michael Pratt <mcpratt@pm.me>
* build: skip download for host build with AUTOREMOVE if already compiledChristian Marangi2023-01-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | Packages in general use 4 check to trigger a recompile: - timestamp for the build_dir - timestamp for the staging stamp dir - depends hash for the build_dir prepared file - presence of package archieve in dl If host tools are prebuilt and shipped in a container or manually installed from an archieve, it would be ideal to skip including the package archieve and just provide the build_dir prepared files and the staging stamp file (and the actualy prebuilt tools). Add some logic to skip dl download for host tools if AUTOREMOVE is selected and checks for the presence of staging dir stamp file and build dir stamp file. If one of these requirements are not met, the package is redownloaded and rebuilt. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* build: make find_md5 reproducible with AUTOREMOVEChristian Marangi2022-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | While experimenting with the AUTOREMOVE option in search of a way to use prebuilt host tools in different buildroot, it was discovered that the md5 generated by find_md5 in depends.mk is not reproducible. Currently the hash is generated by the path of the file in addition to the file mod time. Out of confusion, probably, there was an idea that such command was used on the package build_dir. Reality is that this command is run on the package files. (Makefile, patches, src) This is problematic because the package Makefile (for example) change at each git clone and base the hash on the Makefile mtime doesn't really reflect if the Makefile actually changes across a buildroot or not. A better approach is to generate an hash of each file and then generate an hash on the sort hash list. This way we remove the problem of git clone setting a wrong mtime while keeping the integrity of checking if a file changed for the package as any change will result in a different hash. Introduce a new kind of find_md5 function, find_md5_reproducible that apply this new logic and limit it only with AUTOREMOVE option set to prevent any kind of slowdown due to additional hash generation. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* build: handle directory with whitespace in AUTOREMOVE cleanChristian Marangi2022-09-111-2/+2
| | | | | | | | | Package with whitespace in their build directory are not correctly removed when CONFIG_AUTOREMOVE is enabled. This is caused by xargs that use whitespace as delimiters. To handle this use \0 as the delimiter and set find to use \0 as the delimiter. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* build: add HOST_CXXFLAGS for host buildSergey V. Lobanov2022-01-161-0/+1
| | | | | | | Added HOST_CXXFLAGS to specify CXXFLAGS during host-compile (e.g. to specify c++ standard: HOST_CXXFLAGS += -std=c++11) Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
* build: fix host package unpack if git-src is usedFelix Fietkau2021-11-041-1/+1
| | | | | | | If the package download step is skipped, it needs to be performed for the host build instead. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* download: improve handling of invalid local filesEneas U de Queiroz2021-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 4e19cbc5533: [download: handle possibly invalid local tarballs] added a FORCE rule to downloaded files, so that they will be always checked by download.pl. As a side-effect, check-compile will fail, forcing unnecessary package rebuilds. The check-compile.txt log shows (for libxml2 for example): Considering target file '.../dl/libxml2-2.9.12.tar.gz'. ... prerequisite 'FORCE' of target '.../dl/libxml2-2.9.12.tar.gz' does not exist. Must remake target '.../dl/libxml2-2.9.12.tar.gz'. ... Giving up on target file '...libxml2-2.9.12/.prepared_...'. Giving up on target file '...libxml2-2.9.12/.configured_...'. Giving up on target file '...libxml2-2.9.12/.built'. Giving up on target file '...stamp/.libxml2_installed'. Giving up on target file '.compile'. Then the package is rebuilt even if it is not otherwise needed. To fix this, instead of always forcing the download target to be remade, check its hash first: if it matches, then the FORCE is not added. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* 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: drop ccache variables from specific targetsSven Wegener2021-01-011-3/+0
| | | | | | | With commit 2ca084cc ("build: improve ccache support") these variables are being set globally and we don't need them for specific targets. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* download: handle possibly invalid local tarballsPetr Štetiar2020-11-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently it's assumed, that already downloaded tarballs are always fine, so no checksum checking is performed and the tarball is used even if it might be corrupted. From now on, we're going to always check the downloaded tarballs before considering them valid. Steps to reproduce: 1. Remove cached tarball rm dl/libubox-2020-08-06-9e52171d.tar.xz 2. Download valid tarball again make package/libubox/download 3. Invalidate the tarball sed -i 's/PKG_MIRROR_HASH:=../PKG_MIRROR_HASH:=ff/' package/libs/libubox/Makefile 4. Now compile with corrupt tarball source make package/libubox/{clean,compile} Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: improve ccache supportRoman Yeryomin2020-07-111-1/+3
| | | | | | | | | | | | | | | | | | Set CCACHE_DIR to $(TOPDIR)/.ccache and CCACHE_BASEDIR to $(TOPDIR). This allows to do clean and dirclean. Cache hit rate for test build after dirclean is ~65%. If CCACHE is enabled stats are printed out at the end of building process. CCACHE_DIR config variable allows to override default, which could be useful when sharing cache with many builds. cacheclean make target allows to clean the cache. Changes from v1: - remove ccache directory using CCACHE_DIR variable - remove ccache leftovers from sdk and toolchain make files - introduce CONFIG_CCACHE_DIR variable - introduce cacheclean make target Signed-off-by: Roman Yeryomin <roman@advem.lv>
* build: call Host/Uninstall before wiping the host build dirAndre Heider2019-10-211-1/+1
| | | | | | | Uninstall targets may depend on build artefacts, like `make uninstall` or `ninja uninstall`. Signed-off-by: Andre Heider <a.heider@gmail.com>
* build: do not override CCACHE_DIR when ccache is disabledJo-Philipp Wich2018-07-241-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: pass HOSTCXX to host builds as CXXFelix Fietkau2018-04-201-0/+1
| | | | | | Fixes cmake build on some systems that also have an older clang++ Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: allow PKG_PREPARED_DEPENDS and PKG_CONFIG_DEPENDS to be changed after ↵Felix Fietkau2017-12-121-1/+1
| | | | | | | | | including package.mk Reverts commit a9c96ef0ac7ac99e4928f5312f3d0d1252c98328 and replaces it with a different approach Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: add a darwin sitefile to deal with macOS 10.12 + Xcode 9 build errorsFelix Fietkau2017-10-051-0/+5
| | | | | | | Certain functions are available in system headers, but only work on macOS 10.13 Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: stop overriding STAGING_DIR_HOST for toolchain buildFelix Fietkau2017-05-251-1/+1
| | | | | | | | | This causes various issues in other places that assume that host binaries are staged in STAGING_DIR_HOST. Since all the right places use HOST_BUILD_PREFIX, override that instead. This fixes some issues with quilt on toolchain dirs Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix STAMP_PREPARED with quiltFelix Fietkau2017-03-221-1/+1
| | | | | | | quilt.mk needs to be included first, to ensure that STAMP_PREPARED does not include the hash if quilt is used. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: improve performance by avoiding lazy-eval for make shell callsFelix Fietkau2017-03-161-1/+1
| | | | | | | Avoids lots of redundant calls to mkhash on things like package/kernel/linux Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: get rid of host.mkFelix Fietkau2017-02-261-1/+0
| | | | | | Defined required host related variables in toplevel.mk instead Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: make Host/Install/Default use Host/Compile/Default with an extra argumentFelix Fietkau2017-02-091-1/+1
| | | | | | Allows parallelizing compile steps that might be necessary during install Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: support make tools/<name>/install againFelix Fietkau2017-02-091-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix CONFIG_AUTOREMOVE for packages with multiple variantsFelix Fietkau2017-01-221-2/+7
| | | | | | | | Calling the clean target removes all .ipk files and un-stages the package. Add a new target just for clearing the build dir and call that one instead of the full clean target Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: disable CONFIG_AUTOREMOVE for packages/tools where QUILT is usedFelix Fietkau2017-01-191-3/+5
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: include CONFIG_AUTOREMOVE in HOST_STAMP_PREPAREDFelix Fietkau2017-01-191-1/+1
| | | | | | Fixes build issues when changing the CONFIG_AUTOREMOVE setting Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: extend CONFIG_AUTOREMOVE to tools/Felix Fietkau2017-01-181-0/+6
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: remove separate /install step for host buildsFelix Fietkau2017-01-181-2/+1
| | | | | | Reduces the number of recursive make invocations Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: introduce extra targets that contain only proper dependenciesFelix Fietkau2017-01-181-4/+4
| | | | | | This can be used to check if targets like prepare or compile are up to date Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: define common subdir targets in rules.mkFelix Fietkau2017-01-181-13/+4
| | | | | | Reduce build system clutter and enable further rework Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common ↵Matthias Schiffer2017-01-181-1/+1
| | | | | | | | | | | | | directory for all targets Using a single host package staging dir (and build dir) significantly speeds up builds when multiple targets are built in succession, especially for large host packages like NodeJS. $(STAGING_DIR)/host is kept in addition to $(STAGING_DIR_HOSTPKG) in most places; it is still used as destination for host files in Build/InstallDev. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* build: properly pass CPP and CXX flags in HOST_MAKE_VARSJo-Philipp Wich2017-01-171-1/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: introduce default HOST_MAKE_VARS for host-buildsAlexandru Ardelean2017-01-171-1/+7
| | | | | | Inspired/adapted from `package-defaults.mk` MAKE_VARS. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* build: fix HOST_CONFIGURE_VARS placementJo-Philipp Wich2017-01-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of passing HOST_CONFIGURE_VARS as arguments to the configure script, pass it as environment variables which brings the logic in line with the behaviour of package-defaults.mk. The change is needed since passing environment variables as configure parameters only works with GNU autoconf which evaluates command line arguments looking like variable assignments. Doing the same with non-autoconf configure scripts is not guaranteed to work since such scripts might terminate due to unknown argument errors. One example case is the cmake configure script which bails out when called as "./configure LDFLAGS=..." but not when called as "LDFLAGS=... ./configure". Also change the SHELL override to CONFIG_SHELL in the default HOST_CONFIGURE_VARS as the former is not properly propagated through the various GNU configure invocations since it gets lost when configure re- executes itself. A prior attempt to change the variable placement had to be reverted due to the missing SHELL -> CONFIG_SHELL change, leading to misgenerated libtool executables in various packages. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: remove obsolete parallel build related optionsFelix Fietkau2017-01-101-7/+2
| | | | | | Always use the main make jobserver, which has been the default for ages Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Revert "build: fix HOST_CONFIGURE_VARS placement"Jo-Philipp Wich2017-01-051-1/+1
| | | | | | | | | This reverts commit 8395b63aac616f72fd835c59240fc2a4a6b28106. Various host builds currently rely on the broken behaviour of HOST_CONFIGURE_VARS so roll back to the previous state. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: fix HOST_CONFIGURE_VARS placementJo-Philipp Wich2017-01-051-1/+1
| | | | | | | | | | Ensure that HOST_CONFIGURE_VARS are set before the actual configure command instead of passing them as configure command arguments. This change brings host-build.mk in line with package-defaults.mk and makes host configure environment variables work as expected. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* host-build: remove openssl include path from host cflagsFelix Fietkau2017-01-051-5/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: add defaults for PKG_SOURCE, PKG_SOURCE_SUBDIR, PKG_VERSIONFelix Fietkau2016-12-221-1/+2
| | | | | | | | This makes it easier to unify versioning of git based package downloads. PKG_SOURCE_DATE along with an 8-character abbreviation of the git hash is used as PKG_VERSION, PKG_RELEASE should be used like normal packages. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: implement make check and make package/X/checkFelix Fietkau2016-12-171-2/+6
| | | | | | | | | | | | | | | | This is intended to be used for a wide array of package sanity checks. The first check that is implemented is for the hash of downloaded files. It checks: - Missing hash - Use of SHA256 instead of MD5 - dl/<file> hash not matching hash in makefile - deprecated MD5SUM variable The deprecated MD5SUM variable check is skipped for feeds/ until OpenWrt is updated as well Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: remove duplicate Download/default definition from include/host-build.mkFelix Fietkau2016-12-161-10/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include/host-build.mk: use STAGING_DIR_HOSTPKGJo-Philipp Wich2016-11-011-1/+1
| | | | | | | Instead of hardcoding $(STAGING_DIR)/host, use the new $(STAGING_DIR_HOSTPKG) variable to refer to the directory. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: copy contents of 'src' folder to build dirs (if present)Alexandru Ardelean2016-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | The normal Prepare step for a build is unpack, apply patches. But for certain packages, patches contain whole files, which would be nice to have separately and copied over as a last step in the Prepare phase. We need it for some other packages + patches, but I think the 'hostapd' package can be used as a test for this. As a quick note: the reason the condition is being evaluated as `[ ! -d ./src/ ] || $(CP) ./src/* $(HOST_BUILD_DIR)` and not with `[ -d ./src/ ] && $(CP) ./src/* $(HOST_BUILD_DIR)` is that the latter would translate in a build failure if the `src` folder is not present (the exit code would be 1). The first one, succeeds for both cases (if `src` present or not). Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* include/host-build.mk: set Host/Exports for Host/Install stepMatthias Schiffer2016-10-061-0/+1
| | | | | | | | | Having a different PATH in Host/Install than in other steps like Host/Build is confusing and easily leads to mistakes. Setting all of Host/Exports makes host builds match target builds (Build/Install is part of $(STAMP_BUILT), which has Build/Exports set). Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* include/host-build.mk: fix ACLOCAL_INCLUDEMatthias Schiffer2016-10-061-1/+1
| | | | | | | | It seems the intention was to add both $(STAGING_DIR_HOST)/... and $(STAGING_DIR)/host/... instead of passing $(STAGING_DIR_HOST) twice. This makes the definition match HOST_CPPFLAGS and HOST_LDFLAGS. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* include/host-build.mk: pass HOST_BUILD_PREFIX to Host/installMatthias Schiffer2016-10-061-2/+2
| | | | | | | | | | Using HOST_BUILD_PREFIX instead of STAGING_DIR_HOST will make the argument work as expected from packages. Nothing changes for tools, for which HOST_BUILD_PREFIX and STAGING_DIR_HOST are equivalent. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* build: pass $(STAGING_DIR_HOST) to Host/InstallFelix Fietkau2016-08-231-2/+2
| | | | | | makes it more consistent with package builds Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: don't add -j for parallel builds with Make 4.2+Matthias Schiffer2016-06-151-1/+1
| | | | | | | | | | | | | | | | | | Make usually passes -j and jobserver arguments as part of MAKEFLAGS. LEDE removes MAKEFLAGS to have better control of the build, and re-adds the jobserver arguments with -j to the Make commandline where desired. Make 4.2+ behave differently with these arguments passed on the commandline than in MAKEFLAGS: -j will override the jobserver argument and the job count will be unlimited. Moving the flags to MAKEFLAGS will need many packages to be changed and tested; therefore, we opt for a less invasive change for now and just remove -j for Make 4.2+, as the jobserver argument alone is enough to enable parallel builds for these Make versions. Signed-off-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* host-build.mk: change default installation prefix of package/* host builds ↵Felix Fietkau2016-01-201-10/+12
| | | | | | | | to staging_dir/target-*/host Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48401
* build: include homebrew include/library directory in cflags/ldflags on mac os xFelix Fietkau2015-10-051-0/+5
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 47139
* build: set CCACHE_DIR for host buildsFelix Fietkau2015-04-141-0/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45427