Support for Debian/FreeBSD
[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                 gnu/kfreebsd*) arch=kfbsd ;;
14                 netbsd*)             arch=nbsd ;;
15                 openbsd*)            arch=obsd ;;
16                 darwin*)             arch=osx ;;
17                 cygwin_*)            arch=win32 ;;
18                 Windows_*)         arch=win32 ;;
19                 *)                       arch="UNKNOWN" ;;
20         esac
21         echo $arch
22 fi