1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-13 15:18:14 +00:00
Interlisp.maiko/bin/machinetype
Nick Briggs 09e73d4153
Update machinetype and osversion scripts to invoke config.guess from same directory (#479)
If machinetype or osversion are executed from other than the current working directory
they will fail to execute the config.guess script because it was invoked with "./config.guess".
This update attempts to determine the directory where machinetype or osversion
were found and uses the same path to invoke config.guess.
2023-08-03 10:18:02 -07:00

30 lines
916 B
Bash
Executable File

#!/bin/sh
#########################################################################
# #
# M A C H I N E T Y P E #
# #
# Compute the hardware architecture we're running on. #
# #
# (C) Copyright 2001 Venue. All Rights Reserved #
# #
#########################################################################
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
os=${LDEARCH:-`$SCRIPTPATH/config.guess`}
# o/s switch block
case "$os" in
m68k-*) echo m68k ;;
sparc-*) echo sparc ;;
alpha-*) echo alpha ;;
i*86-*-*) echo 386 ;;
armv7l-*-*) echo armv7l ;;
aarch64-*-*) echo aarch64 ;;
x86_64-apple-darwin15*) echo 386 ;;
x86_64-*) echo x86_64 ;;
powerpc-*) echo ppc ;;
amd64-*) echo x86_64 ;;
esac
### Don't leave the variables set.
unset os