xref: /freebsd/contrib/bmake/machine.sh (revision 4fde40d9)
1:
2# This is mostly redundant.
3# These days I use the pseudo machine "host" when building for host
4# and $TARGET_HOST for its objdir
5
6# RCSid:
7#	$Id: machine.sh,v 1.19 2023/01/17 18:30:21 sjg Exp $
8#
9#	@(#) Copyright (c) 1994-2023 Simon J. Gerraty
10#
11#	This file is provided in the hope that it will
12#	be of use.  There is absolutely NO WARRANTY.
13#	Permission to copy, redistribute or otherwise
14#	use this file is hereby granted provided that
15#	the above copyright notice and this notice are
16#	left intact.
17#
18#	Please send copies of changes and bug-fixes to:
19#	sjg@crufty.net
20#
21
22# leverage os.sh
23Mydir=`dirname $0`
24. $Mydir/os.sh
25
26# some further overrides - mostly for MACHINE_ACH
27case $OS in
28AIX)	# from http://gnats.netbsd.org/29386
29	MACHINE_ARCH=`bootinfo -T`
30	;;
31Bitrig)
32	MACHINE_ARCH=$MACHINE;
33	;;
34HP-UX)
35	MACHINE_ARCH=`IFS="/-."; set $MACHINE; echo $1`
36	;;
37esac
38
39(
40case "$0" in
41arch*)	echo $MACHINE_ARCH;;
42*)
43	case "$1" in
44	"")	echo $MACHINE;;
45	*)	echo $MACHINE_ARCH;;
46	esac
47	;;
48esac
49) | toLower
50