Permalink
Browse files

New platform: `FreeBSD'

GNU/kFreeBSD still uses `Linux' as the platform.

Like Linux, but uses `cp' instead of `cp -u'.
  • Loading branch information...
1 parent 5b71cd7 commit 7de4ee065c247941a40a94a69765fdc633ac17bc @fperrin fperrin committed Sep 12, 2011
Showing with 17 additions and 7 deletions.
  1. +1 −1 config.mli
  2. +13 −4 configure
  3. +1 −1 dependencies/installation_helper.sh
  4. +2 −1 platform_helper.sh
View
@@ -60,7 +60,7 @@ val all_tags : string list
val is_release : bool
(** the target OS type *)
-type os = Linux | Mac | Win32 | Cygwin
+type os = Linux | Mac | Win32 | Cygwin | FreeBSD
val os : os
(** the installation directory of external libraries, as in the ocamlopt '-I'
View
@@ -115,9 +115,12 @@ case $(uname) in
Darwin*)
echo-ok MacOS
IS_MAC=1;;
- Linux*)
+ Linux*|GNU/kFreeBSD)
echo-ok Linux
IS_LINUX=1;;
+ FreeBSD)
+ echo-ok FreeBSD
+ IS_FREEBSD=1;;
*)
echo-err "Not sure, probably Unix / Linux"
IS_LINUX=1
@@ -639,10 +642,11 @@ let available = [ $TAGS_LIST]
let all_tags = [ $(for t in $ALL_TAGS_LIST; do echo -n "\"$t\"; "; done)]
let is_release = $(camlbool "$IS_RELEASE")
-type os = Linux | Mac | Win32 | Cygwin
+type os = Linux | Mac | Win32 | Cygwin | FreeBSD
let os =
$(if [ -n "${IS_LINUX:-}" ]; then echo Linux
elif [ -n "${IS_MAC:-}" ]; then echo Mac
+ elif [ -n "${IS_FREEBSD:-}" ]; then echo FreeBSD
else echo 'match Sys.os_type with "Win32" -> Win32 | "Cygwin" -> Cygwin | _ -> assert false'
fi)
@@ -682,9 +686,11 @@ IS_RELEASE="$IS_RELEASE"
IS_LINUX="${IS_LINUX:-}"
IS_WINDOWS="${IS_WINDOWS:-}"
IS_MAC="${IS_MAC:-}"
+IS_FREEBSD="${IS_FREEBSD:-}"
OS=$(if [ -n "${IS_LINUX:-}" ]; then echo '"Linux"'
elif [ -n "${IS_MAC:-}" ]; then echo '"Mac"'
elif [ -n "${IS_WINDOWS:-}" ]; then echo '"Win32"'
+ elif [ -n "${IS_FREEBSD:-}" ]; then echo '"FreeBSD"'
else echo "Error: OS inconsistency" >&2; exit 2
fi)
@@ -702,8 +708,11 @@ EOF
sed 's/=["(]\(.*\)[)"]$/ := \1/' config.sh > config.make
if [ -n "${IS_MAC:-}" ]; then
- echo "INSTALL := gcp -u -L"
-fi >>config.make
+ echo "INSTALL := gcp -u -L" >>config.make
+fi
+if [ -n "${IS_FREEBSD:-}" ]; then
+ echo "INSTALL := cp" >>config.make
+fi
{
echo
@@ -338,7 +338,7 @@ package_install (){
./configure -prefix $PREFIX ${CYGOPT:-}
make world # clean world
make bootstrap
- if [ $IS_LINUX ] || [ $IS_MAC ]; then
+ if [ $IS_LINUX ] || [ $IS_MAC ] || [ $IS_FREEBSD ]; then
make opt && make opt.opt
fi
PREFIX=$INSTALLDIR $SUDO make install -e
View
@@ -16,7 +16,8 @@ IS_WINDOWS=""
case $(uname) in
CYGWIN*) IS_WINDOWS=1;;
Darwin*) IS_MAC=1;;
- Linux*) IS_LINUX=1;;
+ Linux*|GNU/kFreeBSD) IS_LINUX=1;;
+ FreeBSD) IS_FREEBSD=1;;
*)
echo "Error: could not detect OS. Defaulting to Linux" >&2
IS_LINUX=1

0 comments on commit 7de4ee0

Please sign in to comment.