Skip to content

Commit

Permalink
New platform: `FreeBSD'
Browse files Browse the repository at this point in the history
GNU/kFreeBSD still uses `Linux' as the platform.

Like Linux, but uses `cp' instead of `cp -u'.
  • Loading branch information
fperrin committed Sep 25, 2011
1 parent 5b71cd7 commit 7de4ee0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
17 changes: 13 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dependencies/installation_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion platform_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7de4ee0

Please sign in to comment.