Commit 625dcacf authored by Gerd Stolpmann's avatar Gerd Stolpmann

Merge branch 'ocamlnat'

parents 7c57a150 f9e16a08
......@@ -7,7 +7,7 @@
#set -x
version="1.6.2"
version="1.6.2-ocamlnat"
# Remember the old IFS value:
oldifs="$IFS"
......@@ -400,6 +400,14 @@ ocaml -I +compiler-libs itest-aux/ppx.ml >/dev/null || {
enable_topfind_ppxopt=false
}
######################################################################
# Check for -opaque
echo "Checking for ocamlc -opaque..."
opaque="-opaque"
ocamlc -opaque || opaque=""
######################################################################
# Configure libraries
......@@ -609,6 +617,7 @@ if [ "$mingw_lib" != "" ]; then
echo "OCAMLC_FLAGS=-I \"${mingw_lib}\"" >>Makefile.config
echo "OCAMLOPT_FLAGS=-I \"${mingw_lib}\"" >>Makefile.config
fi
echo "OPAQUE=${opaque}" >>Makefile.config
# All OK
......
......@@ -27,6 +27,7 @@ OBJECTS = findlib_config.cmo fl_split.cmo fl_metatoken.cmo fl_meta.cmo \
TOBJECTS = topfind.cmo
XOBJECTS = $(OBJECTS:.cmo=.cmx)
TXOBJECTS = topfind.cmx
OCAMLFIND_OBJECTS = ocaml_args.cmo frontend.cmo
OCAMLFIND_XOBJECTS = ocaml_args.cmx frontend.cmx
......@@ -40,7 +41,7 @@ DYNLOAD_XOBJECTS = $(DYNLOAD_OBJECTS:.cmo=.cmx)
all: ocamlfind$(EXEC_SUFFIX) findlib.cma findlib_top.cma topfind num_top.cma \
findlib_dynload.cma
opt: ocamlfind_opt$(EXEC_SUFFIX) findlib.cmxa topfind \
opt: ocamlfind_opt$(EXEC_SUFFIX) findlib.cmxa findlib_top.cmxa topfind \
findlib_dynload.cmxa
ocamlfind$(EXEC_SUFFIX): findlib.cma $(OCAMLFIND_OBJECTS)
......@@ -66,6 +67,12 @@ findlib.cmxa: $(XOBJECTS)
$(OCAMLOPT) -shared -o findlib.cmxs $(XOBJECTS); \
fi
findlib_top.cmxa: $(TXOBJECTS)
$(OCAMLOPT) -a -o findlib_top.cmxa $(TXOBJECTS)
if [ $(HAVE_NATDYNLINK) -gt 0 ]; then \
$(OCAMLOPT) -shared -o findlib_top.cmxs $(TXOBJECTS); \
fi
findlib_dynload.cma: $(DYNLOAD_OBJECTS)
$(OCAMLC) -a -o findlib_dynload.cma $(DYNLOAD_OBJECTS)
......@@ -115,7 +122,7 @@ install: all
mkdir -p "$(prefix)$(OCAML_SITELIB)/$(NAME)"
mkdir -p "$(prefix)$(OCAMLFIND_BIN)"
test $(INSTALL_TOPFIND) -eq 0 || cp topfind "$(prefix)$(OCAML_CORE_STDLIB)"
files=`$(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib.cmxa findlib.a findlib.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload.a findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \
files=`$(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma findlib.cmxa findlib.a findlib.cmxs topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib_top.cmxa findlib_top.a findlib_top.cmxs findlib_dynload.cma findlib_dynload.cmxa findlib_dynload.a findlib_dynload.cmxs fl_dynload.mli fl_dynload.cmi META` && \
cp $$files "$(prefix)$(OCAML_SITELIB)/$(NAME)"
f="ocamlfind$(EXEC_SUFFIX)"; { test -f ocamlfind_opt$(EXEC_SUFFIX) && f="ocamlfind_opt$(EXEC_SUFFIX)"; }; \
cp $$f "$(prefix)$(OCAMLFIND_BIN)/ocamlfind$(EXEC_SUFFIX)"
......@@ -147,19 +154,19 @@ depend: *.ml *.mli fl_meta.ml fl_metascanner.ml
# .src
.mml.cmo:
$(OCAMLC) -g -vmthread -c -impl $<
$(OCAMLC) $(OPAQUE) -g -vmthread -c -impl $<
.mml.cmx:
$(OCAMLOPT) -thread -c -impl $<
$(OCAMLOPT) $(OPAQUE) -thread -c -impl $<
.ml.cmx:
$(OCAMLOPT) -c $<
$(OCAMLOPT) $(OPAQUE) -c $<
.ml.cmo:
$(OCAMLC) -g -c $<
$(OCAMLC) $(OPAQUE) -g -c $<
.mli.cmi:
$(OCAMLC) -c $<
$(OCAMLC) $(OPAQUE) -c $<
#.src.ml:
# $(CAMLP4O) -impl $< -o $@
......
......@@ -23,11 +23,16 @@ let exec_test s =
with
_ -> false
in
let is_native =
(* one of the few observable differences... *)
Gc.((get()).stack_limit) = 0 in
let suffix =
if is_native then "cmxs" else "cma" in
if not(exec_test "Topfind.reset;;") then (
Topdirs.dir_load Format.err_formatter "@SITELIB@/findlib/findlib.cma";
Topdirs.dir_load Format.err_formatter "@SITELIB@/findlib/findlib_top.cma";
);;
Topdirs.dir_load Format.err_formatter ("@SITELIB@/findlib/findlib." ^ suffix);
Topdirs.dir_load Format.err_formatter ("@SITELIB@/findlib/findlib_top." ^ suffix);
);
;;
#remove_directory "+compiler-libs";;
......@@ -40,6 +45,11 @@ if not(exec_test "Topfind.reset;;") then (
* initialized
*)
Topfind.add_predicates [ "byte"; "toploop" ];
let is_native =
(* one of the few observable differences... *)
Gc.((get()).stack_limit) = 0 in
let pred =
if is_native then "native" else "byte" in
Topfind.add_predicates [ pred; "toploop" ];
Topfind.don't_load ["findlib"];
Topfind.announce();;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment