summaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorThomas Refis <refis.thomas@gmail.com>2018-10-10 16:16:00 +0100
committerGitHub <noreply@github.com>2018-10-10 16:16:00 +0100
commitd68e0e207765350eb42fed37444d643669f98cee (patch)
tree5b5b289543b450cdbadacc15518876c60f87f86e /stdlib
parent8e801959e84e73219190dedad0b5b62b1f4f50a3 (diff)
downloadocaml-d68e0e207765350eb42fed37444d643669f98cee.tar.gz
Provide a way to build the bytecode compiler using Dune (#2093)
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/dune91
-rw-r--r--stdlib/expand_module_aliases.awk6
2 files changed, 95 insertions, 2 deletions
diff --git a/stdlib/dune b/stdlib/dune
new file mode 100644
index 0000000000..eff4b70975
--- /dev/null
+++ b/stdlib/dune
@@ -0,0 +1,91 @@
+;**************************************************************************
+;* *
+;* OCaml *
+;* *
+;* Thomas Refis, Jane Street Europe *
+;* *
+;* Copyright 2018 Jane Street Group LLC *
+;* *
+;* All rights reserved. This file is distributed under the terms of *
+;* the GNU Lesser General Public License version 2.1, with the *
+;* special exception on linking described in the file LICENSE. *
+;* *
+;**************************************************************************
+
+(library
+ (name stdlib)
+ (stdlib
+ (exit_module std_exit)
+ (internal_modules Camlinternal*)
+ (modules_before_stdlib
+ camlinternalFormatBasics))
+ (flags (:standard -w -9))
+ ;; We're listing the modules here to avoid building the Labels ones.
+ (modules
+ spacetime
+ arg
+ array
+ bigarray
+ buffer
+ bytes
+ callback
+ camlinternalFormat
+ camlinternalFormatBasics
+ camlinternalLazy
+ camlinternalMod
+ camlinternalOO
+ char
+ complex
+ digest
+ ephemeron
+ filename
+ float
+ format
+ gc
+ genlex
+ hashtbl
+ int32
+ int64
+ lazy
+ lexing
+ list
+ map
+ marshal
+ nativeint
+ obj
+ oo
+ option
+ parsing
+ pervasives
+ printexc
+ printf
+ queue
+ random
+ result
+ scanf
+ seq
+ set
+ stack
+ stdlib
+ stream
+ string
+ sys
+ uchar
+ weak
+ ;; booh
+ std_exit
+ )
+ (preprocess
+ (per_module
+ ((action
+ (run awk -v dune_wrapped=true
+ -f %{dep:expand_module_aliases.awk} %{input-file}))
+ stdlib))))
+
+(rule
+ (targets sys.ml)
+ (deps (:version ../VERSION) (:p sys.mlp))
+ (action
+ (with-stdout-to %{targets}
+ (bash
+ "sed -e \"s|%%VERSION%%|`sed -e 1q %{version} | tr -d '\r'`|\" %{p}"))))
diff --git a/stdlib/expand_module_aliases.awk b/stdlib/expand_module_aliases.awk
index 98d34d30ec..7f1e49ba85 100644
--- a/stdlib/expand_module_aliases.awk
+++ b/stdlib/expand_module_aliases.awk
@@ -23,8 +23,10 @@ NR == 1 { printf ("# 1 \"%s\"\n", FILENAME) }
state=2;
else if ($1 == "module")
{ if (ocamldoc!="true") printf("\n(** @canonical %s *)", $2);
- printf("\nmodule %s = Stdlib__%s%s\n", $2,
- tolower(substr($4,1,1)), substr($4,2));
+ first_letter=substr($4,1,1);
+ if (dune_wrapped!="true")
+ first_letter=tolower(first_letter);
+ printf("\nmodule %s = Stdlib__%s%s\n", $2, first_letter, substr($4,2));
}
else
print