Skip to content

Commit a9a4996

Browse files
flambda-backend: Add extension library stubs to otherlibs (ocaml-flambda#2403)
Add extension libraries to otherlibs for each extension universe (except for no_extensions). --------- Co-authored-by: Diana Kalinichenko <dkalinichenko@janestreet.com>
1 parent 24bf5b3 commit a9a4996

31 files changed

+419
-2
lines changed

Makefile.common-jst

+5
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,15 @@ install_for_test: _install
250250
ln -s . lex; ln -s . yacc; \
251251
ln -s _install/lib/ocaml/compiler-libs compilerlibs; \
252252
mkdir -p otherlibs/{unix,dynlink/native,str,bigarray,runtime_events}; \
253+
mkdir -p otherlibs/{upstream_compatible,stable,beta,alpha}; \
253254
ln -s ../stdlib/threads otherlibs/systhreads$(RUNTIME_SUFFIX); \
254255
$(cpl) stdlib/unix/{lib,}unix* otherlibs/unix; \
255256
$(cpl) stdlib/dynlink/dynlink* otherlibs/dynlink; \
256257
$(cpl) stdlib/str/{lib,}str* otherlibs/str; \
258+
$(cpl) stdlib/upstream_compatible/{lib,}upstream_compatible* otherlibs/upstream_compatible; \
259+
$(cpl) stdlib/stable/{lib,}stable* otherlibs/stable; \
260+
$(cpl) stdlib/beta/{lib,}beta* otherlibs/beta; \
261+
$(cpl) stdlib/alpha/{lib,}alpha* otherlibs/alpha; \
257262
if [[ x"$(RUNTIME_DIR)" = x"runtime" ]]; then \
258263
$(cpl) stdlib/runtime_events/{lib,}runtime_events* otherlibs/runtime_events; \
259264
fi; \

configure

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+6
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,12 @@ AS_CASE([$host],
672672
otherlibraries="dynlink"
673673
lib_dynlink=true
674674

675+
AC_CONFIG_FILES([otherlibs/upstream_compatible/META])
676+
AC_CONFIG_FILES([otherlibs/stable/META])
677+
AC_CONFIG_FILES([otherlibs/beta/META])
678+
AC_CONFIG_FILES([otherlibs/alpha/META])
679+
otherlibraries="$otherlibraries upstream_compatible stable beta alpha"
680+
675681
AS_IF(
676682
[test x"$enable_runtime5" = x"yes"],
677683
[otherlibraries="$otherlibraries runtime_events"

ocamltest/ocaml_modifiers.ml

+16
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ let dynlink =
9393
let str = make_library_modifier
9494
"str" [compiler_subdir ["otherlibs"; "str"]]
9595

96+
let upstream_compatible = make_library_modifier
97+
"upstream_compatible" [compiler_subdir ["otherlibs"; "upstream_compatible"]]
98+
99+
let stable = make_library_modifier
100+
"stable" [compiler_subdir ["otherlibs"; "stable"]]
101+
102+
let beta = make_library_modifier
103+
"beta" [compiler_subdir ["otherlibs"; "beta"]]
104+
105+
let alpha = make_library_modifier
106+
"alpha" [compiler_subdir ["otherlibs"; "alpha"]]
107+
96108
let systhreads =
97109
unix @
98110
(make_library_modifier
@@ -135,6 +147,10 @@ let _ =
135147
register_modifiers "unix" unix;
136148
register_modifiers "dynlink" dynlink;
137149
register_modifiers "str" str;
150+
register_modifiers "upstream_compatible" upstream_compatible;
151+
register_modifiers "stable" stable;
152+
register_modifiers "beta" beta;
153+
register_modifiers "alpha" alpha;
138154
List.iter
139155
(fun archive -> register_modifiers archive (compilerlibs_archive archive))
140156
[

otherlibs/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ include $(ROOTDIR)/Makefile.common
2121
# at the moment, the clean targets depend on this variable but
2222
# when they are invoked ../Makefile.config is not included, so that
2323
# OTHERLIBRARIES would be empty and the clean targets would thus not work.
24-
OTHERLIBRARIES ?= dynlink str systhreads$(RUNTIME_SUFFIX) unix runtime_events
24+
OTHERLIBRARIES ?= dynlink str systhreads$(RUNTIME_SUFFIX) unix runtime_events\
25+
upstream_compatible stable beta alpha
2526

2627
# $1: target name to dispatch to all otherlibs/*/Makefile
2728
define dispatch_

otherlibs/alpha/.depend

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
alpha.cmo : \
2+
alpha.cmi
3+
alpha.cmx : \
4+
alpha.cmi
5+
alpha.cmi :

otherlibs/alpha/META.in

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# @configure_input@
2+
3+
version = "@VERSION@"
4+
description = "Alpha extensions library"
5+
archive(byte) = "alpha.cma"
6+
archive(native) = "alpha.cmxa"
7+
plugin(byte) = "alpha.cma"
8+
plugin(native) = "alpha.cmxs"

otherlibs/alpha/Makefile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#**************************************************************************
2+
#* *
3+
#* OCaml *
4+
#* *
5+
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
6+
#* *
7+
#* Copyright 1999 Institut National de Recherche en Informatique et *
8+
#* en Automatique. *
9+
#* *
10+
#* All rights reserved. This file is distributed under the terms of *
11+
#* the GNU Lesser General Public License version 2.1, with the *
12+
#* special exception on linking described in the file LICENSE. *
13+
#* *
14+
#**************************************************************************
15+
16+
# Makefile for the alpha extensions library
17+
18+
LIBNAME=alpha
19+
CAMLOBJS=alpha.cmo
20+
21+
include ../Makefile.otherlibs.common
22+
23+
.PHONY: depend
24+
depend:
25+
$(OCAMLRUN) $(ROOTDIR)/boot/ocamlc -depend -slash *.mli *.ml > .depend
26+
27+
include .depend

otherlibs/alpha/alpha.ml

Whitespace-only changes.

otherlibs/alpha/alpha.mli

Whitespace-only changes.

otherlibs/alpha/dune

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
;**************************************************************************
2+
;* *
3+
;* OCaml *
4+
;* *
5+
;* Diana Kalinichenko, Jane Street, New York *
6+
;* *
7+
;* Copyright 2024 Jane Street Group LLC *
8+
;* *
9+
;* All rights reserved. This file is distributed under the terms of *
10+
;* the GNU Lesser General Public License version 2.1, with the *
11+
;* special exception on linking described in the file LICENSE. *
12+
;* *
13+
;**************************************************************************
14+
15+
(library
16+
(name alpha)
17+
(wrapped false)
18+
(modes byte native)
19+
(flags
20+
(-strict-sequence
21+
-principal
22+
-absname
23+
-w
24+
+a-4-9-40-41-42-44-45-48-66
25+
-warn-error
26+
A
27+
-bin-annot
28+
-safe-string
29+
-strict-formats))
30+
(ocamlopt_flags
31+
(:include %{project_root}/ocamlopt_flags.sexp))
32+
(library_flags
33+
(:standard -linkall)))
34+
35+
(install
36+
(files
37+
(alpha.cmxa as alpha/alpha.cmxa)
38+
(alpha.a as alpha/alpha.a)
39+
(alpha.cmxs as alpha/alpha.cmxs)
40+
(alpha.cma as alpha/alpha.cma)
41+
(alpha.mli as alpha/alpha.mli)
42+
(.alpha.objs/byte/alpha.cmi as alpha/alpha.cmi)
43+
(.alpha.objs/byte/alpha.cmt as alpha/alpha.cmt)
44+
(.alpha.objs/byte/alpha.cmti as alpha/alpha.cmti)
45+
(.alpha.objs/native/alpha.cmx as alpha/alpha.cmx))
46+
(section lib)
47+
(package ocaml))

otherlibs/beta/.depend

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
beta.cmo : \
2+
beta.cmi
3+
beta.cmx : \
4+
beta.cmi
5+
beta.cmi :

otherlibs/beta/META.in

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# @configure_input@
2+
3+
version = "@VERSION@"
4+
description = "Beta extensions library"
5+
archive(byte) = "beta.cma"
6+
archive(native) = "beta.cmxa"
7+
plugin(byte) = "beta.cma"
8+
plugin(native) = "beta.cmxs"

otherlibs/beta/Makefile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#**************************************************************************
2+
#* *
3+
#* OCaml *
4+
#* *
5+
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
6+
#* *
7+
#* Copyright 1999 Institut National de Recherche en Informatique et *
8+
#* en Automatique. *
9+
#* *
10+
#* All rights reserved. This file is distributed under the terms of *
11+
#* the GNU Lesser General Public License version 2.1, with the *
12+
#* special exception on linking described in the file LICENSE. *
13+
#* *
14+
#**************************************************************************
15+
16+
# Makefile for the beta extensions library
17+
18+
LIBNAME=beta
19+
CAMLOBJS=beta.cmo
20+
21+
include ../Makefile.otherlibs.common
22+
23+
.PHONY: depend
24+
depend:
25+
$(OCAMLRUN) $(ROOTDIR)/boot/ocamlc -depend -slash *.mli *.ml > .depend
26+
27+
include .depend

otherlibs/beta/beta.ml

Whitespace-only changes.

otherlibs/beta/beta.mli

Whitespace-only changes.

otherlibs/beta/dune

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
;**************************************************************************
2+
;* *
3+
;* OCaml *
4+
;* *
5+
;* Diana Kalinichenko, Jane Street, New York *
6+
;* *
7+
;* Copyright 2024 Jane Street Group LLC *
8+
;* *
9+
;* All rights reserved. This file is distributed under the terms of *
10+
;* the GNU Lesser General Public License version 2.1, with the *
11+
;* special exception on linking described in the file LICENSE. *
12+
;* *
13+
;**************************************************************************
14+
15+
(library
16+
(name beta)
17+
(wrapped false)
18+
(modes byte native)
19+
(flags
20+
(-strict-sequence
21+
-principal
22+
-absname
23+
-w
24+
+a-4-9-40-41-42-44-45-48-66
25+
-warn-error
26+
A
27+
-bin-annot
28+
-safe-string
29+
-strict-formats))
30+
(ocamlopt_flags
31+
(:include %{project_root}/ocamlopt_flags.sexp))
32+
(library_flags
33+
(:standard -linkall)))
34+
35+
(install
36+
(files
37+
(beta.cmxa as beta/beta.cmxa)
38+
(beta.a as beta/beta.a)
39+
(beta.cmxs as beta/beta.cmxs)
40+
(beta.cma as beta/beta.cma)
41+
(beta.mli as beta/beta.mli)
42+
(.beta.objs/byte/beta.cmi as beta/beta.cmi)
43+
(.beta.objs/byte/beta.cmt as beta/beta.cmt)
44+
(.beta.objs/byte/beta.cmti as beta/beta.cmti)
45+
(.beta.objs/native/beta.cmx as beta/beta.cmx))
46+
(section lib)
47+
(package ocaml))

otherlibs/stable/.depend

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
stable.cmo : \
2+
stable.cmi
3+
stable.cmx : \
4+
stable.cmi
5+
stable.cmi :

otherlibs/stable/META.in

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# @configure_input@
2+
3+
version = "@VERSION@"
4+
description = "Stable extensions library"
5+
archive(byte) = "stable.cma"
6+
archive(native) = "stable.cmxa"
7+
plugin(byte) = "stable.cma"
8+
plugin(native) = "stable.cmxs"

otherlibs/stable/Makefile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#**************************************************************************
2+
#* *
3+
#* OCaml *
4+
#* *
5+
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
6+
#* *
7+
#* Copyright 1999 Institut National de Recherche en Informatique et *
8+
#* en Automatique. *
9+
#* *
10+
#* All rights reserved. This file is distributed under the terms of *
11+
#* the GNU Lesser General Public License version 2.1, with the *
12+
#* special exception on linking described in the file LICENSE. *
13+
#* *
14+
#**************************************************************************
15+
16+
# Makefile for the stable extensions library
17+
18+
LIBNAME=stable
19+
CAMLOBJS=stable.cmo
20+
21+
include ../Makefile.otherlibs.common
22+
23+
.PHONY: depend
24+
depend:
25+
$(OCAMLRUN) $(ROOTDIR)/boot/ocamlc -depend -slash *.mli *.ml > .depend
26+
27+
include .depend

otherlibs/stable/dune

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
;**************************************************************************
2+
;* *
3+
;* OCaml *
4+
;* *
5+
;* Diana Kalinichenko, Jane Street, New York *
6+
;* *
7+
;* Copyright 2024 Jane Street Group LLC *
8+
;* *
9+
;* All rights reserved. This file is distributed under the terms of *
10+
;* the GNU Lesser General Public License version 2.1, with the *
11+
;* special exception on linking described in the file LICENSE. *
12+
;* *
13+
;**************************************************************************
14+
15+
(library
16+
(name stable)
17+
(wrapped false)
18+
(modes byte native)
19+
(flags
20+
(-strict-sequence
21+
-principal
22+
-absname
23+
-w
24+
+a-4-9-40-41-42-44-45-48-66
25+
-warn-error
26+
A
27+
-bin-annot
28+
-safe-string
29+
-strict-formats))
30+
(ocamlopt_flags
31+
(:include %{project_root}/ocamlopt_flags.sexp))
32+
(library_flags
33+
(:standard -linkall)))
34+
35+
(install
36+
(files
37+
(stable.cmxa as stable/stable.cmxa)
38+
(stable.a as stable/stable.a)
39+
(stable.cmxs as stable/stable.cmxs)
40+
(stable.cma as stable/stable.cma)
41+
(stable.mli as stable/stable.mli)
42+
(.stable.objs/byte/stable.cmi as stable/stable.cmi)
43+
(.stable.objs/byte/stable.cmt as stable/stable.cmt)
44+
(.stable.objs/byte/stable.cmti as stable/stable.cmti)
45+
(.stable.objs/native/stable.cmx as stable/stable.cmx))
46+
(section lib)
47+
(package ocaml))

otherlibs/stable/stable.ml

Whitespace-only changes.

otherlibs/stable/stable.mli

Whitespace-only changes.

otherlibs/upstream_compatible/.depend

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
upstream_compatible.cmo : \
2+
upstream_compatible.cmi
3+
upstream_compatible.cmx : \
4+
upstream_compatible.cmi
5+
upstream_compatible.cmi :

otherlibs/upstream_compatible/META.in

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# @configure_input@
2+
3+
version = "@VERSION@"
4+
description = "Upstream-compatible extensions library"
5+
archive(byte) = "upstream_compatible.cma"
6+
archive(native) = "upstream_compatible.cmxa"
7+
plugin(byte) = "upstream_compatible.cma"
8+
plugin(native) = "upstream_compatible.cmxs"

0 commit comments

Comments
 (0)