Fixed some bugs in the configure

Check that ocamlc and ocamlfind point to the
same stdlib dir.
This commit is contained in:
Cédric Pasteur 2011-11-14 10:52:06 +01:00
parent 8b1f4bbe87
commit 8644982593
5 changed files with 19 additions and 23 deletions

View file

@ -8,7 +8,7 @@ let df = function
ocamlfind_after_rules ();
(* Tell ocamlbuild about the camlp4 library. *)
ocaml_lib ~extern:true ~dir:"+camlp4" "camlp4";
ocaml_lib ~extern:true ~dir:(ocamlfind_query "camlp4") "camlp4";
(* Add preproc.cmo to the ocaml pre-processor when use_preproc is set *)
flag ["ocaml"; "pp"; "use_preproc"] (A "preproc.cmo");

View file

@ -32,6 +32,10 @@ let find_syntaxes () = ["camlp4o"; "camlp4r"]
(* ocamlfind command *)
let ocamlfind x = S[A"ocamlfind"; x]
let ocamlfind_query pkg =
let cmd = Printf.sprintf "ocamlfind query %s" (Filename.quote pkg) in
Ocamlbuild_pack.My_unix.run_and_open cmd (fun ic -> input_line ic)
let ocamlfind_before_options () =
(* by using Before_options one let command line options have an higher priority *)
(* on the contrary using After_options will guarantee to have the higher priority *)

22
config
View file

@ -1,22 +0,0 @@
srcdir = .
top_srcdir = .
prefix = /opt/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
libdir = ${exec_prefix}/lib
INSTALL= /usr/bin/install -c
MAKE= @MAKE@
BUILD= _build
COMPILER=heptc
SIMULATOR=hepts
INSTALL_BINDIR=$(bindir)
INSTALL_LIBDIR=$(libdir)/heptagon
STDLIB_DIR=${exec_prefix}/lib/heptagon
OCAMLBUILD=STDLIB=$(STDLIB_DIR) ocamlbuild
TARGET=byte
ENABLE_SIMULATOR=yes

7
configure vendored
View file

@ -2929,6 +2929,12 @@ echo "$as_me: error: Please install OCaml findlib (the ocamlfind command)" >&2;}
{ (exit 1); exit 1; }; }
fi
OCAMLC_STDLIB=`$OCAMLFIND ocamlc -where`
OCAMLFIND_STDLIB=`$OCAMLFIND printconf stdlib`
if test "$OCAMLC_STDLIB" != "$OCAMLFIND_STDLIB"; then
as_fn_error $? "OCaml and OCamlfind are installed in different directories" "$LINENO" 5
fi
# Extract the first word of "menhir", so it can be a program name with args.
set dummy menhir; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
@ -3074,6 +3080,7 @@ fi
ac_config_files="$ac_config_files config"
cat >confcache <<\_ACEOF

View file

@ -25,6 +25,12 @@ if test "$OCAMLFIND" = "no"; then
AC_MSG_ERROR([Please install OCaml findlib (the ocamlfind command)])
fi
OCAMLC_STDLIB=`$OCAMLFIND ocamlc -where`
OCAMLFIND_STDLIB=`$OCAMLFIND printconf stdlib`
if test "$OCAMLC_STDLIB" != "$OCAMLFIND_STDLIB"; then
AC_MSG_ERROR([OCaml and OCamlfind make different assumptions about the standard library directory])
fi
AC_CHECK_PROG(MENHIR,menhir,menhir,no)
if test "$MENHIR" = no ; then
AC_MSG_ERROR(Please install menhir.)
@ -52,6 +58,7 @@ else
stdlib_dir=$libdir/heptagon
fi
AC_SUBST(INSTALL)
AC_SUBST(stdlib_dir)