diff --combined ocaml/flexdll/cmdline.ml index eccd13e,ae96a0e..0000000 --- a/ocaml/flexdll/cmdline.ml +++ b/ocaml/flexdll/cmdline.ml @@@ -18,7 -18,7 +18,7 @@@ let use_default_libs = ref tru let subsystem = ref "console" let explain = ref false let builtin_linker = ref false -let toolchain : [ `MSVC | `MSVC64 | `MINGW | `CYGWIN | `LIGHTLD ] ref = ref `MSVC +let toolchain : [ `MSVC | `MSVC64 | `MINGW | `MINGW64 | `CYGWIN | `LIGHTLD ] ref = ref `MSVC let save_temps = ref false let show_exports = ref false let show_imports = ref false @@@ -87,7 -87,7 +87,7 @@@ let specs = "-l", Arg.String (fun s -> files := ("-l" ^ s) :: !files), " Library file"; - "-chain", Arg.Symbol (["msvc";"msvc64";"cygwin";"mingw";"ld"], + "-chain", Arg.Symbol (["msvc";"msvc64";"cygwin";"mingw";"mingw64";"ld"], (fun s -> machine := `x86; underscore := true; toolchain := match s with @@@ -95,7 -95,6 +95,7 @@@ | "msvc64" -> machine := `x64; underscore := false; `MSVC64 | "cygwin" -> `CYGWIN | "mingw" -> `MINGW + | "mingw64" -> machine := `x64; underscore := false; `MINGW64 | "ld" -> `LIGHTLD | _ -> assert false)), " Choose which linker to use"; diff --combined ocaml/flexdll/reloc.ml index eb331dc,9a37b5b..0000000 --- a/ocaml/flexdll/reloc.ml +++ b/ocaml/flexdll/reloc.ml @@@ -112,7 -112,7 +112,7 @@@ type cmdline = let new_cmdline () = let rf = match !toolchain with | `MSVC | `MSVC64 | `LIGHTLD -> true - | `MINGW | `CYGWIN -> false + | `MINGW | `MINGW64 | `CYGWIN -> false in { may_use_response_file = rf; @@@ -160,7 -160,7 +160,7 @@@ let cygpath l let gcclib () = let extra = match !toolchain with - | `MINGW -> "-mno-cygwin " + | `MINGW | `MINGW64 -> "-mno-cygwin " | _ -> "" in Filename.dirname (get_output1 ~use_bash:(!toolchain = `CYGWIN) (Printf.sprintf "gcc %s-print-libgcc-file-name" extra)) @@@ -492,7 -492,7 +492,7 @@@ let parse_dll_exports fn let dll_exports fn = match !toolchain with | `MSVC | `MSVC64 | `LIGHTLD -> failwith "Creation of import library not supported for this toolchain" - | `CYGWIN | `MINGW -> + | `CYGWIN | `MINGW | `MINGW64 -> let dmp = temp_file "dyndll" ".dmp" in if cmd_verbose (Printf.sprintf "objdump -p %s > %s" fn dmp) <> 0 then failwith "Error while extracting exports from a DLL"; @@@ -898,7 -898,7 +898,7 @@@ let build_dll link_exe output_file file files def_file extra_args - | `MINGW -> + | `MINGW | `MINGW64 -> let def_file = if main_pgm then "" else @@@ -911,7 -911,7 +911,7 @@@ "gcc -mno-cygwin -m%s %s%s -L. %s %s -o %s %s %s %s %s %s" !subsystem (if link_exe = `EXE then "" else "-shared ") - (if main_pgm then "" else if !noentry then "-Wl,-e0 " else "-Wl,-e_FlexDLLiniter@12 ") + (if main_pgm then "" else if !noentry then "-Wl,-e0 " else match !machine with | `x86 -> "-Wl,-e_FlexDLLiniter@12 " | `x64 -> "-Wl,-e_FlexDLLiniter " ) (mk_dirs_opt "-I") (mk_dirs_opt "-L") (Filename.quote output_file) @@@ -983,7 -983,7 +983,7 @@@ let setup_toolchain () parse_libpath (try Sys.getenv "LIB" with Not_found -> ""); if not !custom_crt then default_libs := ["msvcrt.lib"] - | `MINGW -> + | `MINGW | `MINGW64 -> search_path := !dirs @ [ "/lib/mingw"; @@@ -1015,7 -1015,7 +1015,7 @@@ let compile_if_needed file (Filename.quote tmp_obj) (mk_dirs_opt "-I") file - | `MINGW -> + | `MINGW | `MINGW64 -> Printf.sprintf "gcc -mno-cygwin -c -o %s %s %s" (Filename.quote tmp_obj) @@@ -1054,7 -1054,6 +1054,7 @@@ let all_files () | `MSVC -> "msvc.obj" | `MSVC64 -> "msvc64.obj" | `CYGWIN -> "cygwin.o" + | `MINGW64 -> "mingw64.o" | `MINGW | `LIGHTLD -> "mingw.o" in if !exe_mode <> `DLL then if !add_flexdll_obj then f ("flexdll_" ^ tc) :: files @@@ -1073,7 -1072,7 +1073,7 @@@ let main () | _, `Yes -> true | _, `No -> false | `CYGWIN, `None -> (Sys.command "cygpath -v 2>/dev/null >/dev/null" = 0) - | `MINGW, `None -> (Sys.command "cygpath -v 2>NUL >NUL" = 0) + | (`MINGW|`MINGW64), `None -> (Sys.command "cygpath -v 2>NUL >NUL" = 0) | (`MSVC|`MSVC64|`LIGHTLD), `None -> false end; diff --git a/ocaml/flexdll/version.ml b/ocaml/flexdll/version.ml new file mode 100755 index 0000000..47eaa2f --- /dev/null +++ b/ocaml/flexdll/version.ml @@ -0,0 +1 @@ +let version = "0.26"