Skip to content

Commit 92c4164

Browse files
committed
Merge pull request ocaml#425 from chambart/flambda_prereq-configure-option
Configure option to enable the flambda middle-end
2 parents 1d8d9b5 + 828cb4e commit 92c4164

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ utils/config.ml: utils/config.mlp config/Makefile
414414
-e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \
415415
-e 's|%%HOST%%|$(HOST)|' \
416416
-e 's|%%TARGET%%|$(TARGET)|' \
417+
-e 's|%%FLAMBDA%%|$(FLAMBDA)|' \
417418
utils/config.mlp > utils/config.ml
418419

419420
partialclean::

Makefile.nt

+1
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ utils/config.ml: utils/config.mlp config/Makefile
313313
-e 's|%%CC_PROFILE%%||' \
314314
-e 's|%%HOST%%|$(HOST)|' \
315315
-e 's|%%TARGET%%|$(TARGET)|' \
316+
-e 's|%%FLAMBDA%%|$(FLAMBDA)|' \
316317
utils/config.mlp > utils/config.ml
317318

318319
partialclean::

configure

+9
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ no_naked_pointers=false
5151
native_compiler=true
5252
TOOLPREF=""
5353
with_cfi=true
54+
flambda=false
5455

5556
# Try to turn internationalization off, can cause config.guess to malfunction!
5657
unset LANG
@@ -162,6 +163,8 @@ while : ; do
162163
with_cfi=false;;
163164
-no-native-compiler)
164165
native_compiler=false;;
166+
-flambda)
167+
flambda=true;;
165168
*) if echo "$1" | grep -q -e '^--\?[a-zA-Z0-9-]\+='; then
166169
err "configure expects arguments of the form '-prefix /foo/bar'," \
167170
"not '-prefix=/foo/bar' (note the '=')."
@@ -1788,6 +1791,7 @@ echo "HOST=$host" >> Makefile
17881791
if [ "$ostype" = Cygwin ]; then
17891792
echo "DIFF=diff -q --strip-trailing-cr" >>Makefile
17901793
fi
1794+
echo "FLAMBDA=$flambda" >> Makefile
17911795

17921796

17931797
rm -f tst hasgot.c
@@ -1856,6 +1860,11 @@ else
18561860
else
18571861
inf " profiling with gprof ..... not supported"
18581862
fi
1863+
if test "$flambda" = "true"; then
1864+
inf " using flambda middle-end . yes"
1865+
else
1866+
inf " using flambda middle-end . no"
1867+
fi
18591868
fi
18601869

18611870
if test "$with_debugger" = "ocamldebugger"; then

utils/config.mli

+3
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,6 @@ val target : string
127127
(* Whether the compiler is a cross-compiler *)
128128

129129
val print_config : out_channel -> unit;;
130+
131+
val flambda : bool
132+
(* Whether the compiler was configured for flambda *)

utils/config.mlp

+13-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,22 @@ let mkdll = "%%MKDLL%%"
4848
let mkexe = "%%MKEXE%%"
4949
let mkmaindll = "%%MKMAINDLL%%"
5050

51+
let flambda = %%FLAMBDA%%
52+
5153
let exec_magic_number = "Caml1999X011"
5254
and cmi_magic_number = "Caml1999I020"
5355
and cmo_magic_number = "Caml1999O011"
5456
and cma_magic_number = "Caml1999A012"
55-
and cmx_magic_number = "Caml1999Y015"
56-
and cmxa_magic_number = "Caml1999Z014"
57+
and cmx_magic_number =
58+
if flambda then
59+
"Caml1999Y016"
60+
else
61+
"Caml1999Y015"
62+
and cmxa_magic_number =
63+
if flambda then
64+
"Caml1999Z015"
65+
else
66+
"Caml1999Z014"
5767
and ast_impl_magic_number = "Caml1999M019"
5868
and ast_intf_magic_number = "Caml1999N018"
5969
and cmxs_magic_number = "Caml2007D002"
@@ -126,6 +136,7 @@ let print_config oc =
126136
p_bool "systhread_supported" systhread_supported;
127137
p "host" host;
128138
p "target" target;
139+
p_bool "flambda" flambda;
129140

130141
(* print the magic number *)
131142
p "exec_magic_number" exec_magic_number;

0 commit comments

Comments
 (0)