(1) On Windows $(OS) is not undefined but contains "Windows_NT". Now handled in Makef...
[olsrd.git] / make / guess_os.sh
1 #!/bin/sh
2
3 if test -n "$OS"; then
4         echo $OS;
5         exit;
6 else
7         # OS not specified.
8         # get it from uname
9         arch=`uname -s | tr '[A-Z]' '[a-z]'`
10         case "$arch" in
11                 linux)          arch=linux ;;
12                 freebsd*)       arch=fbsd ;;
13                 netbsd*)        arch=nbsd ;;
14                 openbsd*)       arch=obsd ;;
15                 darwin*)        arch=osx ;;
16                 cygwin_*)       arch=win32 ;;
17                 Windows_*)      arch=win32 ;;
18                 *)              arch="UNKNOWN" ;;
19         esac
20         echo $arch
21 fi