summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ocamlbuild/Makefile10
-rw-r--r--ocamlbuild/ocaml_specific.ml12
-rw-r--r--ocamlbuild/ocamlbuild_where.ml5
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;;