mirleft / ocaml-nocrypto

OCaml cryptographic library
ISC License
112 stars 52 forks source link

Look for CFLAGS when building with dune #160

Open ulrikstrid opened 5 years ago

ulrikstrid commented 5 years ago

Look for CFLAGS and apply them if they exist. The reason I need this is because Windows doesn't supply endian.h so I want to supply it myself.

XVilka commented 5 years ago

Fails with OCaml 4.03 and 4.04

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+ /home/travis/.opam/opam-init/hooks/sandbox.sh "build" "dune" "subst" (CWD=/home/travis/.opam/ocaml-base-compiler.4.04.2/.opam-switch/build/nocrypto.0.5.4-1)
+ /home/travis/.opam/opam-init/hooks/sandbox.sh "build" "dune" "build" "-p" "nocrypto" "-j" "1" (CWD=/home/travis/.opam/ocaml-base-compiler.4.04.2/.opam-switch/build/nocrypto.0.5.4-1)
-       ocamlc config/.cfg.eobjs/byte/cfg.{cmi,cmo,cmt} (exit 2)
- (cd _build/default && /home/travis/.opam/ocaml-base-compiler.4.04.2/bin/ocamlc.opt -w -40 -g -bin-annot -I config/.cfg.eobjs/byte -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/cpuid -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/dune/_caml -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/dune/_dune_lang -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/dune/_ocaml_config -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/dune/_result -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/dune/_stdune -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/dune/configurator -no-alias-deps -o config/.cfg.eobjs/byte/cfg.cmo -c -impl config/cfg.ml)
- File "config/cfg.ml", line 12, characters 21-35:
- Error: Unbound value Sys.getenv_opt
[ERROR] The compilation of nocrypto failed at
        "/home/travis/.opam/opam-init/hooks/sandbox.sh build dune build -p
        nocrypto -j 1".

#=== ERROR while compiling nocrypto.0.5.4-1 ===================================#
# context     2.0.3 | linux/x86_64 | ocaml-base-compiler.4.04.2 | pinned(file:///home/travis/build/mirleft/ocaml-nocrypto)
# path        ~/.opam/ocaml-base-compiler.4.04.2/.opam-switch/build/nocrypto.0.5.4-1
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p nocrypto -j 1
# exit-code   1
# env-file    ~/.opam/log/nocrypto-26138-ffb3fd.env
# output-file ~/.opam/log/nocrypto-26138-ffb3fd.out
### output ###
#       ocamlc config/.cfg.eobjs/byte/cfg.{cmi,cmo,cmt} (exit 2)
# (cd _build/default && /home/travis/.opam/ocaml-base-compiler.4.04.2/bin/ocamlc.opt -w -40 -g -bin-annot -I config/.cfg.eobjs/byte -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/cpuid -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/dune/_caml -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/dune/_dune_lang -I /home/travis/.opam/ocaml-base-compiler.4.04.2/lib/dune/_ocaml_config -[...]
# File "config/cfg.ml", line 12, characters 21-35:
# Error: Unbound value Sys.getenv_opt