#!/bin/sh
# Copyright (c) 2002-2025 Peter Guentert. All rights reserved.

# Identify system type
# Peter Guentert, 04-09-2012
# Modified version, Peter Guentert, 08.10.2025

# ---- operating system ----

case $(uname)-$(uname -m) in
Linux-i?86) os=linux32;;
Linux-x86_64) os=linux64;;
Darwin-x86_64) os=mac;;
Darwin-arm64) os=macarm;;
*) os=unknown;;
esac

# ---- compiler ----

if [ "$1" = "compiler" ]; then
  for compiler in ifx ifort gfortran unknown; do
    if command -v $compiler >/dev/null 2>&1; then break; fi
  done
  echo $os-$compiler
else
  echo $os
fi
