let mk_virtual_solvers =
let dir = Ocamlbuild_where.bindir in
List.iter begin fun cmd ->
let opt = cmd ^ ".opt" in
let a_opt = A opt in
let a_cmd = A cmd in
let search_in_path = memo Command.search_in_path in
let solver () =
if sys_file_exists !dir then
let long = filename_concat !dir cmd in
let long_opt = long ^ ".opt" in
if sys_file_exists long_opt then A long_opt
else if sys_file_exists long then A long
else try let _ = search_in_path opt in a_opt
with Not_found -> a_cmd
else
try let _ = search_in_path opt in a_opt
with Not_found -> a_cmd
in Command.setup_virtual_command_solver (String.uppercase cmd) solver
end