Commit Graph

2079 Commits (dc5ba0a48a489424c1c6b2b8509e229c17dc745a)

Author SHA1 Message Date
Felix Fietkau 053dc3b77a build: do not auto-clean packages where the autoremove step has not run
This avoids repeatedly unpacking and rebuilding packages that are
failing the build. Re-running the failing step should be much faster.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 6699f58fdb build: use if-then to avoid non-zero return codes in bin/ packaging code
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau fb07085218 build: fix bin/ package empty check
$(wildcard) is evaluated too early in the build process

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau afd2827c5c build: do not create empty directories in bin/
Some packages may not install any files

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 0e22d63775 build: fix CONFIG_AUTOREMOVE for packages with multiple variants
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>
7 years ago
Felix Fietkau f784b3e195 build: fix regression in handling ABI_VERSION
The code was updated without changing $$@ into the proper target
filename

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 5aa03e16a7 build: disable CONFIG_AUTOREMOVE for packages/tools where QUILT is used
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau bc73a7fd98 build: include CONFIG_AUTOREMOVE in HOST_STAMP_PREPARED
Fixes build issues when changing the CONFIG_AUTOREMOVE setting

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 86a72765b9 build: include CONFIG_AUTOREMOVE in STAMP_PREPARED
Fixes build issues when changing the CONFIG_AUTOREMOVE setting

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau d98bb7e6b9 build: extend CONFIG_AUTOREMOVE to tools/
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 131db366a3 build: remove separate /install step for host builds
Reduces the number of recursive make invocations

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 7a523569f7 build: add support for automatically removing build dir contents during build
This is used to save space on buildbot instances.
If any part of a package needs to be rebuild, the whole package is
rebuilt from scratch. Stamp files are preserved to allow dependency
checks to work

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau c150a190f5 build: stage bin/ packages inside PKG_BUILD_DIR
This makes the build slightly more efficient by avoiding the need to
re-stage packages on every full build run.

It is also necessary for the upcoming CONFIG_AUTOREMOVE feature

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 87d9e3462d build: stage unstripped packages inside PKG_BUILD_DIR
This makes the build slightly more efficient by avoiding the need to
re-stage packages on every full build run.

It is also necessary for the upcoming CONFIG_AUTOREMOVE feature

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 8aa93dafc8 build: write ABI_VERSION file when staging the package
The make target does not rewrite the file if the contents didn't
change. This causes make to always consider the target old.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 9228d1c066 build: introduce extra targets that contain only proper dependencies
This can be used to check if targets like prepare or compile are up to date

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 6cf067d084 build: define common subdir targets in rules.mk
Reduce build system clutter and enable further rework

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Mirko Vogt c99f881568 git-kernel: $(SUBDIR) should always be $(LINUX_VERSION)
Before SUBDIR was set to $(PATCHVER) which may
or may not include the minor version number of
the linux kernel version. Usually it doesn't.

So the git-clone'd linux kernel was packed without
the minor version number taken into account, which
broke further processing, as it expected the
extracted dir being named linux-$(LINUX_VERSION)
(=with minor version) rather than linux-$(PATCHVER)
(=without minor version).

Changing SUBDIR to $(LINUX_VERSION) creates
consistent behaviour here.

Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
7 years ago
Matthias Schiffer 3d71786154
build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common 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>
7 years ago
Jo-Philipp Wich 5faad30d5d build: properly pass CPP and CXX flags in HOST_MAKE_VARS
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Alexandru Ardelean e9d20f1f87 build: introduce default HOST_MAKE_VARS for host-builds
Inspired/adapted from `package-defaults.mk` MAKE_VARS.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
7 years ago
Andrej Vlasic 5c20a4fec9 ubox: turn logd into a separate package
Currently system log is always included as a part of ubox. Add logd as a
seperate package and add it to default packages list.

Signed-off-by: Andrej Vlasic <andrej.vlasic@sartura.hr>
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
7 years ago
Matthias Schiffer 9c55dede26
include/feeds.mk: base list of enabled feeds on available instead of installed feeds
This fixes handling of CONFIG_FEED_* options for uninstalled feeds.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Matthias Schiffer 12d0a66942
include/autotools.mk: use STAGING_DIR_HOSTPKG where appropriate
Make sure binaries install to STAGING_DIR_HOSTPKG are still found when
this variable is eventually modified.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Hauke Mehrtens 5b089e45a6 kernel: update 4.4 kernel to 4.4.42
Refresh patches on all 4.4 supported platforms.
Compile & run tested: lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Felix Fietkau 8af5e5751d image.mk: add generic function for gzipping images if enabled
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 87b668765e image: when using the new image build code, gzip ext4 images by default
This reduces the amount of hacks in the makefile code.

Remove the apm821xx code to do the same - it was broken and left both
compressed and uncompressed images in $(BIN_DIR)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Ian Pozella 859693509f image.mk: use LINUX_KARCH rather than ARCH for mkits
The generated 'its' is passed to mkimage which expects linux arch
strings rather than the full arch (e.g. mips not mipsel).

