fix HOST_ARCH and GNU_HOST_NAME for freebsd and other operating systems
[openwrt.git] / include / host.mk
1
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/.host.mk
9
10 $(TOPDIR)/.host.mk: $(INCLUDE_DIR)/host.mk
11         @( \
12                 HOST_OS=`uname`; \
13                 case "$$HOST_OS" in \
14                         Linux) HOST_ARCH=`uname -m`;; \
15                         *) HOST_ARCH=`uname -p`;; \
16                 esac; \
17                 GNU_HOST_NAME=`gcc -dumpmachine`; \
18                 [ -n "$$GNU_HOST_NAME" ] || \
19                         GNU_HOST_NAME=`$(SCRIPT_DIR)/config.guess`; \
20                 echo "HOST_OS:=$$HOST_OS" > $@; \
21                 echo "HOST_ARCH:=$$HOST_ARCH" >> $@; \
22                 echo "GNU_HOST_NAME:=$$GNU_HOST_NAME" >> $@; \
23                 if tar --version 2>&1 | grep 'GNU' >/dev/null; then \
24                         echo "TAR_WILDCARDS:=--wildcards" >> $@; \
25                 fi; \
26         )
27