#! /bin/sh # -*-sh-*- # # $Id: sw.in,v 1.2 2004/04/08 01:52:19 mdw Exp $ # # Determine a canonical `sw' architecture name # # MAKE SURE I GET UPDATED WHEN NEW ARCHITECTURES ARE ADDED! # # (c) 1999 EBI # #----- Licensing notice ----------------------------------------------------- # # This file is part of sw-tools. # # sw-tools is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # sw-tools is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with sw-tools; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # --- Commentary --- # # This is deliberately *not* the same as Autoconf's `config.guess'. The GNU # names are too specific for our purposes, because they encode version # numbering information that we don't really want to know about. This # operation is deliberately simple, so that new things can be added easily. # --- Step one: find out about the CPU architecture --- CPU=`uname -p 2>/dev/null || echo unknown`; CPU=`echo $CPU | tr A-Z a-z` case $CPU in unknown) CPU=`uname -m` ;; esac case $CPU in i?86) CPU=i386 ;; esac # --- Step two: find out about the OS --- OS=`uname -s`; OS=`echo $OS | tr A-Z a-z` case $OS in irix*) OS=irix ;; sunos*) OS=solaris ;; esac # --- Write the result --- arch=$CPU-$OS case "$1" in --archname) echo $arch; exit 0;; esac # --- Run the main `sw' binary --- # # Ugly hack for broken OSF1 /bin/sh. prefix=@prefix@ datadir=@datadir@ sw=@SW@ if [ $# = 0 ]; then exec "${datadir}/libexec/${arch}/${sw}" else exec "${datadir}/libexec/${arch}/${sw}" "$@" fi #----- That's all, folks ----------------------------------------------------