aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-10-16 22:58:44 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-10-16 22:58:44 +0200
commite17529a3e3261dbc83c31d27f939a91b065ebe36 (patch)
tree5db6384c40190f08b8d6e9e4ec6e7117eecb8e1e /include
parent14bad2001f3f205af6d029ee8b55a0f6c4f0f4d0 (diff)
downloadupstream-e17529a3e3261dbc83c31d27f939a91b065ebe36.tar.gz
upstream-e17529a3e3261dbc83c31d27f939a91b065ebe36.tar.bz2
upstream-e17529a3e3261dbc83c31d27f939a91b065ebe36.zip
Revert "build: process variable exports from toplevel.mk only once"
This reverts commit ef7c34c1d1beac6bca4a683a3a161dd12a81f7e8. The commit seems to break all buildbots with messages like: /builder/shared-workdir/build/include/toplevel.mk:15: /builder/shared-workdir/build/include/toplevel-vars.mk: No such file or directory Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'include')
-rw-r--r--include/toplevel.mk52
1 files changed, 50 insertions, 2 deletions
diff --git a/include/toplevel.mk b/include/toplevel.mk
index 77a5b155ce..c233a4c214 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -11,14 +11,62 @@ PREP_MK= OPENWRT_BUILD= QUIET=0
export IS_TTY=$(shell tty -s && echo 1 || echo 0)
include $(TOPDIR)/include/verbose.mk
-ifeq ($(OPENWRT_VARS),)
- include $(TOPDIR)/include/toplevel-vars.mk
+
+ifeq ($(SDK),1)
+ include $(TOPDIR)/include/version.mk
+else
+ REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
+ SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_source_date_epoch.sh)
+endif
+
+HOSTCC ?= $(CC)
+export REVISION
+export SOURCE_DATE_EPOCH
+export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
+export GIT_ASKPASS:=/bin/true
+export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS))
+export GNU_HOST_NAME:=$(shell $(TOPDIR)/scripts/config.guess)
+export HOST_OS:=$(shell uname)
+export HOST_ARCH:=$(shell uname -m)
+
+# prevent perforce from messing with the patch utility
+unexport P4PORT P4USER P4CONFIG P4CLIENT
+
+# prevent user defaults for quilt from interfering
+unexport QUILT_PATCHES QUILT_PATCH_OPTS
+
+unexport C_INCLUDE_PATH CROSS_COMPILE ARCH
+
+# prevent distro default LPATH from interfering
+unexport LPATH
+
+# make sure that a predefined CFLAGS variable does not disturb packages
+export CFLAGS=
+export LDFLAGS=
+
+empty:=
+space:= $(empty) $(empty)
+path:=$(subst :,$(space),$(PATH))
+path:=$(filter-out .%,$(path))
+path:=$(subst $(space),:,$(path))
+export PATH:=$(path)
+
+unexport TAR_OPTIONS
+
+ifneq ($(shell $(HOSTCC) 2>&1 | grep clang),)
+ export HOSTCC_REAL?=$(HOSTCC)
+ export HOSTCC_WRAPPER:=$(TOPDIR)/scripts/clang-gcc-wrapper
+else
+ export HOSTCC_WRAPPER:=$(HOSTCC)
endif
ifeq ($(FORCE),)
.config scripts/config/conf scripts/config/mconf: staging_dir/host/.prereq-build
endif
+SCAN_COOKIE?=$(shell echo $$$$)
+export SCAN_COOKIE
+
SUBMAKE:=umask 022; $(SUBMAKE)
ULIMIT_FIX=_limit=`ulimit -n`; [ "$$_limit" = "unlimited" -o "$$_limit" -ge 1024 ] || ulimit -n 1024;