another round of Makefile cleanup
[olsrd.git] / make / guess_os.sh
1 #!/bin/sh
2
3 if test -n "$OS"; then
4         # cygwin exports the OS environment vaiable - fix it. 
5         # otherwiese accept the user supplied OS
6         case "$OS" in
7                 Windows*)       OS=win32 ;;
8         esac
9         echo $OS;
10         exit;
11 else
12         # OS not specified.
13         # get it from uname
14         arch=`uname -s | tr '[A-Z]' '[a-z]'`
15         case "$arch" in
16                 linux)          arch=linux ;;
17                 freebsd*)       arch=fbsd ;;
18                 netbsd*)        arch=nbsd ;;
19                 openbsd*)       arch=obsd ;;
20                 osx*)           arch=osx ;;
21                 cygwin_*)       arch=win32 ;;
22                 Windows_*)      arch=win32 ;;
23                 *)              arch="UNKNOWN" ;;
24         esac
25         echo $arch
26 fi