diff options
author | Nicolas Pouillard <np@nicolaspouillard.fr> | 2009-03-05 14:33:06 +0000 |
---|---|---|
committer | Nicolas Pouillard <np@nicolaspouillard.fr> | 2009-03-05 14:33:06 +0000 |
commit | f897ed0c733daf28570bc4659c45df5b5bb2c1db (patch) | |
tree | a0e173d3ea1858f9d7b2b0d2c5772bd75b5fb6f1 | |
parent | 5da04f8b51f4059bb91ce60bf831d5c35ab8d631 (diff) |
ocamlbuild: Use libdir and bindir from the myocamlbuild_config.ml of OCaml
imported as ocamlbuild_Myocamlbuild_config.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9176 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | ocamlbuild/Makefile | 10 | ||||
-rw-r--r-- | ocamlbuild/ocaml_specific.ml | 12 | ||||
-rw-r--r-- | ocamlbuild/ocamlbuild_where.ml | 5 |
3 files changed, 15 insertions, 12 deletions
diff --git a/ocamlbuild/Makefile b/ocamlbuild/Makefile index 84dcc47be..36bf9ee9f 100644 --- a/ocamlbuild/Makefile +++ b/ocamlbuild/Makefile @@ -24,6 +24,7 @@ ifdef O OCAMLBUILD_OPTIONS := $(OCAMLBUILD_OPTIONS) $(O) endif +ifeq ($(wildcard ./ocamlbuild_Myocamlbuil*_config.ml),./ocamlbuild_Myocamlbuild_config.ml) ifeq ($(wildcard ./boot/oc*build),./boot/ocamlbuild) OCAMLBUILD=INSTALL_LIB=$(INSTALL_LIB) INSTALL_BIN=$(INSTALL_BIN) $(OCAMLBUILDCMD) -build-dir $(BUILDDIR) -no-links $(OCAMLBUILD_OPTIONS) LIBS=ocamlbuildlib ocamlbuildlightlib @@ -35,6 +36,8 @@ all: $(OCAMLBUILD) $(BYTE) $(NATIVE) byte: $(OCAMLBUILD) $(BYTE) +native: + $(OCAMLBUILD) $(NATIVE) profile: $(OCAMLBUILD) $(LIBS:=.p.cmxa) $(PROGRAMS:=.p.native) debug: @@ -52,6 +55,13 @@ all byte native: ocamlbuild.byte.start cp $(BUILDDIR)/ocamlbuild.native boot/ocamlbuild $(MAKE) $(MFLAGS) $(MAKECMDGOALS) OCAMLBUILD_OPTIONS="-nothing-should-be-rebuilt -verbose -1" endif +else +all byte native: + @echo "Please copy the myocamlbuild_config.ml of the OCaml source distribution" + @echo " as ocamlbuild_Myocamlbuild_config.ml" + @echo + @echo "$$ cp ../myocamlbuild_config.ml ocamlbuild_Myocamlbuild_config.ml" +endif ocamlbuild.byte.start: ./start.sh diff --git a/ocamlbuild/ocaml_specific.ml b/ocamlbuild/ocaml_specific.ml index 283ffaf2f..e5ad0a229 100644 --- a/ocamlbuild/ocaml_specific.ml +++ b/ocamlbuild/ocaml_specific.ml @@ -441,18 +441,6 @@ flag ["ocaml"; "doc"; "docfile"; "extension:tex"] (A"-latex");; flag ["ocaml"; "doc"; "docfile"; "extension:ltx"] (A"-latex");; flag ["ocaml"; "doc"; "docfile"; "extension:texi"] (A"-texi");; -(** Ocamlbuild plugin for it's own building *) -let install_lib = lazy (try Sys.getenv "INSTALL_LIB" with Not_found -> !*stdlib_dir/"ocamlbuild" (* not My_std.getenv since it's lazy*)) in -let install_bin = lazy (My_std.getenv ~default:"/usr/local/bin" "INSTALL_BIN") in -rule "ocamlbuild_where.ml" - ~prod:"%ocamlbuild_where.ml" - begin fun env _ -> - Echo( - ["let bindir = ref \""; String.escaped !*install_bin; "\";;\n"; - "let libdir = ref (try Filename.concat (Sys.getenv \"OCAMLLIB\") \"ocamlbuild\" with Not_found -> \""; - String.escaped !*install_lib; "\");;\n"], - env "%ocamlbuild_where.ml") - end;; ocaml_lib "ocamlbuildlib";; ocaml_lib "ocamlbuildlightlib";; diff --git a/ocamlbuild/ocamlbuild_where.ml b/ocamlbuild/ocamlbuild_where.ml new file mode 100644 index 000000000..1703a533e --- /dev/null +++ b/ocamlbuild/ocamlbuild_where.ml @@ -0,0 +1,5 @@ +let bindir = ref Ocamlbuild_Myocamlbuild_config.bindir;; +let libdir = ref begin + try Filename.concat (Sys.getenv "OCAMLLIB") "ocamlbuild" + with Not_found -> Ocamlbuild_Myocamlbuild_config.libdir +end;; |