Don't recognize directories as libraries. eg. If we have system libvirt and OCaml bindings in $OCAML_LIB_DIR/libvirt, then we don't want '-lvirt' to "discover" the OCaml bindings directory. diff -ur flexdll/reloc.ml flexdll.mingw/reloc.ml --- flexdll/reloc.ml 2008-11-16 18:41:01.000000000 +0000 +++ flexdll.mingw/reloc.ml 2008-11-16 18:39:18.000000000 +0000 @@ -109,7 +109,7 @@ Filename.dirname (get_output1 (Printf.sprintf "i686-pc-mingw32-gcc %s-print-libgcc-file-name" extra)) let file_exists fn = - if Sys.file_exists fn then Some fn + if Sys.file_exists fn && not (Sys.is_directory fn) then Some fn else if !use_cygpath && Sys.file_exists (fn ^ ".lnk") then Some (get_output1 (Printf.sprintf "cygpath -m %s" fn)) else None