It currently works in some cases where LINUX_KARCH == ARCH but
otherwise you get an unknown arch build error.

Signed-off-by: Ian Pozella <Ian.Pozella@imgtec.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 5919cc2dc4 build: let make check warn about use of legacy PKG_MD5SUM variable in feeds
The variable rename change has been merged in OpenWrt now, so it's
possible to convert the feeds as well.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau b7bee2858b kernel: remove linux 4.1 support
The only target still referencing it is omap24xx, and it is marked as
broken.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Jo-Philipp Wich 90ed0aa859 build: scan.mk: consider KernelPackage pattern as well
The removal of the ".+Package" pattern in scan.mk also caused the build
system to skip over Makefiles defining only kmods. Adjust the grep pattern
to consider packages with "call KernelPackage" signatures as well.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich a891e5e14f build: scan.mk: remove overlay broad grep pattern
Commit af0b91c "allow scan.mk to find python packages introduced in [8639]"
added some special casing to scan.mk to accomodate some nonstandard python
packages.

Nowadays this pattern is not needed anymore and produces false positives
when using the LEDE source repository as feed within the SDK since the
metadata scanning wrongly picks up target/imagebuilder/Makefile as package,
leading to an  "ERROR: please fix feeds/base/target/imagebuilder/Makefile"
message.

Remove the now uneeded pattern to fix such stray errors during metadata
scanning.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Jo-Philipp Wich 83b6bfc235 build: fix HOST_CONFIGURE_VARS placement
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>
7 years ago
Felix Fietkau 1e1d735e52 build: remove obsolete parallel build related options
Always use the main make jobserver, which has been the default for ages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 5903c46ef8 build: fix build of ubifs images
--force-compr was added by the xz compression patch, which is gone now.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau c2e6ca26e5 build: add image command for calling kernel2minor
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Hauke Mehrtens 88ca6390ea kernel: bump to 4.4.40
Refresh patches on all 4.4 supported platforms.
Compile & run tested: lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
7 years ago
Jo-Philipp Wich 267b05f273 Revert "build: fix HOST_CONFIGURE_VARS placement"
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>
8 years ago
Jo-Philipp Wich 28f9df62f5 build: fix HOST_CONFIGURE_VARS placement
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>
8 years ago
Felix Fietkau d2ddda691e build: ensure that prereq-build is run before metadata scan from feeds (FS#367)
Fixes ./scripts/feeds update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Yousong Zhou 4ebb13a0ef build: unzip: perform operations quietly
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
8 years ago
Felix Fietkau 84bd74057f build: use mkhash to replace various quirky md5sum/openssl calls
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau dad48c6438 build: add a small standalone utility for calculating md5/sha256 hash
This will be used to simplify the build system code for checking hashes.
Instead of using various variants of md5sum / openssl, use one simple
utility for all of them

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau bdaa138c0d host-build: remove openssl include path from host cflags
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau f6e6341d89 tools: build libressl on all systems
Useful for having a more consistent build environment and finding API
issues faster

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Stijn Tintel a93accd73d kernel: allow subtarget specific KernelPackage
Add a call to KernelPackage/$(1)/$(BOARD)/$(SUBTARGET) to the
KernelPackage macro. This allows to add kernel packages for x86/64,
without breaking x86. It's not possible to do this with BOARD, as
BOARD=x86 for x86_64.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
8 years ago
Alexandru Ardelean 15d8d9c271 build: drop `trapret` function from non-Linux HOST_TAR variant
Looks like this was meant to workaround some limitations with
non-GNU tar variants (like BSD-tar which are present on Mac os BSD hosts).

Though, I cannot find any use of that `+s` option that's mentioned
in the comment.

Last hash of this I found was 24faf55360

In my case, it now this fails for `python-setuptools` on Mac OS X (the host-build with):
```
trapret 2 tar -C <home-dir>/work/sources-work/lede/build_dir/target-i386_pentium4_musl-1.1.15/python-setuptools-27.2.0 --strip-components=1 -xzf <home-dir>/work/sources-work/lede/dl/setuptools-27.2.0.tar.gz
bash: trapret: command not found
```

So, I was thinking maybe it's time to remove this workaround (9 years later).
I could also fix the `python-setuptools` host build. If that's more preferred.

[ Btw, I just recently transitioned to a Mac machine for dev-ing,
  so a lot of (this Mac) stuff I'm finding out is new to me too. ]

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
8 years ago
Felix Fietkau ffb0181a87 build: add defaults for PKG_SOURCE, PKG_SOURCE_SUBDIR, PKG_VERSION
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>
8 years ago
Rafał Miłecki b522292405 base-files: add support for overlaying rootfs content
This adds support for install-overlay define. When used in package it
allows installing files to a special directory that gets copied to the
root when installing it.
It allows overwriting files provided by other packages.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago
Kevin Darbyshire-Bryant 79abb8f140 kernel: bump to 4.4.39
Bump & refresh patches for all 4.4 targets.

Compile & run tested: ar71xx Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
8 years ago