Skip to content

Commit

Permalink
Hack through support for new layout
Browse files Browse the repository at this point in the history
- Fallback to pkgconf needs to be done in a more principled manner,
  possibly actually checking the opam environment for os-distribution?
  Basically, with upstream opam-repository we should _never_ use
  pkg-config, but this needs done without regressing OCaml for Windows
  where we _must_ use pkg-config (which has been shim'd)
- Need to check the implications for MSYS2

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
  • Loading branch information
dra27 committed May 12, 2024
1 parent c28817c commit fd003a0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions otherlibs/configurator/src/v1.ml
Original file line number Diff line number Diff line change
Expand Up @@ -656,12 +656,18 @@ module Pkg_config = struct
let pkg_config_exe_name =
match Sys.getenv "PKG_CONFIG" with
| s -> s
| exception Not_found -> "pkg-config"
| exception Not_found -> "pkgconf"
in
let pkg_config_args =
match ocaml_config_var c "system" with
| Some "mingw64" -> ["--personality=x86_64-w64-mingw32"]
| Some "mingw" -> ["--personality=i686-w64-mingw32"]
| _ -> []
in
let pkg_config_args =
match Sys.getenv "PKG_CONFIG_ARGN" with
| s -> String.split ~on:' ' s
| exception Not_found -> []
| s -> pkg_config_args @ String.split ~on:' ' s
| exception Not_found -> pkg_config_args
in
Option.map (which c pkg_config_exe_name) ~f:(fun pkg_config ->
{ pkg_config; pkg_config_args; configurator = c })
Expand Down

0 comments on commit fd003a0

Please sign in to comment.