Skip to content

Commit

Permalink
On FreeBSD check and use gmake, use make elsewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrin committed Sep 25, 2011
1 parent 7de4ee0 commit 1321ba9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -10,6 +10,8 @@
include config.make

INSTALL ?= cp -u -L
MAKE ?= $_
export MAKE

ifndef NO_REBUILD_OPA_PACKAGES
OPAOPT += "--rebuild"
Expand Down
2 changes: 1 addition & 1 deletion README
Expand Up @@ -21,7 +21,7 @@ $ sudo make install

should get you there. ./configure should report any missing dependencies and
point you to the packages you may install to fix them (although those may depend
on your distribution).
on your distribution). make needs to be GNU make.

The main dependency of OPA is OCaml 3.12. In case your distribution doesn't
provide a recent enough version, or if you miss some other dependencies, you can
Expand Down
3 changes: 3 additions & 0 deletions config.mli
Expand Up @@ -63,6 +63,9 @@ val is_release : bool
type os = Linux | Mac | Win32 | Cygwin | FreeBSD
val os : os

(** the name of the GNU make binary, gmake on fBSD, make on other platforms *)
val makebinary : string

(** the installation directory of external libraries, as in the ocamlopt '-I'
command-line option ; None if no extra include directory is needed *)
module Libdir : sig
Expand Down
16 changes: 16 additions & 0 deletions configure
Expand Up @@ -176,6 +176,16 @@ if [ -n "${IS_MAC:-}" ]; then
. ./platform_helper.sh
fi

if [ -n "${IS_FREEBSD:-}" ]; then
echo-check gmake
if which gmake >/dev/null 2>&1; then echo-ok ok
else
echo-err Not found
echo "Please install port devel/gmake."
exit 1
fi >&2
fi

# check ocaml version and location
echo-check ocamlopt
if OCAMLOPT=${OCAMLOPT:-$(which ocamlopt.opt)} || OCAMLOPT=${OCAMLOPT:-$(which ocamlopt)}
Expand Down Expand Up @@ -650,6 +660,12 @@ let os =
else echo 'match Sys.os_type with "Win32" -> Win32 | "Cygwin" -> Cygwin | _ -> assert false'
fi)
let makebinary =
$(if [ -n "${IS_FREEBSD:-}" ];
then echo '"gmake"'
else echo '"make"'
fi)
module Libdir = struct
let ssl = $(dir_opt "$CONFIG_LIB_OCAMLSSL")
let cryptokit = $(dir_opt "$CONFIG_LIB_CRYPTOKIT")
Expand Down
2 changes: 1 addition & 1 deletion qml2ocaml/qml2ocaml.ml
Expand Up @@ -703,7 +703,7 @@ prerr_endline \"CHECKUP - LIBS - OK\"
in

let compilation_via_makefile =
let make = Printf.sprintf "make --makefile=%s -W %s -j %d %s" target_makefile target_makefile options.O.makefile_max_jobs
let make = Printf.sprintf "%s --makefile=%s -W %s -j %d %s" Config.makebinary target_makefile target_makefile options.O.makefile_max_jobs
(match options.O.makefile_rule with
| O.Bytecode ->
(match ObjectFiles.compilation_mode () with
Expand Down

0 comments on commit 1321ba9

Please sign in to comment.