1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-15 15:57:13 +00:00
Interlisp.maiko/bin/osversion
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

18 lines
574 B
Bash
Executable File

#!/bin/sh
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
os=${LDEARCH:-`$SCRIPTPATH/config.guess`}
case "$os" in
m68k-*-amigaos) echo amigaos ;;
sparc-sun-sunos*) echo sunos4 ;;
sparc-sun-solaris1*) echo sunos4 ;;
*-*-solaris2*) echo sunos5 ;;
alpha-dec-osf1) echo osf1 ;;
*-apple-darwin*) echo darwin ;;
*-*-linux*) echo linux ;;
*-*-openbsd*) echo openbsd ;;
*-*-freebsd*) echo freebsd ;;
*-*-cygwin*) echo cygwin ;;
esac
### Don't leave the variable set.
unset os