Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-05 (23:19)
From: skaller <skaller@u...>
Subject: ocamlbuild
Does Ocamlbuild work on Windows *transparently*?

To do this, it must read filenames written with / in it,
but use filenames with \ replacing the /. I'd say this is
mandatory, so the same build control file will work on
all platforms. Then you need to document that Unix filenames
must be used, even on Windows.

Note: although *Ocaml* basenames cannot have spaces in them,
the directories that contain them can. So Ocamlbuild must be
sure to quote all filenames, in case they have spaces.
This includes allowing quotes in the input specs.
Unix file systems allow spaces in filenames too, and many
modern Desktops will have 'folders' with spaces in
(if a 'doze or fruit user gets Ubuntu in their office).

I warn this is a serious PITA if you're building Windows
*Native* code, but hosting the build on Cygwin, because
executables have to use Unix filenames but arguments have
to use Windows filenames, so you have to carefully keep
track of which tool is running what.

It helps if standard tools translate internally (eg ocamlc).
However any build script has to allow for foreign tools
(eg Felix uses Dypgen as a parser).

A serious nasty here is if you have to use silly names
on windows for the tools, eg building Felix:

	C:\Program Files (x86)\Ocaml\ocamlc

and here the spaces, parentheses and C: drive
letter are mandatory and must be handled correctly
as a native filename. On Windows, Ocaml isn't necessarily
even in the path -- because on Windows XP64 I have multiple
Ocaml versions and I need to *specify* which one to use,
no accidents from PATH please! (Well actually, we do use
the PATH but it leads to a mess).

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: