xref: /freebsd/contrib/bmake/machine.sh (revision 4fde40d9b540ea1a544cb4378a14f2f6da85ca6d)
13955d011SMarcel Moolenaar:
2*4fde40d9SSimon J. Gerraty# This is mostly redundant.
3*4fde40d9SSimon J. Gerraty# These days I use the pseudo machine "host" when building for host
4*4fde40d9SSimon J. Gerraty# and $TARGET_HOST for its objdir
53955d011SMarcel Moolenaar
63955d011SMarcel Moolenaar# RCSid:
7*4fde40d9SSimon J. Gerraty#	$Id: machine.sh,v 1.19 2023/01/17 18:30:21 sjg Exp $
83955d011SMarcel Moolenaar#
9*4fde40d9SSimon J. Gerraty#	@(#) Copyright (c) 1994-2023 Simon J. Gerraty
103955d011SMarcel Moolenaar#
113955d011SMarcel Moolenaar#	This file is provided in the hope that it will
123955d011SMarcel Moolenaar#	be of use.  There is absolutely NO WARRANTY.
133955d011SMarcel Moolenaar#	Permission to copy, redistribute or otherwise
143955d011SMarcel Moolenaar#	use this file is hereby granted provided that
153955d011SMarcel Moolenaar#	the above copyright notice and this notice are
163955d011SMarcel Moolenaar#	left intact.
173955d011SMarcel Moolenaar#
183955d011SMarcel Moolenaar#	Please send copies of changes and bug-fixes to:
193955d011SMarcel Moolenaar#	sjg@crufty.net
203955d011SMarcel Moolenaar#
213955d011SMarcel Moolenaar
22*4fde40d9SSimon J. Gerraty# leverage os.sh
23*4fde40d9SSimon J. GerratyMydir=`dirname $0`
24*4fde40d9SSimon J. Gerraty. $Mydir/os.sh
253955d011SMarcel Moolenaar
26*4fde40d9SSimon J. Gerraty# some further overrides - mostly for MACHINE_ACH
273955d011SMarcel Moolenaarcase $OS in
28e22fef7dSSimon J. GerratyAIX)	# from http://gnats.netbsd.org/29386
29e22fef7dSSimon J. Gerraty	MACHINE_ARCH=`bootinfo -T`
30e22fef7dSSimon J. Gerraty	;;
3128a6bc81SSimon J. GerratyBitrig)
32*4fde40d9SSimon J. Gerraty	MACHINE_ARCH=$MACHINE;
333955d011SMarcel Moolenaar	;;
343955d011SMarcel MoolenaarHP-UX)
35*4fde40d9SSimon J. Gerraty	MACHINE_ARCH=`IFS="/-."; set $MACHINE; echo $1`
363955d011SMarcel Moolenaar	;;
373955d011SMarcel Moolenaaresac
383955d011SMarcel Moolenaar
393955d011SMarcel Moolenaar(
403955d011SMarcel Moolenaarcase "$0" in
413955d011SMarcel Moolenaararch*)	echo $MACHINE_ARCH;;
423955d011SMarcel Moolenaar*)
433955d011SMarcel Moolenaar	case "$1" in
443955d011SMarcel Moolenaar	"")	echo $MACHINE;;
453955d011SMarcel Moolenaar	*)	echo $MACHINE_ARCH;;
463955d011SMarcel Moolenaar	esac
473955d011SMarcel Moolenaar	;;
483955d011SMarcel Moolenaaresac
49*4fde40d9SSimon J. Gerraty) | toLower
50