2 # Copyright (C) 2007-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 TMP_DIR ?
= $(TOPDIR
)/tmp
9 ifeq ($(if
$(TARGET_BUILD
),,$(DUMP
)),)
10 -include $(TMP_DIR
)/.host.mk
15 ifneq ($(__host_inc
),1)
18 try-run
= $(shell set
-e
; \
19 TMP_F
="$(TMP_DIR)/try-run.$$$$.tmp"; \
20 if
($(1)) >/dev
/null
2>&1; then echo
"$(2)"; else echo
"$(3)"; fi
; \
24 host-cc-option
= $(call try-run
, \
25 $(HOSTCC
) $(HOST_CFLAGS
) $(1) -c
-xc
/dev
/null
-o
"$$TMP_F",$(1),$(2) \
28 .PRECIOUS
: $(TMP_DIR
)/.host.mk
29 $(TMP_DIR
)/.host.mk
: $(TOPDIR
)/include/host.mk
34 Linux
) HOST_ARCH
=`uname -m`;; \
35 *) HOST_ARCH
=`uname -p`;; \
37 GNU_HOST_NAME
=`gcc -dumpmachine`; \
38 [ -n
"$$GNU_HOST_NAME" ] || \
39 GNU_HOST_NAME
=`$(SCRIPT_DIR)/config.guess`; \
40 echo
"HOST_OS:=$$HOST_OS" > $@
; \
41 echo
"HOST_ARCH:=$$HOST_ARCH" >> $@
; \
42 echo
"GNU_HOST_NAME:=$$GNU_HOST_NAME" >> $@
; \
43 TAR
=`which gtar 2>/dev/null`; \
44 [ -n
"$$TAR" -a
-x
"$$TAR" ] || TAR
=`which gnutar 2>/dev/null`; \
45 [ -n
"$$TAR" -a
-x
"$$TAR" ] || TAR
=`which tar 2>/dev/null`; \
46 echo
"TAR:=$$TAR" >> $@
; \
47 FIND
=`which gfind 2>/dev/null`; \
48 [ -n
"$$FIND" -a
-x
"$$FIND" ] || FIND
=`which find 2>/dev/null`; \
49 echo
"FIND:=$$FIND" >> $@
; \
50 echo
"BASH:=$(shell which bash)" >> $@
; \
51 if
$$FIND -L
/tmp
-maxdepth
0 >/dev
/null
2>/dev
/null
; then \
52 echo
"FIND_L=$$FIND -L \$$(1)" >>$@
; \
54 echo
"FIND_L=$$FIND \$$(1) -follow" >> $@
; \
56 if xargs
--help
2>&1 | grep
'gnu.org' >/dev
/null
; then \
57 echo
'XARGS:=xargs -r' >> $@
; \
59 echo
'XARGS:=xargs' >> $@
; \
This page took 0.043929 seconds and 5 git commands to generate.