From 9732d0798de915e42cf2bbec6b155b4ff05c6ec1 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 8 Dec 2013 15:00:36 +0900 Subject: [PATCH] add system detection for freebsd --- setup.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup.sh b/setup.sh index 61b2e08..f09d8f3 100755 --- a/setup.sh +++ b/setup.sh @@ -38,16 +38,25 @@ gen_common(){ __ismsys=false __iscygwin=false __iswindows=false + __isdarwin=false + __isfreebsd=false + __isbsd=false + __islinux=false + # $OSTYPE is another choice. which is better? + # sh on FreeBSD does not define OSTYPE case `uname` in (MINGW*) __ismsys=true ;; (CYGWIN*) __iscygwin=true ;; (Darwin*) __isdarwin=true ;; + (FreeBSD*) __isfreebsd=true ;; (Linux*) __islinux=true ;; esac ( $__ismsys || $__iscygwin ) && __iswindows=true + # is this true? + ( $__isdarwin || $__freebsd ) && __isbsd=true cat <<__EOC__ >"$__shrc_common" #!/bin/sh @@ -58,7 +67,11 @@ gen_common(){ ismsys=$__ismsys iscygwin=$__iscygwin iswindows=$__iswindows + isdarwin=$__isdarwin +isfreebsd=$__isfreebsd +isbsd=$__isbsd + islinux=$__islinux __homelocal="$__homelocal"