Skip to content
Commits on Source (5)
This diff is collapsed.
parsing/parser.cmo : parsing/syntaxerr.cmi parsing/parsetree.cmi \
parsing/longident.cmi parsing/location.cmi parsing/docstrings.cmi \
utils/clflags.cmi parsing/asttypes.cmi parsing/ast_helper.cmi \
parsing/parser.cmi
parsing/parser.cmx : parsing/syntaxerr.cmx parsing/parsetree.cmi \
parsing/longident.cmx parsing/location.cmx parsing/docstrings.cmx \
utils/clflags.cmx parsing/asttypes.cmi parsing/ast_helper.cmx \
parsing/parser.cmi
parsing/parser.cmi : parsing/parsetree.cmi parsing/location.cmi \
parsing/docstrings.cmi
parsing/parser.ml parsing/parser.mli: parsing/ast_helper.cmi parsing/asttypes.cmi utils/clflags.cmi parsing/docstrings.cmi parsing/location.cmi parsing/longident.cmi parsing/parsetree.cmi parsing/syntaxerr.cmi
......@@ -16,6 +16,9 @@
# Default behaviour, for if core.autocrlf isn't set
* text=auto
# It is not possible to wrap lines lines in .gitattributes files
.gitattributes typo.long-line=may
# Binary files
/boot/ocamlc binary
/boot/ocamllex binary
......@@ -27,70 +30,123 @@
# 'union' merge driver just unions textual content in case of conflict
# http://krlmlr.github.io/using-gitattributes-to-avoid-merge-conflicts/
/.mailmap merge=union
/Changes merge=union
# We tried using 'union' for Changes and it did not work:
# instead of creating Changes conflict it would silently duplicate
# the lines involved in the conflict, which is arguably worse
#/Changes merge=union
# No header for text files (would be too obtrusive).
*.md ocaml-typo=missing-header
README* ocaml-typo=missing-header
*.adoc ocaml-typo=missing-header,long-line,unused-prop
*.md typo.missing-header
README* typo.missing-header
*.adoc typo.missing-header
stdlib/*.mld typo.missing-header
*.adoc typo.long-line=may
/.mailmap typo.long-line typo.missing-header typo.non-ascii
/.merlin typo.missing-header
/Changes typo.utf8 typo.missing-header
/News typo.utf8 typo.missing-header
/INSTALL typo.missing-header
/LICENSE typo.very-long-line typo.missing-header
# tools/ci/appveyor/appveyor_build.cmd only has missing-header because
# dra27 too lazy to update check-typo to interpret Cmd-style comments!
/tools/ci/appveyor/appveyor_build.cmd typo.very-long-line typo.missing-header typo.non-ascii
/tools/ci/appveyor/appveyor_build.sh typo.non-ascii
/tools/ci/inria/remove-sinh-primitive.patch typo.white-at-eol typo.missing-header typo.long-line
/tools/release-checklist typo.missing-header
# ignore auto-generated .depend files
.depend typo.prune
/.depend.menhir typo.prune
# Makefiles may contain tabs
Makefile* typo.tab=may
/.mailmap ocaml-typo=long-line,missing-header,non-ascii
/.merlin ocaml-typo=missing-header
/Changes ocaml-typo=non-ascii,missing-header
/INSTALL ocaml-typo=missing-header
/LICENSE ocaml-typo=long-line,very-long-line,missing-header
/appveyor.yml ocaml-typo=long-line,very-long-line
asmcomp/*/emit.mlp typo.tab=may typo.long-line=may
# The build-aux directory contains bundled files so do not check it
build-aux typo.prune
asmcomp/*/emit.mlp ocaml-typo=tab,long-line,unused-prop
asmcomp/power/NOTES.md ocaml-typo=missing-header,long-line
/config/gnu typo.prune
/config/gnu/** typo.prune
asmrun/i386.S ocaml-typo=long-line
/manual typo.prune
/manual/** typo.prune
config/gnu ocaml-typo=prune
# configure is generated so do not check it
configure typo.prune
emacs/*.el ocaml-typo=long-line,unused-prop
emacs/COPYING ocaml-typo=tab,non-printing,missing-header
emacs/ocamltags.in ocaml-typo=non-printing
ocaml-variants.opam typo.prune
experimental ocaml-typo=prune
emacs/*.el typo.long-line=may
emacs/caml.el typo.long-line=may typo.missing-header
emacs/COPYING typo.prune
emacs/ocamltags.in typo.non-printing
manual ocaml-typo=prune
ocamldoc/** typo.long-line=may
ocamldoc/Changes.txt typo.missing-header
ocamldoc/ocamldoc.sty typo.missing-header
ocamldoc/odoc_index.html typo.missing-header
ocamlbuild/* ocaml-typo=long-line
ocamlbuild/AUTHORS ocaml-typo=missing-header
ocamlbuild/ChangeLog ocaml-typo=tab,missing-header
ocamlbuild/TODO ocaml-typo=missing-header
otherlibs/win32unix/readlink.c typo.long-line
otherlibs/win32unix/stat.c typo.long-line
otherlibs/win32unix/symlink.c typo.long-line
ocamldoc/Changes.txt ocaml-typo=missing-header
ocamldoc/ocamldoc.sty ocaml-typo=missing-header
runtime/i386.S typo.long-line
otherlibs/win32unix/readlink.c ocaml-typo=long-line
otherlibs/win32unix/stat.c ocaml-typo=long-line
otherlibs/win32unix/symlink.c ocaml-typo=long-line
stdlib/hashbang typo.white-at-eol typo.missing-lf
stdlib/hashbang ocaml-typo=white-at-eol,missing-lf
testsuite/tests/** typo.missing-header typo.long-line=may
testsuite/tests/lib-bigarray-2/bigarrf.f typo.tab
testsuite/tests/lib-unix/win-stat/fakeclock.c typo.missing-header=false
testsuite/tests/misc-unsafe/almabench.ml typo.long-line
testsuite/tests/tool-toplevel/strings.ml typo.utf8
testsuite/tests/win-unicode/*.ml typo.utf8
testsuite/tools/*.S typo.missing-header
testsuite/tools/*.asm typo.missing-header
testsuite/typing typo.missing-header
testsuite/tests/** ocaml-typo=missing-header
testsuite/tests/lib-bigarray-2/bigarrf.f ocaml-typo=missing-header,tab
testsuite/tests/misc-unsafe/almabench.ml ocaml-typo=missing-header,long-line
testsuite/typing ocaml-typo=missing-header
# prune testsuite reference files
testsuite/tests/**/*.reference typo.prune
tools/magic ocaml-typo=missing-header
# Expect tests with overly long lines of expected output
testsuite/tests/parsing/docstrings.ml typo.very-long-line
yacc/*.[ch] ocaml-typo=long-line,very-long-line,unused-prop
tools/magic typo.missing-header
# TODO we should fix the long-line errors in yacc/*.c
/yacc/*.[ch] typo.very-long-line=may
menhir-bench.bash typo.missing-header typo.utf8
# bootstrap files produced by Menhir
/boot/menhir/** typo.long-line=may typo.very-long-line=may
/boot/menhir/** typo.missing-header=may
/boot/menhir/** typo.white-at-eol=may
/boot/menhir/** typo.utf8=may
# Line-ending specifications, for Windows interoperability
*.sh text eol=lf
*.sh.in text eol=lf
*.awk text eol=lf
*.m4 text eol=lf
# Test suite command fragments
*.checker text eol=lf
*.precheck text eol=lf
*.runner text eol=lf
# ocamltest hooks which are used in the testsuite
*.check-program-output text eol=lf
*.run text eol=lf
/tools/ci/appveyor/appveyor_build.cmd text eol=crlf
configure text eol=lf
configure.ac text eol=lf
autogen text eol=lf
build-aux/compile text eol=lf
build-aux/config.guess text eol=lf
build-aux/config.sub text eol=lf
build-aux/install text eol=lf
build-aux/missing text eol=lf
config/auto-aux/hasgot text eol=lf
config/auto-aux/hasgot2 text eol=lf
config/auto-aux/runtest text eol=lf
......@@ -101,11 +157,12 @@ config/auto-aux/trycompile text eol=lf
config/gnu/config.guess text eol=lf
config/gnu/config.sub text eol=lf
ocamldoc/remove_DEBUG text eol=lf
ocamltest/getocamloptdefaultflags text eol=lf
stdlib/Compflags text eol=lf
stdlib/sharpbang text eol=lf
tools/ci/inria/remove-sinh-primitive.patch text eol=lf
tools/check-typo text eol=lf
tools/ci-build text eol=lf
tools/cleanup-header text eol=lf
tools/msvs-promote-path text eol=lf
tools/gdb-macros text eol=lf
tools/magic text eol=lf
......@@ -114,6 +171,10 @@ tools/make-package-macosx text eol=lf
tools/ocaml-objcopy-macosx text eol=lf
tools/ocamlmktop.tpl text eol=lf
tools/ocamlsize text eol=lf
tools/pre-commit-githook text eol=lf
tools/markdown-add-pr-links.sh text eol=lf
runtime/caml/m.h.in text eol=lf
runtime/caml/s.h.in text eol=lf
# These two are cat scripts, so may not actually require this
config/auto-aux/sharpbang text eol=lf
......@@ -127,20 +188,46 @@ manual/tools/htmltbl text eol=lf
manual/tools/htmlthread text eol=lf
manual/tools/texexpand text eol=lf
# Checking out the parsetree test files with \r\n endings causes all the
# locations to change, so use \n endings only, even on Windows
# Tests which include references spanning multiple lines fail with \r\n
# endings, so use \n endings only, even on Windows.
testsuite/tests/basic-more/morematch.ml text eol=lf
testsuite/tests/basic-more/robustmatch.ml text eol=lf
testsuite/tests/parsing/*.ml text eol=lf
# Similarly, the docstring tests fail for the same reason on Windows
testsuite/tests/docstrings/empty.ml text eol=lf
# And w04.ml
testsuite/tests/functors/functors.ml text eol=lf
testsuite/tests/tool-ocamlc-stop-after/stop_after_parsing_impl.ml text eol=lf
testsuite/tests/tool-ocamlc-stop-after/stop_after_parsing_intf.mli text eol=lf
testsuite/tests/tool-ocamlc-stop-after/stop_after_typing_impl.ml text eol=lf
testsuite/tests/tool-toplevel/error_highlighting.ml text eol=lf
testsuite/tests/tool-toplevel/error_highlighting_use4.ml text eol=lf
testsuite/tests/translprim/module_coercion.ml text eol=lf
testsuite/tests/typing-objects-bugs/pr3968_bad.ml text eol=lf
testsuite/tests/typing-ocamlc-i/pr7402.ml text eol=lf
testsuite/tests/typing-ocamlc-i/pervasives_leitmotiv.ml text eol=lf
testsuite/tests/typing-recmod/t12bad.ml text eol=lf
testsuite/tests/typing-safe-linking/b_bad.ml text eol=lf
testsuite/tests/warnings/w04.ml text eol=lf
testsuite/tests/warnings/w04_failure.ml text eol=lf
testsuite/tests/warnings/w32.ml text eol=lf
# These are forced to \n to allow the Cygwin testsuite to pass on a
# Windows-checkout
testsuite/tests/formatting/margins.ml text eol=lf
testsuite/tests/letrec-check/pr7706.ml text eol=lf
testsuite/tests/letrec-disallowed/disallowed.ml text eol=lf
testsuite/tests/letrec-disallowed/extension_constructor.ml text eol=lf
testsuite/tests/letrec-disallowed/float_block_allowed.ml text eol=lf
testsuite/tests/letrec-disallowed/float_block_disallowed.ml text eol=lf
testsuite/tests/letrec-disallowed/generic_arrays.ml text eol=lf
testsuite/tests/letrec-disallowed/lazy_.ml text eol=lf
testsuite/tests/letrec-disallowed/module_constraints.ml text eol=lf
testsuite/tests/letrec-disallowed/unboxed.ml text eol=lf
testsuite/tests/letrec-disallowed/pr7215.ml text eol=lf
testsuite/tests/letrec-disallowed/pr7231.ml text eol=lf
testsuite/tests/letrec-disallowed/pr7706.ml text eol=lf
testsuite/tests/lexing/uchar_esc.ml text eol=lf
testsuite/tests/match-exception-warnings/exhaustiveness_warnings.ml text eol=lf
testsuite/tests/tool-toplevel/pr7060.ml text eol=lf
testsuite/tests/typing-extension-constructor/test.ml text eol=lf
testsuite/tests/typing-extensions/extensions.ml text eol=lf
testsuite/tests/typing-extensions/open_types.ml text eol=lf
......@@ -157,13 +244,18 @@ testsuite/tests/typing-sigsubst/sigsubst.ml text eol=lf
testsuite/tests/typing-typeparam/newtype.ml text eol=lf
testsuite/tests/typing-unboxed/test.ml text eol=lf
testsuite/tests/typing-unboxed-types/test.ml text eol=lf
testsuite/tests/typing-unboxed-types/test_flat.ml text eol=lf
testsuite/tests/typing-unboxed-types/test_no_flat.ml text eol=lf
testsuite/tests/typing-warnings/ambiguous_guarded_disjunction.ml text eol=lf
testsuite/tests/typing-warnings/application.ml text eol=lf
testsuite/tests/typing-warnings/coercions.ml text eol=lf
testsuite/tests/typing-warnings/exhaustiveness.ml text eol=lf
testsuite/tests/typing-warnings/pr6587.ml text eol=lf
testsuite/tests/typing-warnings/pr6872.ml text eol=lf
testsuite/tests/typing-warnings/pr7085.ml text eol=lf
testsuite/tests/typing-warnings/pr7115.ml text eol=lf
testsuite/tests/typing-warnings/pr7261.ml text eol=lf
testsuite/tests/typing-warnings/pr7297.ml text eol=lf
testsuite/tests/typing-warnings/pr7553.ml text eol=lf
testsuite/tests/typing-warnings/records.ml text eol=lf
testsuite/tests/typing-warnings/unused_types.ml text eol=lf
......@@ -21,28 +21,38 @@
*.obj
*.lib
*.dll
*.la
*.cm[ioxat]
*.cmx[as]
*.cmti
*.annot
*.exe
*.exe.manifest
.depend
.depend.nt
.DS_Store
*.out
*.out.dSYM
*.swp
_ocamltest
_ocamltestd
*.odoc
.merlin
_build
# local to root directory
/Makefile.common
/Makefile.config
/autom4te.cache
/ocamlc
/config.cache
/config.log
/config.status
/libtool
/ocamlc.opt
/expunge
/ocaml
/ocamlopt
/ocamlopt.opt
/package-macosx
/ocamlnat
# specific files and patterns in sub-directories
......@@ -55,76 +65,12 @@
/asmcomp/scheduling.ml
/asmcomp/CSE.ml
/asmrun/*.p.c
/asmrun/*.d.c
/asmrun/alloc.c
/asmrun/afl.c
/asmrun/array.c
/asmrun/backtrace.c
/asmrun/callback.c
/asmrun/compact.c
/asmrun/compare.c
/asmrun/custom.c
/asmrun/debugger.c
/asmrun/dynlink.c
/asmrun/extern.c
/asmrun/finalise.c
/asmrun/floats.c
/asmrun/freelist.c
/asmrun/gc_ctrl.c
/asmrun/globroots.c
/asmrun/hash.c
/asmrun/intern.c
/asmrun/ints.c
/asmrun/io.c
/asmrun/lexing.c
/asmrun/main.c
/asmrun/major_gc.c
/asmrun/md5.c
/asmrun/memory.c
/asmrun/meta.c
/asmrun/minor_gc.c
/asmrun/misc.c
/asmrun/obj.c
/asmrun/parsing.c
/asmrun/printexc.c
/asmrun/signals.c
/asmrun/startup_aux.c
/asmrun/str.c
/asmrun/sys.c
/asmrun/terminfo.c
/asmrun/unix.c
/asmrun/weak.c
/asmrun/win32.c
/boot/Saved
/boot/ocamlrun
/boot/ocamlyacc
/boot/camlheader
/bytecomp/runtimedef.ml
/bytecomp/opcodes.ml
/byterun/caml/jumptbl.h
/byterun/primitives
/byterun/prims.c
/byterun/caml/opnames.h
/byterun/caml/version.h
/byterun/ocamlrun
/byterun/ocamlrund
/byterun/ocamlruni
/byterun/ld.conf
/byterun/interp.a.lst
/byterun/*.[sd]obj
/byterun/.gdb_history
/byterun/*.d.c
/byterun/*.pic.c
/config/m.h
/config/s.h
/config/Makefile
/config/auto-aux/hashbang4
/debugger/lexer.ml
/debugger/parser.ml
/debugger/parser.mli
......@@ -132,13 +78,16 @@
/driver/compdynlink.mlopt
/driver/compdynlink.mlbyte
/driver/compdynlink.mli
/driver/compdynlink_common.ml
/driver/compdynlink_common.mli
/driver/compdynlink_platform_intf.ml
/driver/compdynlink_platform_intf.mli
/driver/compdynlink_types.ml
/driver/compdynlink_types.mli
/emacs/ocamltags
/emacs/*.elc
/experimental/garrigue/*.out
/experimental/garrigue/*.out2
/lex/parser.ml
/lex/parser.mli
/lex/lexer.ml
......@@ -149,14 +98,9 @@
/manual/manual/cmds/warnings-help.etex
/manual/manual/warnings-help.etex
/ocamlbuild/ocamlbuild_config.ml
/ocamlbuild/lexers.ml
/ocamlbuild/glob_lexer.ml
/ocamlbuild/ocamlbuild.native
/ocamlbuild/ocamlbuild.byte
/ocamldoc/ocamldoc
/ocamldoc/ocamldoc.opt
/ocamldoc/odoc
/ocamldoc/odoc_crc.ml
/ocamldoc/odoc_lexer.ml
/ocamldoc/odoc_ocamlhtml.ml
......@@ -168,15 +112,24 @@
/ocamldoc/odoc_text_parser.mli
/ocamldoc/stdlib_man
/ocamldoc/stdlib_html
/ocamldoc/stdlib_latex
/ocamldoc/stdlib_texi
/ocamldoc/*.output
/ocamldoc/test_stdlib
/ocamldoc/test_latex
/ocamldoc/test
/ocamltest/ocamltest
/ocamltest/ocamltest.opt
/ocamltest/ocamltest_config.ml
/ocamltest/tsl_lexer.ml
/ocamltest/tsl_parser.ml
/ocamltest/tsl_parser.mli
/otherlibs/dynlink/extract_crc
/otherlibs/systhreads/thread.ml
/otherlibs/dynlink/dynlink_platform_intf.mli
/otherlibs/threads/marshal.mli
/otherlibs/threads/pervasives.mli
/otherlibs/threads/stdlib.mli
/otherlibs/threads/unix.mli
/otherlibs/win32graph/graphics.ml
/otherlibs/win32graph/graphics.mli
......@@ -188,7 +141,6 @@
/otherlibs/win32unix/chmod.c
/otherlibs/win32unix/cst2constr.c
/otherlibs/win32unix/cstringv.c
/otherlibs/win32unix/envir.c
/otherlibs/win32unix/execv.c
/otherlibs/win32unix/execve.c
/otherlibs/win32unix/execvp.c
......@@ -201,13 +153,14 @@
/otherlibs/win32unix/getproto.c
/otherlibs/win32unix/getserv.c
/otherlibs/win32unix/gmtime.c
/otherlibs/win32unix/mmap_ba.c
/otherlibs/win32unix/putenv.c
/otherlibs/win32unix/rmdir.c
/otherlibs/win32unix/socketaddr.c
/otherlibs/win32unix/strofaddr.c
/otherlibs/win32unix/time.c
/otherlibs/win32unix/unlink.c
/otherlibs/win32unix/utimes.c
/otherlibs/win32unix/fsync.c
/parsing/parser.ml
/parsing/parser.mli
......@@ -218,6 +171,25 @@
/parsing/parser.output
/parsing/parser.automaton
/parsing/parser.conflicts
/parsing/camlinternalMenhirLib.ml
/parsing/camlinternalMenhirLib.mli
/runtime/caml/jumptbl.h
/runtime/caml/m.h
/runtime/caml/s.h
/runtime/primitives
/runtime/prims.c
/runtime/caml/opnames.h
/runtime/caml/version.h
/runtime/ocamlrun
/runtime/ocamlrund
/runtime/ocamlruni
/runtime/ld.conf
/runtime/interp.a.lst
/runtime/*.[sd]obj
/runtime/.gdb_history
/runtime/*.d.c
/runtime/*.pic.c
/stdlib/camlheader
/stdlib/target_camlheader
......@@ -234,94 +206,17 @@
/testsuite/**/*.byte
/testsuite/**/*.native
/testsuite/**/program
/testsuite/**/_log
/testsuite/**/_log*
/testsuite/failure.stamp
/testsuite/_retries
/testsuite/tests/asmcomp/codegen
/testsuite/tests/asmcomp/parsecmm.ml
/testsuite/tests/asmcomp/parsecmm.mli
/testsuite/tests/asmcomp/lexcmm.ml
/testsuite/tests/asmcomp/*.s
/testsuite/tests/asmcomp/*.out.manifest
/testsuite/tests/basic/*.safe-string
/testsuite/tests/basic/pr6322.ml
/testsuite/tests/embedded/caml
/testsuite/tests/float-unboxing/*.flambda
/testsuite/tests/float-unboxing/float_inline.ml
/testsuite/tests/lib-dynlink-bytecode/main
/testsuite/tests/lib-dynlink-bytecode/static
/testsuite/tests/lib-dynlink-bytecode/custom
/testsuite/tests/lib-dynlink-bytecode/marshal.data
/testsuite/tests/lib-dynlink-bytecode/caml
/testsuite/tests/lib-dynlink-native/mypack.pack.s
/testsuite/tests/lib-dynlink-native/mypack.pack.asm
/testsuite/tests/lib-dynlink-native/result
/testsuite/tests/lib-dynlink-native/main
/testsuite/tests/lib-dynlink-native/marshal.data
/testsuite/tests/lib-dynlink-native/caml
/testsuite/tests/lib-scanf/tscanf_data
/testsuite/tests/lib-threads/*.byt
/testsuite/tests/opaque/*/*.mli
/testsuite/tests/runtime-errors/*.bytecode
/testsuite/tests/self-contained-toplevel/cached_cmi.ml
/testsuite/tests/tool-debugger/**/compiler-libs
/testsuite/tests/tool-debugger/find-artifacts/out
/testsuite/tests/tool-debugger/no_debug_event/out
/testsuite/tests/tool-debugger/no_debug_event/c
/testsuite/tests/tool-ocamldep-modalias/*.byt*
/testsuite/tests/tool-ocamldep-modalias/*.opt*
/testsuite/tests/tool-ocamldep-modalias/depend.mk
/testsuite/tests/tool-ocamldep-modalias/depend.mk2
/testsuite/tests/tool-ocamldep-modalias/depend.mod
/testsuite/tests/tool-ocamldep-modalias/depend.mod2
/testsuite/tests/tool-ocamldep-modalias/depend.mod3
/testsuite/tests/tool-ocamldoc/*.html
/testsuite/tests/tool-ocamldoc/*.sty
/testsuite/tests/tool-ocamldoc/*.css
/testsuite/tests/tool-ocamldoc-2/ocamldoc.sty
/testsuite/tests/tool-ocamldoc-html/*.html
/testsuite/tests/tool-ocamldoc-html/style.css
/testsuite/tests/tool-ocamldoc-man/*.3o
/testsuite/tests/tool-ocamldoc-open/alias.odoc
/testsuite/tests/tool-ocamldoc-open/inner.odoc
/testsuite/tests/tool-ocamldoc-open/main.odoc
/testsuite/tests/tool-ocamldoc-open/ocamldoc.sty
/testsuite/tests/tool-lexyacc/scanner.ml
/testsuite/tests/tool-lexyacc/grammar.mli
/testsuite/tests/tool-lexyacc/grammar.ml
/testsuite/tests/typing-multifile/a.ml
/testsuite/tests/typing-multifile/b.ml
/testsuite/tests/typing-multifile/c.ml
/testsuite/tests/unboxed-primitive-args/main.ml
/testsuite/tests/unboxed-primitive-args/stubs.c
/testsuite/tests/unwind/unwind_test
/testsuite/tests/warnings/w55.opt.opt_result
/testsuite/tests/warnings/w58.opt.opt_result
/testsuite/tools/codegen
/testsuite/tools/expect_test
/testsuite/tools/lexcmm.ml
/testsuite/tools/parsecmm.ml
/testsuite/tools/parsecmm.mli
/tools/ocamldep
/tools/ocamldep.opt
......@@ -365,6 +260,7 @@
/tools/stripdebug.opt
/tools/make_opcodes
/tools/make_opcodes.ml
/tools/caml-tex
/utils/config.ml
......
......@@ -8,12 +8,16 @@
# See the MAPPING AUTHORS section of 'man git-shortlog' for more details.
# Such a remapping may be useful in particular for tracking authorship
# of commits erroneously made under an obscure alias or email adress.
# of commits erroneously made under an obscure alias or email address.
# (Some Name <some@name.com>, pour ne pas le citer)
### Normalizing information for frequent git commit authors
Alain Frisch <alain@frisch.fr> alainfrisch <alain@frisch.fr>
<damien.doligez@inria.fr> <damien.doligez-inria.fr>
<damien.doligez@inria.fr> <damien.doligez@gmail.com>
Luc Maranget <luc.maranget@inria.fr>
<luc.maranget@inria.fr> <Luc.Maranget@inria.fr>
<luc.maranget@inria.fr> <maranget@pl-59086.rocq.inria.fr>
<pierre.chambart@ocamlpro.com> <chambart@users.noreply.github.com>
......@@ -25,6 +29,27 @@ Damien Doligez <damien.doligez@inria.fr> Some Name <some@name.com>
Damien Doligez <damien.doligez@inria.fr> doligez <damien.doligez@inria.fr>
Mohamed Iguernelala <mohamed.iguernelala@gmail.com>
Jérémie Dimino <jdimino@janestreet.com>
Jeremy Yallop <yallop@gmail.com> yallop <yallop@gmail.com>
Nicolás Ojeda Bär <n.oje.bar@gmail.com>
### Approved Approvers
# The current policy to handle pull requests for the compiler
# distribution is to merge a PR only it has been "approved" by someone
# who is not an author of the PR and has the "approver" status, by
# either
# (1) having been given commit rights, or
# (2) being part of the list of "approvers" below.
#
# Format:
#
# Preferred Name <nickname>
Gabriel Radanne <Drup>
### Remembering naming preferences for contributors
# The aliases below correspond to preference expressed by
# contributors on the name under which they credited, for example
......@@ -60,10 +85,12 @@ Florian Angeletti <octachron>
Kenji Tokudome <pocarist>
Philippe Veber <pveber>
Valentin Gatien-Baron <sliquister>
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
Stephen Dolan <stedolan>
Junsong Li <lijunsong@mantis>
Junsong Li <ljs.darkfish@gmail.com>
Christophe Raffali <craff@mantis>
Christophe Raffali <ChriChri@mantis>
Anton Bachin <antron@mantis>
Reed Wilson <omion>
David Scott <djs55>
......@@ -73,12 +100,28 @@ Thomas Leonard <talex@mantis>
Thomas Leonard <talex5@github>
Adrien Nader <adrien-n@github>
Sébastien Hinderer <shindere@github>
Sébastien Hinderer <Sebastien.Hinderer@inria.fr>
Gabriel Scherer <gasche@github>
Immanuel Litzroth <sdev@mantis>
Jacques Le Normand <rathereasy@github>
Konstantin Romanov <const-rs@github>
Arseniy Alekseyev <aalekseyev@janestreet.com>
Dwight Guth <dwight.guth@runtimeverification.com>
Dwight Guth <dwightguth@github>
Andreas Hauptmann <andreashauptmann@t-online.de> fdopen <andreashauptmann@t-online.de>
Andreas Hauptmann <andreashauptmann@t-online.de> <fdopen@users.noreply.github.com>
Andreas Hauptmann <andreashauptmann@t-online.de> <aha@mantis>
Hendrik Tews <hendrik@askra.de>
Hugo Heuzard <hugo.heuzard@gmail.com>
Miod Vallat <miod@mantis>
Christoph Spiel <cspiel@mantis>
Joris Giovannangeli <joris@mantis>
Wilfred Hughes <wilfred@fb.com> <wilfred@mantis>
John Skaller <skaller@mantis>
# These contributors prefer to be referred to pseudonymously
<whitequark@mantis> <whitequark@mantis>
<william@mantis> <william@mantis>
tkob <ether4@gmail.com> tkob <ether4@gmail.com>
ygrek <ygrek@autistici.org> ygrek <ygrek@autistici.org>
whitequark <whitequark@whitequark.org>
william <william@mantis>
tkob <ether4@gmail.com>
ygrek <ygrek@autistici.org>
linse <linse@github>
S ./asmcomp
B ./asmcomp
S ./middle_end
B ./middle_end
S ./middle_end/base_types
B ./middle_end/base_types
S ./bytecomp
B ./bytecomp
S ./driver
B ./driver
S ./lex
B ./lex
S ./otherlibs/bigarray
B ./otherlibs/bigarray
S ./otherlibs/dynlink
B ./otherlibs/dynlink
S ./otherlibs/graph
B ./otherlibs/graph
S ./otherlibs/num
B ./otherlibs/num
S ./otherlibs/str
B ./otherlibs/str
S ./otherlibs/systhreads
B ./otherlibs/systhreads
S ./otherlibs/threads
B ./otherlibs/threads
S ./otherlibs/unix
B ./otherlibs/unix
S ./parsing
B ./parsing
S ./stdlib
B ./stdlib
S ./toplevel
B ./toplevel
S ./typing
B ./typing
S ./utils
B ./utils
......@@ -17,12 +17,32 @@ sudo: false
language: c
git:
submodules: false
script: bash -ex .travis-ci.sh
script: bash -e tools/ci/travis/travis-ci.sh
matrix:
include:
- env: CI_KIND=build XARCH=i386
- env: CI_KIND=build XARCH=i386 CONFIG_ARG=-flambda OCAMLRUNPARAM=b,v=0
addons:
apt:
packages:
- gcc:i386
- cpp:i386
- binutils:i386
- binutils-dev:i386
- libx11-dev:i386
- libc6-dev:i386
- env: CI_KIND=build XARCH=x64
- env: CI_KIND=build XARCH=x64 CONFIG_ARG=--enable-flambda OCAMLRUNPARAM=b,v=0
- env: CI_KIND=changes
- env: CI_KIND=manual
- env: CI_KIND=check-typo
- env: CI_KIND=tests
allow_failures:
- env: CI_KIND=tests
addons:
apt:
packages:
- binutils-dev
notifications:
email:
- ocaml-ci-notifications@inria.fr
= Bootstrapping the compiler
This file explains how to bootstrap the OCaml compiler, i.e. how to
update the binaries in the link:boot/[] directory.
A bootstrap is required for example when something changes in the
runtime system (the magic number of bytecode executables, the format of
bytecode instructions, the set of available primitives) or when the
format of .cmi files is modified. In particular, given that the .cmi
files contain information related to types, modifying the way a type is
represented will modify the format of .cmi files and thus require a
bootstrap.
Here is how to perform a change that requires a bootstrap:
1. Make sure you start with a clean source tree (e.g. check with
`git status`)
2. Configure your source tree by running:
./configure
3. Bring your system to a stable state. Concretely, this means that the
boot/ directory should contain a version of ocamlrun and all the
\*.cm* files of the standard library. This stable state can be reached
by running
make world
+
(Actually, running `make coldstart` should be enough but `make world` is
safer. Similarly, `make world.opt` will also bring you to such a stable
state but builds more things than actually required.)
4. Now, and only now, edit the sources. Changes here may include adding,
removing or renaming a primitive in the runtime, changing the magic
number of bytecode executable files, changing the way types are
represented or anything else in the format of .cmi files, etc.
5. Run:
make coreall
+
This will rebuild runtime/ocamlrun, ocamlc, etc.
6. (optional) The new system can now be tested:
echo 'let _ = print_string "Hello world!\n"' > foo.ml
./boot/ocamlrun ./ocamlc -I ./stdlib foo.ml
./runtime/ocamlrun a.out
7. We now know the system works and can thus build the new boot/
binaries:
make bootstrap
If you notice that this procedure fails for a given change you are
trying to implement, please report it so that the procedure can be
updated to also cope with your change.
......@@ -35,6 +35,31 @@ proposals against the OCaml distribution. (Code changes, but also
improvement to documentation or implementation comments, which are
valuable changes on their own.)
## Workflow
All changes to the OCaml distribution need to be processed through the
GitHub Pull Request (PR) system. In order to propose a change, a
contributor thus needs to have a GitHub account, fork the ocaml/ocaml
repository, create a branch for the proposal on their fork and submit
it as a Pull Request on the upstream repository. (If you are not yet
familiar with GitHub, don't worry, all these steps are actually quite
easy!)
The current rule is that a PR needs to get an explicit approval from
one of the core maintainer in order to be merged. Reviews by
external contributors are very much appreciated.
Since core maintainers cannot push directly without going through an
approved PR, they need to be able to apply small changes to the
contributed branches themselves. Such changes include fixing
conflicts, adjusting a Changelog entry, or applying some code changes
required by the reviewers. Contributors are thus strongly advised to
check the [**Allow edits from maintainer**](
https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/
) flag on their PRs in the GitHub interface. Failing to do so might
significantly delay the inclusion of an otherwise perfectly ok
contribution.
## Coding guidelines
......@@ -43,6 +68,9 @@ columns, not use tab characters (spaces only), and not use non-ASCII
characters. These typographical rules can be checked with the script
`tools/check-typo`.
If you are working from a Git clone, you can automate this process by
copying the file `tools/pre-commit-githook` to `.git/hooks/pre-commit`.
Otherwise, there are no strongly enforced guidelines specific to the
compiler -- and, as a result, the style may differ in the different
parts of the compiler. The general [OCaml Programming
......@@ -176,12 +204,10 @@ Any user-visible change should have a `Changes` entry:
from a commit message, but it should make sense to end-users
reading release notes)
- crediting the people that worked on the feature
The people that wrote the code should be credited of course,
but also substantial code reviews or design advice, and the
reporter of the bug (if applicable) or designer of the
feature request (if novel).
- crediting the people that worked on the feature. The people that
wrote the code should be credited of course, but also substantial
code reviews or design advice, and the reporter of the bug
(if applicable) or designer of the feature request (if novel).
- following the format
......
This diff is collapsed.
= Hacking the compiler 🐫
= Hacking the compiler :camel:
This document is a work-in-progress attempt to provide useful
information for people willing to inspect or modify the compiler
......@@ -43,6 +43,14 @@ make tests
----
opam compiler-conf install
----
+
With opam 2, create a local opam switch with the compiler installed from
the current source directory:
+
----
opam switch create . --empty
opam install .
----
6. You did it, Well done! Consult link:CONTRIBUTING.md[] to send your contribution upstream.
......@@ -58,8 +66,9 @@ newcomers. Here are various potential projects:
* http://caml.inria.fr/mantis/view_all_bug_page.php[The OCaml
bugtracker] contains reported bugs and feature requests. Some
changes that should be accessible to newcomers are marked with the
tag
http://caml.inria.fr/mantis/search.php?project_id=1&sticky_issues=1&sortby=last_updated&dir=DESC&highlight_changed=24&hide_status_id=90&tag_string=junior_job[junior_job].
tag link:++http://caml.inria.fr/mantis/search.php?
project_id=1&sticky_issues=1&sortby=last_updated&dir=DESC&highlight_changed=24&hide_status_id=90&tag_string=junior_job++[
junior_job].
* The
https://github.com/ocamllabs/compiler-hacking/wiki/Things-to-work-on[OCaml
......@@ -109,8 +118,8 @@ Parses source files and produces an Abstract Syntax Tree (AST)
link:parsing/HACKING.adoc[].
The logic for Camlp4 and Ppx preprocessing is not in link:parsing/[],
but in link:driver/[], see link:driver/pparse.mli[],
link:driver/pparse.mli[].
but in link:driver/[], see link:driver/pparse.mli[] and
link:driver/pparse.ml[].
==== Typing -- link:typing/[]
......@@ -132,6 +141,17 @@ independent and should not need further knowledge.
link:otherlibs/[]:: External libraries such as `unix`, `threads`,
`dynlink`, `str` and `bigarray`.
Instructions for building the full reference manual are provided in
link:manual/README.md[]. However, if you only modify the documentation
comments in `.mli` files in the compiler codebase, you can observe the
result by running
----
make html_doc
----
and then opening link:./ocamldoc/stdlib_html/index.html[] in a web browser.
=== Tools
link:lex/[]:: The `ocamllex` lexer generator.
......@@ -145,38 +165,37 @@ has excellent documentation.
=== Complete file listing
BOOTSTRAP.adoc:: instructions for bootstrapping
Changes:: what's new with each release
configure:: configure script
CONTRIBUTING.md:: how to contribute to OCaml
HACKING.adoc:: this file
INSTALL.adoc:: instructions for installation
LICENSE:: license and copyright notice
Makefile:: main Makefile
Makefile.nt:: Windows Makefile (deprecated)
Makefile.shared:: common Makefile
Makefile.common:: common Makefile definitions
Makefile.tools:: used by manual/ and testsuite/ Makefiles
README.adoc:: general information on the compiler distribution
README.win32.adoc:: general information on the Windows ports of OCaml
VERSION:: version string
asmcomp/:: native-code compiler and linker
asmrun/:: native-code runtime library
boot/:: bootstrap compiler
bytecomp/:: bytecode compiler and linker
byterun/:: bytecode interpreter and runtime system
compilerlibs/:: the OCaml compiler as a library
config/:: configuration files
configure:: configure script
debugger/:: source-level replay debugger
driver/:: driver code for the compilers
emacs/:: editing mode and debugger interface for GNU Emacs
experimental/:: experiments not built by default
flexdll/:: git submodule -- see link:README.win32.adoc[]
lex/:: lexer generator
man/:: man pages
manual/:: system to generate the manual
middle_end/:: the flambda optimisation phase
ocamldoc/:: documentation generator
ocamltest/:: test driver
otherlibs/:: several additional libraries
parsing/:: syntax analysis -- see link:parsing/HACKING.adoc[]
runtime/:: bytecode interpreter and runtime systems
stdlib/:: standard library
testsuite/:: tests -- see link:testsuite/HACKING.adoc[]
tools/:: various utilities
......@@ -213,17 +232,43 @@ installation, the following targets may be of use:
=== Bootstrapping
The OCaml compiler is bootstrapped. This means that
previously-compiled bytecode versions of the compiler, dependency
generator and lexer are included in the repository under the
previously-compiled bytecode versions of the compiler and lexer are
included in the repository under the
link:boot/[] directory. These bytecode images are used once the
bytecode runtime (which is written in C) has been built to compile the
standard library and then to build a fresh compiler. Details can be
found in link:INSTALL.adoc#bootstrap[INSTALL.adoc].
found in link:BOOTSTRAP.adoc[].
=== Continuous integration
==== Github's CI: Travis and AppVeyor
The script that is run on Travis continuous integration servers is
link:tools/ci/travis/travis-ci.sh[]; its configuration can be found as
a Travis configuration file in link:.travis.yml[].
For example, if you want to reproduce the default build on your
machine, you can use the configuration values and run command taken from
link:.travis.yml[]:
----
CI_KIND=build XARCH=x64 bash -ex tools/ci/travis/travis-ci.sh
----
The scripts support two other kinds of tests (values of the
`CI_KIND` variable) which both inspect the patch submitted as part of
a pull request. `tests` checks that the testsuite has been modified
(hopefully, improved) by the patch, and `changes` checks that the
link:Changes[] file has been modified (hopefully to add a new entry).
These tests rely on the `$TRAVIS_COMMIT_RANGE` variable which you can
set explicitly to reproduce them locally.
The `changes` check can be disabled by including "(no change
entry needed)" in one of your commit messages -- but in general all
patches submitted should come with a Changes entry; see the guidelines
in link:CONTRIBUTING.md[].
==== INRIA's Continuous Integration (CI)
INRIA provides a Jenkins continuous integration service that OCaml
......@@ -235,26 +280,60 @@ PR.
You do not need to be an INRIA employee to open an account on this
jenkins service; anyone can create an account there to access build
logs, enable email notifications, and manually restart builds. If you
would like to do this but have trouble doing it, please contact Damien
Doligez or Gabriel Scherer.
logs and manually restart builds. If you
would like to do this but have trouble doing it, please email
ocaml-ci-admin@inria.fr.
To be notified by email of build failures, you can subscribe to the
ocaml-ci-notifications@inria.fr mailing list by visiting
https://sympa.inria.fr/sympa/info/ocaml-ci-notifications[its web page.]
==== Running INRIA's CI on a github Pull Request (PR)
==== Running INRIA's CI on a publicly available git branch
If you have suspicions that a PR may fail on exotic architectures
(it touches the build system or the backend code generator,
If you have suspicions that your changes may fail on exotic architectures
(they touch the build system or the backend code generator,
for example) and would like to get wider testing than github's CI
provides, it is possible to manually start INRIA's CI on arbitrary git
branches by pushing to a `precheck` branch of the main repository.
branches even before opening a pull request as follows:
1. Make sure you have an account on Inria's CI as described before.
2. Make sure you have been added to the ocaml project.
3. Prepare a branch with the code you'd like to test, say "mybranch". It
is probably a good idea to make sure your branch is based on the latest
trunk.
4. Make your branch publicly available. For instance, you can fork
OCaml's GitHub repository and then push "mybranch" to your fork.
This is done by pushing to a specific github repository that the CI
watches, namely
link:https://github.com/ocaml/precheck[ocaml/precheck]. You thus need
to have write/push/commit access to this repository to perform this operation.
5. Visit https://ci.inria.fr/ocaml/job/precheck and log in. Click on
"Build with parameters".
6. Fill in the REPO_URL and BRANCH fields as appropriate and run the build.
7. You should receive a bunch of e-mails with the build logs for each
slave and each tested configuration (with and without flambda) attached.
==== Changing what the CI does
INRIA's CI "main" and "precheck" jobs run the script
tools/ci-build. In particular, when running the CI on a publicly
available branch via the "precheck" job as explained in the previous
section, you can edit this script to change what the CI will test.
For instance, parallel builds are only tested for the "trunk"
branch. In order to use "precheck" to test parallel build on a custom
branch, add this at the beginning of tools/ci-build:
----
OCAML_JOBS=10
----
Just checkout the commit/branch you want to test, then run
=== The `caml-commits` mailing list
git push --force git@github.com:ocaml/precheck.git HEAD:trunk
If you would like to receive email notifications of all commits made to the main
git repository, you can subscribe to the caml-commits@inria.fr mailing list by
visiting https://sympa.inria.fr/sympa/info/caml-commits[its web page.]
(This is the syntax to push the current `HEAD` state into the `trunk`
reference on the specified remote.)
\ No newline at end of file
Happy Hacking!
= Installing OCaml from sources on a Unix(-like) machine =
== PREREQUISITES
== Prerequisites
* The GNU C Compiler (gcc) is recommended, as the bytecode interpreter takes
advantage of GCC-specific features to enhance performance. gcc is the standard
......@@ -19,177 +19,46 @@
to be able to process `.cmxs` files. `diffutils` is necessary to run the test
suite.
== INSTALLATION INSTRUCTIONS
== Configuration
1. Configure the system. From the top directory, do:
From the top directory, do:
./configure
+
This generates the three configuration files `Makefile`, `m.h` and `s.h`
in the `config/` subdirectory.
This generates the three configuration files `Makefile.config`,
`runtime/caml/m.h` and `runtime/caml/s.h`.
+
The `configure` script accepts the following options:
+
`-prefix <dir>`:: (default: `/usr/local`)
Set the `PREFIX` variable used to define the defaults of the following
three options. Must be an absolute path name.
`-bindir <dir>`:: (default: `$(PREFIX)/bin`)
Directory where the binaries will be installed. Must be an absolute
path name, or start with `$(PREFIX)`.
`-libdir <dir>`:: (default: `$(PREFIX)/lib/ocaml`)
Directory where the OCaml library will be installed. Must be an
absolute path name, or start with `$(PREFIX)`.
`-mandir <dir>`:: (default: `$(PREFIX)/man/man1`)
Directory where the manual pages will be installed. Must be an absolute
path name, or start with `$(PREFIX)`.
`-cc <C compiler and options>`:: (default: `gcc` if found, otherwise `cc`)
C compiler to use for building the system.
`-libs <extra libraries>`:: (default: none)
Extra libraries to link with the system.
`-no-curses`::
Do not use the curses library.
The only use for this is to highlight errors in the toplevel using
'standout' mode, e.g. underline, rather than with '^' on a newline.
`-host <hosttype>`:: (default: determined automatically)
The type of the host machine, in GNU's "configuration name" format
(CPU-COMPANY-SYSTEM or CPU-COMPANY-KERNEL-SYSTEM). This info is
generally determined automatically by the `configure` script, and rarely
ever needs to be provided by hand. The installation instructions for
GCC or GNU Emacs contain a complete list of configuration names.
`-target <targettype>`:: (default: same as `-host`)
The type of the target machine, in GNU's "configuration name" format
(CPU-COMPANY-SYSTEM or CPU-COMPANY-KERNEL-SYSTEM). Setting this will
setup OCaml as a cross-compiler which runs on `$host` and produces code
for `$target`. This requires a C toolchain which also produces code for
`$target` and a native OCaml compiler of the exact same version (if you
want a cross 4.00.1, you need a native 4.00.1).
`-x11include <include_dir>`:: (default: determined automatically)
`-x11lib <lib_dir>`:: (default: determined automatically)
Location of the X11 include directory (e.g. `/usr/X11R6/include`) and
the X11 library directory (e.g. `/usr/X11R6/lib`).
`-no-pthread`::
Do not attempt to use POSIX threads.
`-with-pthread`::
Attempt to use POSIX threads (this is the default).
`-no-shared-libs`::
Do not configure support for shared libraries.
`-dldefs <cpp flags>`::
`-dllibs <flags and libraries>`::
These options specify where to find the libraries for dynamic linking
(i.e. use of shared libraries). `-dldefs` specifies options for finding
the header files, and `-dllibs` for finding the C libraries.
`-as <assembler and options>`:: (default: determined automatically)
The assembler to use for assembling ocamlopt-generated code.
`-aspp <assembler and options>`:: (default: determined automatically)
The assembler to use for assembling the parts of the run-time system
manually written in assembly language. This assembler must pre-process
its input with the C preprocessor.
`-with-debug-runtime`::
Compile and install the debug version of the runtimes, useful for
debugging C stubs and other low-level code.
`-with-instrumented-runtime`::
Compile and install the instrumented version of the runtimes, useful
mainly for fine-tuning the GC. Works only on Linux.
`-verbose`::
Verbose output of the configuration tests. Use it if the outcome of
`configure` is not what you were expecting.
`-no-debugger`::
Do not build `ocamldebug`.
`-no-native-compiler`::
Do not build the native compiler -- bytecode compilation only.
`-no-ocamldoc`::
Do not build `ocamldoc`.
`-no-ocamlbuild`::
Deprecated since 4.03.0, as `ocamlbuild` is now distributed separately
from the compiler distribution.
`-no-graph`::
Do not compile the Graphics library.
`-partialld <linker and options>`:: (default: determined automatically)
The linker and options to use for producing an object file (rather than
an executable) from several other object files.
The `configure` script accepts options that can be discovered by running:
`-no-cfi`::
Do not compile support for CFI directives.
./configure --help
+
Some options or variables like (LDFLAGS) may not be taken into account
by the OCaml build system at the moment. Please report an issue if you
discover such a variable or option and this causes troubles to you.
+
Examples:
* Standard installation in `/usr/{bin,lib,man}` instead of `/usr/local`:
./configure -prefix /usr
* Installation in `/usr`, man pages in section "l":
./configure -bindir /usr/bin -libdir /usr/lib/ocaml -mandir /usr/man/manl
+
or:
./configure --prefix=/usr
./configure -prefix /usr -mandir '$(PREFIX)/man/manl'
* On a Linux x86-64 host, to build a 32-bit version of OCaml:
./configure -cc "gcc -m32" -as "as --32" -aspp "gcc -m32 -c" \
-host i386-linux -partialld "ld -r -melf_i386"
* On a Linux x86-64 host, to build the run-time system in PIC mode, no special
options should be required -- the libraries should be built automatically.
The old instructions were:
./configure -cc "gcc -fPIC" -aspp "gcc -c -fPIC"
+
On a 64-bit POWER architecture host running Linux, OCaml only operates in a
32-bit environment. If your system compiler is configured as 32-bit, e.g.
Red Hat 5.9, you don't need to do anything special. If that is not the case
(e.g. Red Hat 6.4), then IBM's "Advance Toolchain" can be used. For example:
export PATH=/opt/at7.0/bin:$PATH
./configure -cc "gcc -m32" -as "as -a32" -aspp "gcc -m32 -c" \
-partialld "ld -r -m elf32ppc"
* On a OS X 10.5/Intel Core 2 or OS X 10.5/PowerPC host, to build a 64-bit
version of OCaml:
./configure -cc "gcc -m64"
* On OS X Intel, to build a 32-bit version of OCaml:
./configure -host "i386-apple-darwin13.2.0" -cc "gcc -arch i386 -m32" \
-as "as -arch i386" -aspp "gcc -arch i386 -m32 -c"
* For Sun Solaris with the `acc` compiler:
./configure -cc "acc -fast" -libs "-lucb"
* For Sun Solaris on Sparc 64bit, to compile natively (32bit only)
./configure -cc "gcc -m32" -as "as -32" -aspp "gcc -m32 -c"
./configure --build=x86_64-pc-linux-gnu --host=i386-linux \
CC='gcc -m32' AS='as --32' ASPP='gcc -m32 -c' \
PARTIALLD='ld -r -melf_i386'
* For AIX 4.3 with the IBM compiler `xlc`:
./configure -cc "xlc_r -D_AIX43 -Wl,-bexpall,-brtl -qmaxmem=8192"
* For AIX 7.x with the IBM compiler `xlc`:
./configure CC=xlc
+
By default, build is 32-bit. For 64-bit build, please set environment variable `OBJECT_MODE=64`
for _both_ `configure` and `make world` phases. Note, if this variable is set for only one phase,
your build will break (`ocamlrun` segfaults).
+
If something goes wrong during the automatic configuration, or if the generated
files cause errors later on, then look at the template files:
......@@ -200,68 +69,35 @@ files cause errors later on, then look at the template files:
+
for guidance on how to edit the generated files by hand.
2. From the top directory, do:
== Building the compiler
From the top directory, do:
make world.opt
+
if your platform is supported by the native-code compiler (as reported during
the auto-configuration), or
make world
+
if not.
This builds the OCaml bytecode compiler for the first time. This phase is
fairly verbose; consider redirecting the output to a file:
make world > log.world 2>&1 # in sh
make world >& log.world # in csh
[[bootstrap]]
3. (Optional) To be sure everything works well, you can try to bootstrap the
system -- that is, to recompile all OCaml sources with the newly created
compiler. From the top directory, do:
make bootstrap
+
or, better:
make bootstrap > log.bootstrap 2>&1 # in sh
make bootstrap >& log.bootstrap # in csh
+
The `make bootstrap` checks that the bytecode programs compiled with the new
compiler are identical to the bytecode programs compiled with the old compiler.
If this is the case, you can be pretty sure the system has been correctly
compiled. Otherwise, this does not necessarily mean something went wrong. The
best thing to do is to try a second bootstrapping phase: just do
`make bootstrap` again. It will either crash almost immediately, or
re-re-compile everything correctly and reach the fix-point.
4. If your platform is supported by the native-code compiler (as reported during
the auto-configuration), you can now build the native-code compiler. From
the top directory, do:
make opt
+
or:
make opt > log.opt 2>&1 # in sh
make opt >& log.opt # in csh
== (Optional) Running the testsuite
5. anchor:step-5[] Compile fast versions of the OCaml compilers, by compiling
them with the native-code compiler (you will have only compiled them to
bytecode in steps 2-4). Just do:
To be sure everything works well, you can run the test suite
that comes with the compiler. To do so, do:
make opt.opt
+
Later, you can compile your programs to bytecode using ocamlc.opt instead of
ocamlc, and to native-code using ocamlopt.opt instead of ocamlopt. The ".opt"
compilers should run faster than the normal compilers, especially on large input
files, but they may take longer to start due to increased code size. If
compilation times are an issue on your programs, try the ".opt" compilers to see
if they make a significant difference.
+
An alternative, and faster approach to steps 2 to 5 is
make tests
make world.opt # to build using native-code compilers
+
The result is equivalent to `make world opt opt.opt`, but this may fail if
anything goes wrong in native-code generation.
== Installing the compiler
6. You can now install the OCaml system. This will create the following commands
You can now install the OCaml system. This will create the following commands
(in the binary directory selected during autoconfiguration):
+
[width="70%",frame="topbot",cols="25%,75%"]
......@@ -281,68 +117,46 @@ anything goes wrong in native-code generation.
| `ocamlcp` | the bytecode compiler in profiling mode
|===============================================================================
+
and also, if you built them during <<step-5,step 5>>: `ocamlc.opt`,
`ocamlopt.opt`, `ocamllex.opt`, `ocamldep.opt` and `ocamldoc.opt`
+
From the top directory, become superuser and do:
umask 022 # make sure to give read & execute permission to all
make install
7. Installation is complete. Time to clean up. From the toplevel directory,
Installation is complete. Time to clean up. From the toplevel directory,
do:
make clean
8. (Optional) The `emacs/` subdirectory contains Emacs-Lisp files for an OCaml
editing mode and an interface for the debugger. To install these files,
change to the `emacs/` subdirectory and do:
make EMACSDIR=<directory where to install the files> install
+
or
make install
+
In the latter case, the destination directory defaults to the
`site-lisp` directory of your Emacs installation.
9. After installation, do *not* strip the `ocamldebug` and `ocamlbrowser`
executables. These are mixed-mode executables (containing both compiled C
After installation, do *not* strip the `ocamldebug` executables.
This is a mixed-mode executable (containing both compiled C
code and OCaml bytecode) and stripping erases the bytecode! Other
executables such as `ocamlrun` can safely be stripped.
== IF SOMETHING GOES WRONG
== If something goes wwong
Read the "common problems" and "machine-specific hints" section at the end of
this file.
Check the files `m.h` and `s.h` in `config/`. Wrong endian-ness or alignment
constraints in `m.h` will immediately crash the bytecode interpreter.
Check the files `m.h` and `s.h` in `runtime/caml/`.
Wrong endianness or alignment constraints in `machine.h` will
immediately crash the bytecode interpreter.
If you get a "segmentation violation" signal, check the limits on the stack size
and data segment size (type `limit` under csh or `ulimit -a` under bash). Make
sure the limit on the stack size is at least 4M.
Try recompiling the runtime system with optimizations turned off (change
`CFLAGS` in `byterun/Makefile` and `asmrun/Makefile`). The runtime system
`OC_CFLAGS` in `runtime/Makefile`). The runtime system
contains some complex, atypical pieces of C code which can uncover bugs in
optimizing compilers. Alternatively, try another C compiler (e.g. `gcc` instead
of the vendor-supplied `cc`).
You can also build a debug version of the runtime system. Go to the `byterun/`
You can also build a debug version of the runtime system. Go to the `runtime/`
directory and do `make ocamlrund`. Then, copy `ocamlrund` to
`../boot/ocamlrun`, and try again. This version of the runtime system contains
lots of assertions and sanity checks that could help you pinpoint the problem.
== COMMON PROBLEMS
* The Makefiles use the `include` directive, which is not supported by all
versions of make. Use GNU Make if this is a problem.
* Solaris make mishandles a space in our Makefiles, so you have to use GNU make
to build on Solaris.
== Common problems
* The Makefiles assume that make executes commands by calling `/bin/sh`. They
won't work if `/bin/csh` is called instead. You may have to unset the `SHELL`
......@@ -352,18 +166,6 @@ lots of assertions and sanity checks that could help you pinpoint the problem.
the C locale (`export LC_ALL=C`) before compiling if you have strange errors
while compiling OCaml.
* GCC 2.7.2.1 generates incorrect code for the runtime system in `-O` mode on
some Intel x86 platforms (e.g. Linux RedHat 4.1 and 4.2). If this causes a
problem, the solution is to upgrade to 2.7.2.3 or above.
* Some versions of GCC 2.96 for the Intel x86 (as found in RedHat 7.2,
Mandrake 8.0 and Mandrake 8.1) generate incorrect code for the runtime system.
The `configure` script tries to work around this problem.
* On HP 9000/700 machines under HP/UX 9, some versions of `cc` are unable to
compile correctly the runtime system (wrong code is generated for `(x - y)`
where `x` is a pointer and `y` an integer). Fix: use `gcc`.
* Under OS X 10.6, with XCode 4.0.2, the `configure` script mistakenly detects
support for CFI directives in the assembler. Fix: give the `-no-cfi` option to
`configure`.
This diff is collapsed.
......@@ -2,9 +2,9 @@
#* *
#* OCaml *
#* *
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
#* Gabriel Scherer, projet Parsifal, INRIA Saclay *
#* *
#* Copyright 1999 Institut National de Recherche en Informatique et *
#* Copyright 2018 Institut National de Recherche en Informatique et *
#* en Automatique. *
#* *
#* All rights reserved. This file is distributed under the terms of *
......@@ -13,36 +13,41 @@
#* *
#**************************************************************************
# Makefile for the "num" (exact rational arithmetic) library
# This makefile contains common definitions shared by other Makefiles
# We assume that Makefile.config has already been included
LIBNAME=nums
EXTRACFLAGS=-DBNG_ARCH_$(BNG_ARCH) -DBNG_ASM_LEVEL=$(BNG_ASM_LEVEL)
CAMLOBJS=int_misc.cmo nat.cmo big_int.cmo arith_flags.cmo \
ratio.cmo num.cmo arith_status.cmo
CMIFILES=big_int.cmi nat.cmi num.cmi ratio.cmi arith_status.cmi
COBJS=bng.$(O) nat_stubs.$(O)
INSTALL ?= @INSTALL@
INSTALL_DATA ?= $(INSTALL) -m u=rw,g=rw,o=r
INSTALL_PROG ?= $(INSTALL) -m u=rwx,g=rwx,o=rx
include ../Makefile
# note: these are defined by lazy expansions
# as some parts of the makefiles change BINDIR, etc.
# and expect INSTALL_BINDIR, etc. to stay in synch
# (see `shellquote` in tools/Makefile)
INSTALL_BINDIR = $(DESTDIR)$(BINDIR)
INSTALL_LIBDIR = $(DESTDIR)$(LIBDIR)
INSTALL_STUBLIBDIR = $(DESTDIR)$(STUBLIBDIR)
INSTALL_MANDIR = $(DESTDIR)$(MANDIR)
clean::
rm -f *~
bng.$(O): bng.h bng_digit.c \
bng_amd64.c bng_ia32.c bng_ppc.c bng_sparc.c
# At the moment, the following rule only works with gcc
# It is not a big deal since the .depend file it produces is stored
# in the repository
depend:
$(CC) -MM $(CFLAGS) *.c > .depend
$(CAMLRUN) $(ROOTDIR)/tools/ocamldep -slash *.mli *.ml >> .depend
ifeq "$(TOOLCHAIN)" "msvc"
.depend.nt: .depend
sed -e 's/\.o/.$(O)/g' $< > $@
ifeq "$(UNIX_OR_WIN32)" "win32"
FLEXDLL_SUBMODULE_PRESENT := $(wildcard $(ROOTDIR)/flexdll/Makefile)
else
FLEXDLL_SUBMODULE_PRESENT =
endif
include .depend.nt
ifeq "$(FLEXDLL_SUBMODULE_PRESENT)" ""
FLEXLINK_ENV =
CAMLOPT_CMD = $(CAMLOPT)
OCAMLOPT_CMD = $(OCAMLOPT)
MKLIB_CMD = $(MKLIB)
ocamlc_cmd = $(ocamlc)
ocamlopt_cmd = $(ocamlopt)
else
include .depend
FLEXLINK_ENV = \
OCAML_FLEXLINK="$(ROOTDIR)/boot/ocamlrun $(ROOTDIR)/flexdll/flexlink.exe"
CAMLOPT_CMD = $(FLEXLINK_ENV) $(CAMLOPT)
OCAMLOPT_CMD = $(FLEXLINK_ENV) $(OCAMLOPT)
MKLIB_CMD = $(FLEXLINK_ENV) $(MKLIB)
ocamlc_cmd = $(FLEXLINK_ENV) $(ocamlc)
ocamlopt_cmd = $(FLEXLINK_ENV) $(ocamlopt)
endif
# @configure_input@
#**************************************************************************
#* *
#* OCaml *
......@@ -13,93 +15,98 @@
#* *
#**************************************************************************
### Compile-time configuration
# The configuration Makefile
## The EMPTY variable, used in other definitions
EMPTY=
## Arguments passed to the configure script
CONFIGURE_ARGS=@CONFIGURE_ARGS@
## Top build directory
TOP_BUILDDIR = @top_builddir@
## Installation directories
prefix=@prefix@
########## General configuration
exec_prefix=@exec_prefix@
### Where to install the binaries
BINDIR=/usr/local/bin
BINDIR=@bindir@
datarootdir=@datarootdir@
### Where to install the standard library
LIBDIR=/usr/local/lib/ocaml
STUBLIBDIR=$(LIBDIR)/stublibs
LIBDIR=@libdir@
### Where to install the stub code for the standard library
STUBLIBDIR=@libdir@/stublibs
### Where to install the man pages
# Man pages for commands go in $(MANDIR)/man$(MANEXT)
# Man pages for the library go in $(MANDIR)/mano
MANDIR=/usr/local/man
MANEXT=1
# Man pages for commands go in $(MANDIR)/man$(PROGRAMS_MAN_SECTION)
# Man pages for the library go in $(MANDIR)/man/man$(LIBRARIES_MAN_SECTION)
MANDIR=@mandir@
PROGRAMS_MAN_SECTION=@programs_man_section@
LIBRARIES_MAN_SECTION=@libraries_man_section@
### Do #! scripts work on your system?
### Beware: on some systems (e.g. SunOS 4), this will work only if
### the string "#!$(BINDIR)/ocamlrun" is less than 32 characters long.
### In doubt, set HASHBANGSCRIPTS to false.
HASHBANGSCRIPTS=true
#HASHBANGSCRIPTS=false
########## Configuration for the bytecode compiler
### Which C compiler to use for the bytecode interpreter.
### Performance of the bytecode interpreter is *much* improved
### if Gnu CC version 2 is used.
#BYTECC=gcc
#BYTECC=cc
### Additional compile-time options for $(BYTECC).
# If using gcc on Intel x86:
# (the -fno-defer-pop option circumvents a bug in certain versions of gcc)
#BYTECCCOMPOPTS=-fno-defer-pop -Wall
# If using gcc and being cautious:
#BYTECCCOMPOPTS=-Wall
# Otherwise:
#BYTECCCOMPOPTS=
### Additional link-time options for $(BYTECC)
HASHBANGSCRIPTS=@hashbangscripts@
### Path to the libtool script
LIBTOOL = $(TOP_BUILDDIR)/libtool
### Which C compiler to use
TOOLPREF=@ac_tool_prefix@
CC=@CC@
CC_HAS_DEBUG_PREFIX_MAP=@cc_has_debug_prefix_map@
AS_HAS_DEBUG_PREFIX_MAP=@as_has_debug_prefix_map@
### Additional link-time options
# To support dynamic loading of shared libraries (they need to look at
# our own symbols):
#BYTECCLINKOPTS=-Wl,-E
# Otherwise:
#BYTECCLINKOPTS=
### Libraries needed
# On most platforms:
#CCLIBS=-lcurses -ltermcap -lm
### How to invoke the C preprocessor
# This is not needed anymore. Leave these lines commented out.
# On most machines:
#CPP=/lib/cpp -P
# Under Solaris:
#CPP=/usr/ccs/lib/cpp -P
# Under FreeBSD:
#CPP=cpp -P
OC_LDFLAGS=@oc_ldflags@
### How to invoke ranlib
RANLIB=ranlib
RANLIBCMD=ranlib
### How to invoke the C preprocessor through the C compiler
CPP=@CPP@
# If ranlib is not needed:
#RANLIB=ar rs
#RANLIBCMD=
### How to invoke ranlib
RANLIB=@RANLIB@
RANLIBCMD=@RANLIBCMD@
### How to invoke ar
#ARCMD=ar
### Shared library support
# Extension for shared libraries: so if supported, a if not supported
#SO=so
#SO=a
# Set to nothing if shared libraries supported, and to -custom if not supported
#CUSTOM_IF_NOT_SHARED=
#CUSTOM_IF_NOT_SHARED=-custom
# Options to $(BYTECC) to produce shared objects (e.g. PIC)
#SHAREDCCCOMPOPTS=-fPIC
# How to build a shared library, invoked with output .so as first arg
# and object files as remaining args
#MKSHAREDLIB=gcc -shared -o
# Compile-time option to $(BYTECC) to add a directory to be searched
ARCMD=@AR@
### Extension of object files
O=@OBJEXT@
EXT_OBJ=.@OBJEXT@
### How to tell the C compiler to output an object file
OUTPUTOBJ=@outputobj@
### Extension of static libraries
A=@libext@
EXT_LIB=.@libext@
### Extension of assembler files
S=@S@
EXT_ASM=.@S@
### Extension for shared libraries
SO=@SO@
EXT_DLL=.@SO@
SHAREDLIB_CFLAGS=@sharedlib_cflags@
# Compile-time option to $(CC) to add a directory to be searched
# at run-time for shared libraries
#BYTECCRPATH=-Wl,-rpath
RPATH=@rpath@
############# Configuration for the native-code compiler
......@@ -107,16 +114,14 @@ RANLIBCMD=ranlib
### Currently supported:
###
### i386 Intel Pentium PCs under Linux, *BSD*, NextStep
### sparc Sun Sparcstation under SunOS 4.1 or Solaris 2
### power Macintosh under Mac OS X and Linux
### arm ARM under Linux
###
### Set ARCH=none if your machine is not supported
#ARCH=i386
#ARCH=sparc
#ARCH=power
#ARCH=arm
#ARCH=none
ARCH=@arch@
# Whether the architecture has 64 bits
ARCH64=@arch64@
### Name of architecture model for the native-code compiler.
### Some architectures come in several slightly different flavors
......@@ -127,52 +132,28 @@ RANLIBCMD=ranlib
### If ARCH=power: set MODEL=ppc
### For other architectures: leave MODEL=default
###
#MODEL=ppc
#MODEL=default
MODEL=@model@
### Name of operating system family for the native-code compiler.
#SYSTEM=solaris
#SYSTEM=linux
#SYSTEM=linux_elf
#SYSTEM=bsd
#SYSTEM=unknown
### Which C compiler to use for the native-code compiler.
#NATIVECC=cc
#NATIVECC=gcc
### Additional compile-time options for $(NATIVECC).
# For gcc if cautious:
#NATIVECCCOMPOPTS=-Wall
### Additional link-time options for $(NATIVECC)
#NATIVECCLINKOPTS=
# Compile-time option to $(NATIVECC) to add a directory to be searched
# at run-time for shared libraries
#NATIVECCRPATH=-Wl,-rpath
SYSTEM=@system@
### Command and flags to use for assembling ocamlopt-generated code
#ASM=as
ASM=@AS@
### Command and flags to use for assembling .S files (often with preprocessing)
# If gcc is available:
#ASPP=gcc -c
# On Solaris:
#ASPP=as -P
ASPP=@ASPP@
### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
INSTALL_BYTECODE_PROGRAMS=@install_bytecode_programs@
### Extra flags to use for assembling .S files in profiling mode
#ASPPPROFFLAGS=-DPROFILING
ASPPPROFFLAGS=@asppprofflags@
### Whether profiling with gprof is supported
# If yes: (e.g. x86/Linux, Sparc/Solaris):
#PROFILING=true
# If no:
#PROFILING=false
### true if profiling with gprof is supported, false otherwise
PROFILING=@profiling@
### Option to give to the C compiler for profiling
#CC_PROFILE=-pg
#CC_PROFILE=-xpg
CC_PROFILE=@cc_profile@
############# Configuration for the contributed libraries
......@@ -180,44 +161,130 @@ RANLIBCMD=ranlib
# Currently available:
# unix Unix system calls
# str Regular expressions and high-level string processing
# num Arbitrary-precision rational arithmetic
# threads Lightweight concurrent processes
# systhreads Same as threads, requires POSIX threads
# graph Portable drawing primitives for X11
# dynlink Dynamic linking of bytecode
# bigarray Large, multidimensional numerical arrays
OTHERLIBRARIES=unix str num threads graph dynlink bigarray
### Name of the target architecture for the "num" library
# Known targets:
# generic (portable C, works everywhere)
# ia32 (Intel x86)
# amd64 (AMD Opteron, Athlon64)
# ppc (Power PC)
# sparc
# If you don't know, leave BNG_ARCH=generic, which selects a portable
# C implementation of these routines.
BNG_ARCH=generic
BNG_ASM_LEVEL=1
OTHERLIBRARIES=@otherlibraries@
### Link-time options to ocamlc or ocamlopt for linking with POSIX threads
# Needed for the "systhreads" package
# Usually:
#PTHREAD_LINK=-cclib -lpthread
# For Solaris:
#PTHREAD_LINK=-cclib -lpthread -cclib -lposix4
PTHREAD_LINK=@pthread_link@
PTHREAD_CAML_LINK=$(addprefix -cclib ,$(PTHREAD_LINK))
### -I options for finding the X11/*.h includes
# Needed for the "graph" package
# Usually:
#X11_INCLUDES=-I/usr/X11R6/include
# For SunOS with OpenLook:
#X11_INCLUDES=/usr/openwin/include
X11_INCDDIR=@x_includes@
X11_INCLUDES=$(addprefix -I,$(X11_INCDDIR))
### Link-time options to ocamlc or ocamlopt for linking with X11 libraries
# Needed for the "graph" package
# Usually:
#X11_LINK=-lX11
# For SunOS with OpenLook:
#X11_LINK=-L$(X11_LIB) -lX11
X11_LINK=@x_libraries@
UNIX_OR_WIN32=@unix_or_win32@
UNIXLIB=@unixlib@
GRAPHLIB=@graphlib@
LIBBFD_LINK=@libbfd_link@
LIBBFD_INCLUDE=@libbfd_include@
INSTALL_SOURCE_ARTIFACTS=@install_source_artifacts@
OC_CFLAGS=@oc_cflags@
OC_CPPFLAGS=@oc_cppflags@
OCAMLC_CFLAGS=@ocamlc_cflags@
OCAMLC_CPPFLAGS=@ocamlc_cppflags@
BYTECCLIBS=@bytecclibs@
EXE=@exeext@
OUTPUTEXE=@outputexe@
SUPPORTS_SHARED_LIBRARIES=@supports_shared_libraries@
MKSHAREDLIBRPATH=@mksharedlibrpath@
DYNLINKOPTS=@DLLIBS@
NATDYNLINK=@natdynlink@
NATDYNLINKOPTS=@natdynlinkopts@
SYSLIB=@syslib@
MKLIB=@mklib@
OCAMLOPT_CFLAGS=@ocamlopt_cflags@
OCAMLOPT_CPPFLAGS=@ocamlopt_cppflags@
NATIVECCLIBS=@nativecclibs@
SYSTHREAD_SUPPORT=@systhread_support@
PACKLD=@PACKLD@
IFLEXDIR=@iflexdir@
EXTRALIBS=@extralibs@
CCOMPTYPE=@ccomptype@
TOOLCHAIN=@toolchain@
CMXS=@cmxs@
# On Windows, MKDLL, MKEXE and MKMAINDLL must ultimately be equivalent to
# $(FLEXLINK_CMD) $(FLEXLINK_FLAGS) [-exe|-maindll]
# or OCAML_FLEXLINK overriding will not work (see utils/config.mlp)
MKEXE=@mkexe@
MKDLL=@mksharedlib@
MKMAINDLL=@mkmaindll@
MKEXEDEBUGFLAG=@mkexedebugflag@
RUNTIMED=@debug_runtime@
RUNTIMEI=@instrumented_runtime@
WITH_DEBUGGER=@with_debugger@
WITH_CAMLTEX=@with_camltex@
WITH_OCAMLDOC=@ocamldoc@
ASM_CFI_SUPPORTED=@asm_cfi_supported@
WITH_FRAME_POINTERS=@frame_pointers@
WITH_SPACETIME=@spacetime@
ENABLE_CALL_COUNTS=@call_counts@
WITH_PROFINFO=@profinfo@
PROFINFO_WIDTH=@profinfo_width@
LIBUNWIND_AVAILABLE=@libunwind_available@
LIBUNWIND_INCLUDE_FLAGS=@libunwind_include_flags@
LIBUNWIND_LINK_FLAGS=@libunwind_link_flags@
WITH_FPIC=@fpic@
TARGET=@target@
HOST=@host@
FLAMBDA=@flambda@
WITH_FLAMBDA_INVARIANTS=@flambda_invariants@
FORCE_SAFE_STRING=@force_safe_string@
DEFAULT_SAFE_STRING=@default_safe_string@
WINDOWS_UNICODE=@windows_unicode@
AFL_INSTRUMENT=@afl@
MAX_TESTSUITE_DIR_RETRIES=@max_testsuite_dir_retries@
FLAT_FLOAT_ARRAY=@flat_float_array@
AWK=@AWK@
# The following variables were defined only in the config/Makefile.* files.
# They were not defined by the configure script used on Unix systems,
# so we also make sure to provide them only under Windows
# User code should absolutely not rely on their presence because
# in the future their definition may be moved to a more private part of
# the compiler's build system
ifeq "$(UNIX_OR_WIN32)" "win32"
DISTRIB=$(prefix)
OTOPDIR=$(WINTOPDIR)
CTOPDIR=$(WINTOPDIR)
CYGPATH=cygpath -m
DIFF=/usr/bin/diff -q --strip-trailing-cr
FIND=/usr/bin/find
SORT=/usr/bin/sort
SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
FLEXLINK_CMD=flexlink
MKEXE_ANSI=$(FLEXLINK) -exe
FLEXDLL_CHAIN=@flexdll_chain@
# FLEXLINK_FLAGS must be safe to insert in an OCaml string
# (see ocamlmklibconfig.ml in tools/Makefile)
FLEXLINK_FLAGS=@flexlink_flags@
FLEXLINK=$(FLEXLINK_CMD) $(FLEXLINK_FLAGS)
### Native command to build ocamlrun.exe
ifeq "$(TOOLCHAIN)" "mingw"
MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OC_LDFLAGS) $(OUTPUTEXE)$(1) $(2)
endif # ifeq "$(TOOLCHAIN)" "mingw"
ifeq "$(TOOLCHAIN)" "msvc"
MERGEMANIFESTEXE=test ! -f $(1).manifest \
|| mt -nologo -outputresource:$(1) -manifest $(1).manifest \
&& rm -f $(1).manifest
MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OUTPUTEXE)$(1) $(2) \
/link /subsystem:console $(OC_LDFLAGS) && ($(MERGEMANIFESTEXE))
endif # ifeq "$(TOOLCHAIN)" "msvc"
endif # ifeq "$(UNIX_OR_WIN32)" "win32"
#**************************************************************************
#* *
#* OCaml *
#* *
#* Gabriel Scherer, projet Parsifal, INRIA Saclay *
#* *
#* Copyright 2018 Institut National de Recherche en Informatique et *
#* en Automatique. *
#* *
#* 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. *
#* *
#**************************************************************************
# The rules in this Makefile use Menhir to rebuild the OCaml compiler
# parser. They are included in the main Makefile, so should be invoked
# directly, for example 'make promote-menhir'. They must be called
# after any modification to parsing/parser.mly, for the modification
# to affect the parser linked in the produced compiler:
#
# - promote-menhir builds the parser from parser.mly and stores it in
# the boot/ directory, so that future builds of the compiler use the
# updated result. Use it to make permanent changes to the compiler
# parser.
#
# - demote-menhir undoes the effect of promote-menhir. The files in
# the boot/ directory that are affected by promote-menhir and are
# under version control are restored to their normal state (HEAD).
#
# - test-menhir builds the parser from parser.mly without storing it
# in the boot/ directory, and only checks that the generated parser
# builds correctly. Use it to quickly check if a parser.mly change
# breaks the build. If you want to test a compiler produced with
# the new parser, you must use promote-menhir instead.
# (Using this rule requires a partial compiler build as obtained
# by 'make core' or 'make world'.)
#
# - clean-menhir removes the files generated by Menhir from parsing/,
# keeping only the reference sources for the grammar.
#
# - depend-menhir updates the dependency information for the
# Menhir-generated parser, which is versioned in the OCaml repository
# like all other .depend files. It should be used when the dependencies
# (of the OCaml code in the grammar semantic actions) change.
MENHIR ?= menhir
## Unused tokens
# tokens COMMENT, DOCSTRING and EOL are produced by special lexer
# modes used by other consumers than the parser.
# GREATERBRACKET ">]" was added by the parser by symmetry with "[<"
# (which is used in polymorphic variant), but is not currently used by
# the grammar.
unused_tokens := COMMENT DOCSTRING EOL GREATERRBRACKET
## Menhir compilation flags
MENHIRFLAGS := --explain --dump --ocamlc "$(CAMLC) $(COMPFLAGS)" --infer \
--lalr --strict --table -lg 1 -la 1 \
$(addprefix --unused-token ,$(unused_tokens)) --fixed-exception
## promote-menhir
.PHONY: promote-menhir
promote-menhir: parsing/parser.mly
@ $(MAKE) import-menhirLib
$(MENHIR) $(MENHIRFLAGS) parsing/parser.mly
# The generated parser.ml may contain lexer directives containing
# the absolute path to Menhir's standard library on the promoter's machine.
# This is benign but will generate pointless churn if another developer
# rebuilds the same grammar (from the same Menhir version).
@ for f in $(addprefix parser.,ml mli) ; do \
sed \
's,^#\(.*\)"[^"]*/menhir/standard.mly",#\1"menhir/standard.mly",g' \
parsing/$$f \
> boot/menhir/$$f; \
rm parsing/$$f; \
done
# The import-menhirLib invocation in promote-menhir ensures that each
# update of the boot/ parser is paired with an update of the imported
# menhirLib; otherwise it would be easy to generate a parser and keep
# an incompatible version of menhirLib, which would fail at
# compile-time.
.PHONY: import-menhirLib
import-menhirLib:
@ mkdir -p boot/menhir
@ cp \
$(addprefix `$(MENHIR) --suggest-menhirLib`/menhirLib.,ml mli) \
boot/menhir
## demote-menhir
DEMOTE:=menhirLib.ml menhirLib.mli parser.ml parser.mli
.PHONY: demote-menhir
demote-menhir:
git checkout HEAD -- $(addprefix boot/menhir/,$(DEMOTE))
## test-menhir
# This rule assumes that the `parsing/` sources and its dependencies
# have already been compiled; 'make core' suffices to be in that
# state. We don't make 'core' an explicit dependency, as building
# 'test-menhir' repeatedly would rebuild the compiler each time
# (parser.ml has changed), without actually taking the changes from
# parser.mly into account ('core' uses the parser from boot/).
# The test-menhir target does not read or write the boot directory,
# it directly builds the parser in parsing/. In particular, it must
# duplicate the MenhirLib->CamlinternalMenhirlib renaming usually
# performed by the parsing/parser.ml import rule in the main
# Makefile.
.PHONY: test-menhir
test-menhir: parsing/parser.mly
$(MENHIR) $(MENHIRFLAGS) parsing/parser.mly
for f in $(addprefix parsing/parser.,ml mli) ; do \
cat $$f | sed "s/MenhirLib/CamlinternalMenhirLib/g" > $$f.tmp && \
mv $$f.tmp $$f ; \
done
$(MAKE) parsing/parser.cmo
## clean-menhir
partialclean-menhir::
rm -f \
$(addprefix parsing/parser.,ml mli) \
$(addprefix parsing/camlinternalMenhirLib.,ml mli)
clean-menhir: partialclean-menhir
## depend-menhir
.PHONY: depend-menhir
depend-menhir:
$(MENHIR) --depend --ocamldep "$(CAMLDEP) $(DEPFLAGS) $(DEPINCLUDES)" \
parsing/parser.mly > .depend.menhir
# this rule depends on the variables CAMLDEP, DEPFLAGS, DEPINCLUDES
# defined in Makefile, so it can only be invoked from the main Makefile
include .depend.menhir
## interpret-menhir
# This rule runs Menhir in interactive mode.
# The user can enter sentences, such as:
# implementation: TYPE LIDENT EQUAL LIDENT EOF
# and see how Menhir interprets them.
interpret-menhir:
@ echo "Please wait, I am building the LALR automaton..."
@ $(MENHIR) $(MENHIRFLAGS) parsing/parser.mly \
--interpret \
--interpret-show-cst \
--trace \
......@@ -33,7 +33,7 @@ DIFF=diff -q
SORT=sort
SET_LD_PATH=CAML_LD_LIBRARY_PATH="$(LD_PATH)"
# The variables above may be overridden by .../config/Makefile
# The variables above may be overridden by .../Makefile.config
# OTOPDIR is either TOPDIR or WINTOPDIR, whichever is appropriate for
# arguments given to the OCaml compiler.
# CTOPDIR is either TOPDIR or WINTOPDIR, whichever is appropriate for
......@@ -48,7 +48,7 @@ SET_LD_PATH=CAML_LD_LIBRARY_PATH="$(LD_PATH)"
# variable. Note that for Windows we add Unix-syntax directory names in
# PATH, and Cygwin will translate it to Windows syntax.
include $(TOPDIR)/config/Makefile
include $(TOPDIR)/Makefile.config
ifneq ($(USE_RUNTIME),)
#Check USE_RUNTIME value
......@@ -57,12 +57,12 @@ $(error If set, USE_RUNTIME must be equal to "d" (debug runtime) \
or "i" (instrumented runtime))
endif
RUNTIME_VARIANT=-I $(OTOPDIR)/asmrun -I $(OTOPDIR)/byterun \
RUNTIME_VARIANT=-I $(OTOPDIR)/runtime \
-runtime-variant $(USE_RUNTIME)
export OCAMLRUNPARAM?=v=0
endif
OCAMLRUN=$(TOPDIR)/byterun/ocamlrun$(USE_RUNTIME)$(EXE)
OCAMLRUN=$(TOPDIR)/runtime/ocamlrun$(USE_RUNTIME)$(EXE)
OCFLAGS=-nostdlib -I $(OTOPDIR)/stdlib $(COMPFLAGS)
OCOPTFLAGS=
......@@ -74,7 +74,6 @@ else
endif
OCAML=$(OCAMLRUN) $(OTOPDIR)/ocaml $(OCFLAGS) -noinit
EXPECT_TEST=$(OCAMLRUN) $(OTOPDIR)/testsuite/tools/expect_test$(EXE)
ifeq "$(FLEXLINK)" ""
FLEXLINK_PREFIX=
else
......@@ -93,9 +92,9 @@ OCAMLOPT=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/ocamlopt $(OCFLAGS) \
OCAMLDOC=$(OCAMLRUN) $(OTOPDIR)/ocamldoc/ocamldoc
OCAMLLEX=$(OCAMLRUN) $(OTOPDIR)/lex/ocamllex
OCAMLMKLIB=$(FLEXLINK_PREFIX)$(OCAMLRUN) $(OTOPDIR)/tools/ocamlmklib \
-ocamlc "$(OTOPDIR)/byterun/ocamlrun$(USE_RUNTIME)$(EXE) \
-ocamlc "$(OTOPDIR)/runtime/ocamlrun$(USE_RUNTIME)$(EXE) \
$(OTOPDIR)/ocamlc $(OCFLAGS) $(RUNTIME_VARIANT)" \
-ocamlopt "$(OTOPDIR)/byterun/ocamlrun$(USE_RUNTIME)$(EXE) \
-ocamlopt "$(OTOPDIR)/runtime/ocamlrun$(USE_RUNTIME)$(EXE) \
$(OTOPDIR)/ocamlopt $(OCFLAGS) $(RUNTIME_VARIANT)"
OCAMLYACC=$(TOPDIR)/yacc/ocamlyacc$(EXE)
DUMPOBJ=$(OCAMLRUN) $(OTOPDIR)/tools/dumpobj
......
OCaml 4.07.1 (4 October 2018)
-----------------------------
This release consists mostly of bug fixes. The most salient bugs were
- MPR#7820, GPR#1897: a bug in Array.of_seq (new in 4.07)
(Thierry Martinez, review by Nicolás Ojeda Bär)
- MPR#7815, GPR#1896: crash in the major GC with the first-fit policy
(Stephen Dolan and Damien Doligez, report by Joris Giovannangeli)
- MPR#7821, GPR#1908: the compiler loads more cmi, which breaks some builds
(Jérémie Dimino, review by Gabriel Scherer)
- MPR#7833, GPR#1946: typechecking failure (regression) on large GADT matchings
(Thomas Refis, report by Jerome Simeon, review by Jacques Garrigue)
See the detailed list of fixes at (Changes#4.07.1).
OCaml 4.07.0 (10 July 2018):
----------------------------
Some highlights of this release are:
- The way the standard library modules are organized internally has
changed (GPR#1010, by Jérémie Dimino):
1. the `List` module (for example) is now named `Stdlib__list`
2. a new Stdlib module contains a series of aliases
such as `module List = Stdlib__list`
3. the `Stdlib` module is implicitly opened when type-checking OCaml
programs (as `Pervasives` previously was), so that `Stdlib.List` can be
accessed as just `List`, as before.
This should be invisible to most users, although it is possible that
some tools show the `Stdlib.` or `Stdlib__` prefixes in
messages. (You might want to report these situations as usability
bugs.) The change prevents standard library modules from conflicting
with end-user filenames (please avoid `stdlib.ml` and the
`Stdlib__` prefix); we may introduce new standard library modules in
the future with less fear of breaking user code. In particular,
`Float` (GPR#1638, by Nicolás Ojeda Bär) and `Seq` (GPR#1002, by
Simon Cruanes) modules have now been added to the standard library.
- The error messages caused by various typing errors have been improved
to be easier to understand, in particular for beginners.
(GPR#1505, GPR#1510, by Arthur Charguéreau and Armaël Guéneau)
For example,
# while 1 do () done;;
^
Error: This expression has type int but
an expression was expected of type bool
now adds the extra explanation
because it is in the condition of a while-loop
- Effort has been made to reduce the compilation time of flambda
programs, and the size of the produced `.cmx` files when using
the -Oclassic optimisation level.
(GPR#1401, GPR#1455, GPR#1627, GPR#1665, by Pierre Chambart, Xavier
Clerc, Fuyong Quah, and Leo White)
- The HTML manual has benefited from various style improvements
and should look visually nicer than previous editions.
(GPR#1741, GPR#1757, GPR#1767 by Charles Chamberlain and steinuil)
The new version of the manual can be consulted at
<http://caml.inria.fr/pub/docs/manual-ocaml-4.07/>; see the
previous version for comparison at
<http://caml.inria.fr/pub/docs/manual-ocaml-4.06/>.
- Since 4.01, it is possible to select a variant constructor or
record field from a sub-module that is not opened in the current
scope, if type information is available at the point of use. This
now also works for GADT constructors.
(GPR#1648, by Thomas Refis and Leo White)
- The GC should handle the accumulation of custom blocks in the minor
heap better; this solves some memory-usage issues observed by code
which allocates a lot of small custom blocks, typically small bigarrays
(GPR#1476, by Alain Frsich)
See also the detailed list of changes: (Changes#4.07.0).
OCaml 4.06.1 (16 Feb 2018):
---------------------------
This release consists mostly of bug fixes. The most salient bugs were
- An incorrect compilation of pattern-matching in presence of
extensible variant constructors (such as exceptions), that had been
present for a long time.
(GPR#1459, GPR#1538, by Luc Maranget, Thomas Refis and Gabriel Scherer)
- An optimization of `not (x = y)` into `x <> y`, introduced in
4.06.0, is incorrect on floating-point numbers in the `nan`
case. (GPR#1470, by Leo White)
See the detailed list of fixes at (Changes#4.06.1).
OCaml 4.06.0 (3 Nov 2017):
--------------------------
- Strings (type `string`) are now immutable by default. In-place
modification must use the type `bytes` of byte sequences, which is
distinct from `string`. This corresponds to the `-safe-string`
compile-time option, which was introduced in OCaml 4.02 in 2014, and
which is now the default.
(GPR#1252, by Damien Doligez)
- Object types can now extend a previously-defined object type,
as in `<t; a: int>`.
(GPR#1118, by Runhang Li)
- Destructive substitution over module signatures can now express more
substitutions, such as `S with type M.t := type-expr` and `S with
module M.N := path`.
(GPR#792, by Valentin Gatien-Baron)
- Users can now define operators that look like array indexing,
e.g. `let ( .%() ) = List.nth in [0; 1; 2].%(1)`
(GPR#1064, GPR#1392, by Florian Angeletti)
- New escape `\u{XXXX}` in string literals, denoting the UTF-8
encoding of the Unicode code point `XXXX`.
(GPR#1232, by Daniel Bünzli)
- Full Unicode support was added to the Windows runtime system. In
particular, file names can now contain Unicode characters.
(GPR#153, GPR#1200, GPR#1357, GPR#1362, GPR#1363, GPR#1369, GPR#1398,
GPR#1446, GPR#1448, by ygrek and Nicolás Ojeda Bär)
- An alternate register allocator based on linear scan can be selected
with `ocamlopt -linscan`. It reduces compilation time compared with
the default register allocator.
(GPR#375, Marcell Fischbach and Benedikt Meurer)
- The Num library for arbitrary-precision integer and rational
arithmetic is no longer part of the core distribution and can be
found as a separate OPAM package.
See the detailed list of changes: (Changes#4.06.0).
OCaml 4.05.0 (13 Jul 2017):
---------------------------
Some highlights include:
- Instrumentation support for fuzzing with afl-fuzz.
(GPR#504, by Stephen Dolan)
- The compilers now accept new `-args/-args0 <file>` comand-line
parameters to provide extra command-line arguments in a file. User
programs may implement similar options using the new `Expand`
constructor of the `Arg` module.
(GPR#748, GPR#843, GPR#864, by Bernhard Schommer)
- Many functions of the standard library that raise an exception now
have an option-returning variable suffixed by `_opt` Typical
examples of the new functions include:
int_of_string_opt: string -> int option
List.nth_opt: 'a list -> int -> 'a option
Hashtbl.find_opt : ('a, 'b) t -> 'a -> 'b option
(GPR#885, by Alain Frisch)
- The security of the runtime system is now hardened by using `secure_getenv`
to access environment variables whenever its possible, to avoid unplanned
privilege-escalation when running setuid binaries.
(GPR#1213, by Damien Doligez)
See the detailed list of changes: (Changes#4.05.0).
|=====
| Branch `trunk` | Branch `4.06` | Branch `4.05` | Branch `4.04`
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=trunk["TravisCI Build Status (trunk branch)",
link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=trunk&svg=true["AppVeyor Build Status (trunk branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.06["TravisCI Build Status (4.06 branch)",
link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.06&svg=true["AppVeyor Build Status (4.06 branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.05["TravisCI Build Status (4.05 branch)",
link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.05&svg=true["AppVeyor Build Status (4.05 branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]
| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.04["TravisCI Build Status (4.04 branch)",
link="https://travis-ci.org/ocaml/ocaml"]
image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.04&svg=true["AppVeyor Build Status (4.04 branch)",
link="https://ci.appveyor.com/project/avsm/ocaml"]
|=====
= README =
== Overview
......@@ -33,7 +55,6 @@ AMD64:: FreeBSD, OpenBSD, NetBSD
IA32 (Pentium):: NetBSD, OpenBSD, Solaris 9
PowerPC:: NetBSD
ARM:: NetBSD
SPARC:: Solaris, Linux, NetBSD
Other operating systems for the processors above have not been tested, but
the compiler may work under other operating systems with little work.
......@@ -62,45 +83,37 @@ Windows, see link:README.win32.adoc[].
The OCaml manual is distributed in HTML, PDF, Postscript, DVI, and Emacs
Info files. It is available at
http://caml.inria.fr/
The community also maintains the Web site http://ocaml.org, with tutorials
and other useful information for OCaml users.
http://caml.inria.fr/pub/docs/manual-ocaml/
== Availability
The complete OCaml distribution can be accessed at
http://caml.inria.fr/
http://ocaml.org/docs/install.html
== Keeping in Touch with the Caml Community
There exists a mailing list of users of the OCaml implementations developed
at INRIA. The purpose of this list is to share experience, exchange ideas
(and even code), and report on applications of the OCaml language. Messages
can be written in English or in French. The list has more than 1000
subscribers.
Messages to the list should be sent to:
The OCaml mailing list is the longest-running forum for OCaml users.
You can email it at
mailto:caml-list@inria.fr[]
You can subscribe to this list via the Web interface at
You can subscribe and access list archives via the Web interface at
https://sympa.inria.fr/sympa/subscribe/caml-list
Archives of the list are available on the Web site above.
You can also access a newer discussion forum at
The Usenet news `groups comp.lang.ml` and `comp.lang.functional` also
contains discussions about the ML family of programming languages, including
OCaml.
https://discuss.ocaml.org/
The IRC channel `#ocaml` on https://freenode.net/[Freenode] also has several
hundred users and welcomes questions.
There also exist other mailing lists, chat channels, and various other forums
around the internet for getting in touch with the OCaml and ML family language
community. These can be accessed at
The OCaml Community website is
http://ocaml.org/community/
http://ocaml.org/
In particular, the IRC channel `#ocaml` on https://freenode.net/[Freenode] has a
long history and welcomes questions.
== Bug Reports and User Feedback
......
......@@ -73,9 +73,10 @@ https://github.com/alainfrisch/flexdll. A binary distribution is available;
instructions on how to build FlexDLL from sources, including how to bootstrap
FlexDLL and OCaml are given <<seflexdll,later in this document>>. Unless you
bootstrap FlexDLL, you will need to ensure that the directory to which you
install FlexDLL is included in your `PATH` environment variable. Note: if you
use Visual Studio 2015 or Visual Studio 2017, the binary distribution of
FlexDLL will not work and you must build it from sources.
install FlexDLL is included in your `PATH` environment variable. Note: binary
distributions of FlexDLL are compatible only with Visual Studio 2013 and
earlier; for Visual Studio 2015 and later, you will need to compile the C
objects from source, or build ocaml using the flexdll target.
The base bytecode system (ocamlc, ocaml, ocamllex, ocamlyacc, ...) of all three
ports runs without any additional tools.
......@@ -91,17 +92,17 @@ C code (`ocamlc -custom`) require a Microsoft Visual C/C++ Compiler and the
Any edition (including Express/Community editions) of Microsoft Visual Studio
2005 or later may be used to provide the required Windows headers and the C
compiler. Additionally, some older Microsoft Windows SDKs include the
Visual C/C++ Compiler.
Visual C/C++ Compiler as well as the Build Tools for Visual Studio.
|=====
| | `cl` Version | Express | SDK
| | `cl` Version | Express | SDK/Build Tools
| Visual Studio 2005 | 14.00.x.x | 32-bit only <<vs1,(*)>> |
| Visual Studio 2008 | 15.00.x.x | 32-bit only | Windows SDK 7.0 also provides 32/64-bit compilers
| Visual Studio 2010 | 16.00.x.x | 32-bit only | Windows SDK 7.1 also provides 32/64-bit compilers
| Visual Studio 2012 | 17.00.x.x | 32/64-bit |
| Visual Studio 2013 | 18.00.x.x | 32/64-bit |
| Visual Studio 2015 | 19.00.x.x | 32/64-bit |
| Visual Studio 2017 | 19.10.x.x | 32/64-bit |
| Visual Studio 2015 | 19.00.x.x | 32/64-bit | Build Tools for Visual Studio 2015 also provides 32/64-bit compilers
| Visual Studio 2017 | 19.10.x.x | 32/64-bit | Build Tools for Visual Studio 2017 also provides 32/64-bit compilers
|=====
[[vs1]]
......@@ -158,6 +159,9 @@ indicate if they are the "Native Tools" or "Cross Tools" versions. Visual Studio
2015 and 2017 make the shortcuts even clearer by including the full name of the
architecture.
The Build Tools for Visual Studio 2015 and 2017 provide shortcuts similar to
the ones of their respective Visual Studio version.
You cannot at present use a cross-compiler to compile 64-bit OCaml on 32-bit
Windows.
......@@ -187,29 +191,25 @@ the top-level of the OCaml distribution by running:
eval $(tools/msvs-promote-path)
If you forget to do this, `make world` will fail relatively
If you forget to do this, `make world.opt` will fail relatively
quickly as it will be unable to link `ocamlrun`.
Now run:
cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h
followed by:
cp config/Makefile.msvc config/Makefile
./configure --build=i686-pc-cygwin --host=i686-pc-windows
for 32-bit, or:
cp config/Makefile.msvc64 config/Makefile
./configure --build=x86_64-unknown-cygwin --host=x86_64-pc-windows
for 64-bit. Then, edit `config/Makefile` as needed, following the comments in
for 64-bit. Then, edit `Makefile.config` as needed, following the comments in
this file. Normally, the only variable that needs to be changed is `PREFIX`,
which indicates where to install everything.
Finally, use `make` to build the system, e.g.
make world bootstrap opt opt.opt install
make world.opt
make install
After installing, it is not necessary to keep the Cygwin installation (although
you may require it to build additional third party libraries and tools). You
......@@ -222,7 +222,7 @@ like to copy the `tools/msvs-promote-path` script and add the `eval` line to
your `~/.bashrc` file.
* The Microsoft Visual C/C++ compiler does not implement "computed gotos", and
therefore generates inefficient code for `byterun/interp.c`. Consequently,
therefore generates inefficient code for `runtime/interp.c`. Consequently,
the performance of bytecode programs is about 2/3 of that obtained under
Unix/GCC, Cygwin or Mingw-w64 on similar hardware.
......@@ -263,24 +263,20 @@ the WinZip Options Window.)
Now run:
cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h
followed by:
cp config/Makefile.mingw config/Makefile
./configure --build=i686-pc-cygwin --host=i686-w64-mingw32
for 32-bit, or:
cp config/Makefile.mingw64 config/Makefile
./configure --build=x86_64-unknown-cygwin --host=x86_64-w64-mingw32
for 64-bit. Then, edit `config/Makefile` as needed, following the comments in
for 64-bit. Then, edit `Makefile.config` as needed, following the comments in
this file. Normally, the only variable that needs to be changed is `PREFIX`,
which indicates where to install everything.
Finally, use `make` to build the system, e.g.
make world bootstrap opt opt.opt install
make world.opt
make install
After installing, you will need to ensure that `ocamlopt` (or `ocamlc -custom`)
can access the C compiler. You can do this either by using OCaml from Cygwin's
......@@ -291,12 +287,6 @@ bash or by adding Cygwin's bin directory (e.g. `C:\cygwin\bin`) to your `PATH`.
* The replay debugger is partially supported (no reverse execution).
* The default `config/Makefile.mingw` and `config/Makefile.mingw64` pass
`-static-libgcc` to the linker. For more information on this topic:
- http://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/Link-Options.html#Link-Options
- http://caml.inria.fr/mantis/view.php?id=6411
[[seflexdll]]
== FlexDLL
Although the core of FlexDLL is necessarily written in C, the `flexlink` program
......@@ -326,12 +316,16 @@ done in one of three ways:
OCaml is then compiled as normal for the port you require, except that before
compiling `world`, you must compile `flexdll`, i.e.:
make flexdll world [bootstrap] opt opt.opt install
make flexdll
make world.opt
make flexlink.opt
make install
* You should ignore the error messages that say ocamlopt was not found.
* `make install` will install FlexDLL by placing `flexlink.exe`
(and the default manifest file for the Microsoft port) in `bin/` and the
FlexDLL object files in `lib/`.
* If you don't include `make opt.opt`, `flexlink.exe` will be a
* If you don't include `make flexlink.opt`, `flexlink.exe` will be a
bytecode program. `make install` always installs the "best"
`flexlink.exe` (i.e. there is never a `flexlink.opt.exe` installed).
* If you have populated `flexdll/`, you *must* run
......@@ -339,6 +333,55 @@ compiling `world`, you must compile `flexdll`, i.e.:
installed FlexDLL, you must erase the contents of `flexdll/` before
compiling.
== Unicode support
Prior to version 4.06, all filenames on the OCaml side were assumed
to be encoded using the current 8-bit code page of the system. Some
Unicode filenames could thus not be represented. Since version 4.06,
OCaml adds to this legacy mode a new "Unicode" mode, where filenames
are UTF-8 encoded strings. In addition to filenames,
this applies to environment variables and command-line arguments.
The mode must be decided before building the system, by tweaking
the `WINDOWS_UNICODE` variable in `Makefile.config`. A value of 1
enables the the new "Unicode" mode, while a value of 0 maintains
the legacy mode.
Technically, both modes use the Windows "wide" API, where filenames
and other strings are made of 16-bit entities, usually interpreted as
UTF-16 encoded strings.
Some more details about the two modes:
* Unicode mode: OCaml strings are interpreted as being UTF-8 encoded
and translated to UTF-16 when calling Windows; strings returned by
Windows are interpreted as UTF-16 and translated to UTF-8 on their
way back to OCaml. Additionally, an OCaml string which is not
valid UTF-8 will be interpreted as being in the current 8-bit code
page. This fallback works well in practice, since the chances of
non-ASCII string encoded in the a 8-bit code page to be a valid
UTF-8 string are tiny. This means that filenames
obtained from e.g. a 8-bit UI or database layer would continue to
work fine. Application written for the legacy mode or older
versions of OCaml might still break if strings returned by
Windows (e.g. for `Sys.readdir`) are sent to components expecting
strings encoded in the current code page.
* Legacy mode: this mode emulates closely the behavior of OCaml <
4.06 and is thus the safest choice in terms of backward
compatibility. In this mode, OCaml programs can only work with
filenames that can be encoded in the current code page, and the
same applies to ocaml tools themselves (ocamlc, ocamlopt, etc).
The legacy mode will be deprecated and then removed in future versions
of OCaml. Users are thus strongly encouraged to use the Unicode mode
and adapt their existing code bases accordingly.
Note: in order for ocaml tools to support Unicode pathnames, it is
necessary to use a version of FlexDLL which has itself been compiled
with OCaml >= 4.06 in Unicode mode. This is the case for binary distributions
of FlexDLL starting from version 0.37 and above.
== Trademarks
Microsoft, Visual C++, Visual Studio and Windows are registered trademarks of
......