File: osguess.sh

package info (click to toggle)
st 1.9-3.4
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 812 kB
  • sloc: ansic: 5,585; makefile: 379; asm: 362; sh: 27
file content (45 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# This script can be used to automatically guess target OS.
# It requires the config.guess utility which is a part of GNU Autoconf.
# GNU Autoconf can be downloaded from ftp://ftp.gnu.org/gnu/autoconf/
#
# Use "default" as a make target for automatic builds.
#


# Specify path to the config.guess utility (unless set via environment)
#CONFIG_GUESS_PATH=


if [ x"$CONFIG_GUESS_PATH" = x ]; then
  echo "Error: CONFIG_GUESS_PATH variable is not set"
  exit 1
fi

if [ ! -f "$CONFIG_GUESS_PATH/config.guess" ]; then
  echo "Can't find $CONFIG_GUESS_PATH/config.guess utility. Wrong path?"
  exit 1
fi

sys_info=`/bin/sh $CONFIG_GUESS_PATH/config.guess`

echo "Building for $sys_info"

case "$sys_info" in
  *-ibm-aix4*     ) OS=AIX        ;;
  *-freebsd*      ) OS=FREEBSD    ;;
  hppa*-hp-hpux11*) OS=HPUX       ;;
  *-sgi-irix6*    ) OS=IRIX       ;;
  *-linux*        ) OS=LINUX      ;;
  *-netbsd*       ) OS=NETBSD     ;;
  *-openbsd*      ) OS=OPENBSD    ;;
  *-dec-osf*      ) OS=OSF1       ;;
  *-solaris2*     ) OS=SOLARIS    ;;
  *-darwin*       ) OS=DARWIN     ;;
  *               ) OS=
                    echo "Sorry, unsupported OS"
                    exit 1        ;;
esac

echo "Making with OS=$OS"