Am Samstag, den 24.10.2015, 09:29 +0000 schrieb Soegtrop, Michael: > Just some libraries look a bit fishy, e.g. > > CAMLprim value unix_write(value fd, value buf, value vofs, value vlen) { > long ofs, len, written; > int numbytes, ret; > char iobuf[UNIX_BUFFER_SIZE]; > > Begin_root (buf); > ofs = Long_val(vofs); > len = Long_val(vlen); > > This assignment of Long_val to a long doesn't seem to be correct. Or is this function just used for Linux? Exactly. There is also win32unix/write.c: CAMLprim value unix_write(value fd, value buf, value vofs, value vlen) { intnat ofs, len, written; DWORD numbytes, numwritten; char iobuf[UNIX_BUFFER_SIZE]; DWORD err = 0; Begin_root (buf); ofs = Long_val(vofs); len = Long_val(vlen); The organization of the sources is a bit tricky there. Some files are copied from unix/ to win32unix/ and some aren't, like write.c. > - It is way odd that there is no -build option to configure like with gcc. A compiler build needs to be aware of 3 OSes: the one on which the compiler is build, the one on which the built compiler runs and the one for which it generates code. For gcc all 3 are configurable. Some configure/make things are clearer and easier if all 3 OSes are known. E.g. pathes tend to be different on the build and host OS when building a Mingw compiler on Cygwin. Officially, the OCaml build doesn't support that host arch <> build arch. (Remember, this is a feature gcc supports, and nothing "a compiler needs to be aware of".) But anyway, the situation is a little bit different than for a C compiler. OCaml uses bytecode for bootstrapping, and you can e.g. run the bytecode executables built for arch X on arch Y with the ocamlrun for arch Y. So, if you wanted, you can have host <> build on your own. Windows in particular is very special, because the distinction build/host makes only sense for some aspects, as you can run the host executables on the build system. You mention paths, but this is also non-critical, because Cygwin also accepts native paths with forward slashes. What remains is finally LF vs CR/LF, but this can also be addressed by other means. That said, this is only the explanation why host<>build was so far not of special interest. > I think it might be not so much work to get rid of the separate make files and use configure for mingw and cygwin builds as well. The Makefile.nt system exists mainly for the MSVC build. I also think that the mingw build would be better done with the Makefiles. Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------