aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-02-20 14:24:54 +0100
committerFelix Fietkau <nbd@nbd.name>2017-02-26 13:31:44 +0100
commit9467ce42da7fbcec1a4b5b8e08e2dcea3c67aa96 (patch)
treec3d4f2ab3090a91a89fd731a2499aa341e3cc1e8 /include
parentbe206eba3a57128695a00f490767e5c136e43ab7 (diff)
downloadupstream-9467ce42da7fbcec1a4b5b8e08e2dcea3c67aa96.tar.gz
upstream-9467ce42da7fbcec1a4b5b8e08e2dcea3c67aa96.tar.bz2
upstream-9467ce42da7fbcec1a4b5b8e08e2dcea3c67aa96.zip
build: get rid of host.mk
Defined required host related variables in toplevel.mk instead Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'include')
-rw-r--r--include/host-build.mk1
-rw-r--r--include/host.mk46
-rw-r--r--include/image.mk1
-rw-r--r--include/kernel-build.mk1
-rw-r--r--include/package.mk1
-rw-r--r--include/prereq-build.mk7
-rw-r--r--include/scan.mk4
-rw-r--r--include/toplevel.mk4
8 files changed, 8 insertions, 57 deletions
diff --git a/include/host-build.mk b/include/host-build.mk
index ffb68468f9..c8477e1ddf 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -19,7 +19,6 @@ else
HOST_JOBS?=$(if $(HOST_BUILD_PARALLEL),$(HOST_MAKE_J),-j1)
endif
-include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/unpack.mk
include $(INCLUDE_DIR)/depends.mk
diff --git a/include/host.mk b/include/host.mk
deleted file mode 100644
index 2ccab8e1e6..0000000000
--- a/include/host.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 2007-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-TMP_DIR ?= $(TOPDIR)/tmp
-ifeq ($(if $(TARGET_BUILD),,$(DUMP)),)
- -include $(TMP_DIR)/.host.mk
-endif
-
-ifneq ($(__host_inc),1)
-__host_inc:=1
-
-export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
-
-try-run = $(shell set -e; \
- TMP_F="$(TMP_DIR)/try-run.$$$$.tmp"; \
- if ($(1)) >/dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi; \
- rm -f "$$TMP_F"; \
-)
-
-host-cc-option = $(call try-run, \
- $(HOSTCC) $(HOST_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP_F",$(1),$(2) \
-)
-
-.PRECIOUS: $(TMP_DIR)/.host.mk
-$(TMP_DIR)/.host.mk: $(TOPDIR)/include/host.mk
- @mkdir -p $(TMP_DIR)
- @( \
- HOST_OS=`uname`; \
- case "$$HOST_OS" in \
- Linux) HOST_ARCH=`uname -m`;; \
- Darwin) HOST_ARCH=`uname -m`;; \
- *) HOST_ARCH=`uname -p`;; \
- esac; \
- GNU_HOST_NAME=`gcc -dumpmachine`; \
- [ -z "$$GNU_HOST_NAME" -o "$$HOST_OS" = "Darwin" ] && \
- GNU_HOST_NAME=`$(TOPDIR)/scripts/config.guess`; \
- echo "HOST_OS:=$$HOST_OS" > $@; \
- echo "HOST_ARCH:=$$HOST_ARCH" >> $@; \
- echo "GNU_HOST_NAME:=$$GNU_HOST_NAME" >> $@; \
- ) >/dev/null 2>/dev/null
-
-endif
diff --git a/include/image.mk b/include/image.mk
index 81519cd183..9bc30c663d 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -8,7 +8,6 @@
override TARGET_BUILD=
include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/kernel.mk
-include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/image-commands.mk
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 56c0fe386b..7d1e23c6ea 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -4,7 +4,6 @@
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
-include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/depends.mk
diff --git a/include/package.mk b/include/package.mk
index ce1aa256bd..a3ef3029d8 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -37,7 +37,6 @@ endif
include $(INCLUDE_DIR)/hardening.mk
include $(INCLUDE_DIR)/prereq.mk
-include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/unpack.mk
include $(INCLUDE_DIR)/depends.mk
diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index af4e8b5e14..2d3a1faf2d 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -7,7 +7,6 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/prereq.mk
-include $(INCLUDE_DIR)/host.mk
include $(INCLUDE_DIR)/host-build.mk
SHELL:=sh
@@ -123,9 +122,9 @@ $(eval $(call SetupHostCommand,getopt, \
getopt -o t --long test -- --test | grep '^ *--test *--'))
$(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
- gnustat -c%s $(TMP_DIR)/.host.mk, \
- gstat -c%s $(TMP_DIR)/.host.mk, \
- stat -c%s $(TMP_DIR)/.host.mk))
+ gnustat -c%s $(TOPDIR)/Makefile, \
+ gstat -c%s $(TOPDIR)/Makefile, \
+ stat -c%s $(TOPDIR)/Makefile))
$(eval $(call SetupHostCommand,unzip,Please install 'unzip', \
unzip 2>&1 | grep zipfile, \
diff --git a/include/scan.mk b/include/scan.mk
index 92f2dc3f93..86d9576c82 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -3,8 +3,6 @@ TMP_DIR:=$(TOPDIR)/tmp
all: $(TMP_DIR)/.$(SCAN_TARGET)
-include $(TOPDIR)/include/host.mk
-
SCAN_TARGET ?= packageinfo
SCAN_NAME ?= package
SCAN_DIR ?= package
@@ -12,6 +10,8 @@ TARGET_STAMP:=$(TMP_DIR)/info/.files-$(SCAN_TARGET).stamp
FILELIST:=$(TMP_DIR)/info/.files-$(SCAN_TARGET)-$(SCAN_COOKIE)
OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
+export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
+
ifeq ($(IS_TTY),1)
define progress
printf "\033[M\r$(1)" >&2;
diff --git a/include/toplevel.mk b/include/toplevel.mk
index a9ea21bbef..0f68580955 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -24,6 +24,9 @@ export REVISION
export SOURCE_DATE_EPOCH
export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
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
@@ -148,7 +151,6 @@ kernel_nconfig: prepare_kernel_conf
staging_dir/host/.prereq-build: include/prereq-build.mk
mkdir -p tmp
- rm -f tmp/.host.mk
@$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
echo "Prerequisite check failed. Use FORCE=1 to override."; \
false; \