Permalink
Browse files

On FreeBSD check and use gmake, use make elsewhere

  • Loading branch information...
1 parent 7de4ee0 commit 1321ba91096e4c40e84c872f8d029b1113c02e3d @fperrin fperrin committed Sep 21, 2011
Showing with 23 additions and 2 deletions.
  1. +2 −0 Makefile
  2. +1 −1 README
  3. +3 −0 config.mli
  4. +16 −0 configure
  5. +1 −1 qml2ocaml/qml2ocaml.ml
View
@@ -10,6 +10,8 @@
include config.make
INSTALL ?= cp -u -L
+MAKE ?= $_
+export MAKE
ifndef NO_REBUILD_OPA_PACKAGES
OPAOPT += "--rebuild"
View
2 README
@@ -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
View
@@ -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
View
@@ -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)}
@@ -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")
View
@@ -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

0 comments on commit 1321ba9

Please sign in to comment.