Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- Honor the `OCAML`, `OCAMLC`, `OCAMLOPT`, `OCAMLMKLIB`, `OCAMLDEP` and `OCAMLDOC` environment variables in configure, so a cross build can supply its own toolchain.
- Do not build `zarith.cmxs` when the compiler reports no shared-library support (e.g. a freestanding/static cross target), gating on `ocamlopt -config` rather than the mere presence of `dynlink.cmxa`.
- #167: Add `Z.to_bytes` and `Z.of_bytes` to convert between integers and byte sequences, with control of byte size and endianness.
- Make unmarshaling of big integers more resistant to corrupted serialized data, on OCaml 5.4.1 and later.
- Drop support for OCaml 4.07. OPAM only supports OCaml >= 4.08 now, and probably >= 4.11 soon.
Expand Down
22 changes: 13 additions & 9 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ ocamllibdir='auto'
gmp='auto'
perf='no'

ocaml='ocaml'
ocamlc='ocamlc'
ocamlopt='ocamlopt'
ocamlmklib='ocamlmklib'
ocamldep='ocamldep'
ocamldoc='ocamldoc'
ocaml="${OCAML:-ocaml}"
ocamlc="${OCAMLC:-ocamlc}"
ocamlopt="${OCAMLOPT:-ocamlopt}"
ocamlmklib="${OCAMLMKLIB:-ocamlmklib}"
ocamldep="${OCAMLDEP:-ocamldep}"
ocamldoc="${OCAMLDOC:-ocamldoc}"
ccinc="$CPPFLAGS"
ldflags="$LDFLAGS"
cclib=''
Expand Down Expand Up @@ -254,7 +254,7 @@ fi
# directories

if test "$ocamllibdir" = "auto"
then ocamllibdir="$(ocamlc -where | tr -d '\r')"
then ocamllibdir="$($ocamlc -where | tr -d '\r')"
fi

if test ! -f "$ocamllibdir/caml/mlvalues.h"
Expand All @@ -268,7 +268,11 @@ if test $? -eq 0; then echo "cannot include caml/mlvalues.h"; exit 2; fi

hasdynlink='no'

if test $hasocamlopt = yes
# A static/freestanding cross target has no shared libraries but still ships
# dynlink.cmxa, so gate on the compiler's report instead.
if test $hasocamlopt = yes \
&& $ocamlopt -config 2>/dev/null \
| grep -q '^supports_shared_libraries: *true'
then
checkcmxalib dynlink.cmxa
if test $? -eq 1; then hasdynlink='yes'; fi
Expand Down Expand Up @@ -335,7 +339,7 @@ if test "$gmp" != 'OK'; then echo "cannot find GMP nor MPIR"; exit 2; fi

# OCaml version

ocamlver="$(ocamlc -version)"
ocamlver="$($ocamlc -version)"

# OCaml version 4.08 or later is required

Expand Down
Loading