A solution that I used is to patch OCaml to read a configuration file at startup. This configuration file overrides what was put in the config at compile time, so that you can change what C compiler/assembler/linker you use at every execution. It was done in a first attempt to build a cross-compiling compiler. Then, you can provide a simple tool that tests the environment and generate the corresponding configuration file. --Fabrice On 12/14/2011 04:49 PM, Adrien wrote: > On 14/12/2011, Gerd Stolpmann wrote: >> Am Mittwoch, den 14.12.2011, 14:37 +0100 schrieb Adrien: >>> On 14/12/2011, Alain Frisch wrote: >>>> As a concrete problem, until a few days ago, the mingw port could not be >>>> used with recent versions of Cygwin without some small hacks (like >>>> copying manually /bin/gcc-3.exe into gcc.exe, and passing more >>>> directories to flexlink). No big deal, but it can discourage beginners. >>> >>> Actually, I think that you should have used the "/etc/alternatives" >>> symlinks: /usr/bin/gcc points to /etc/alternatives/FOO and you can make >>> this >>> FOO symlink point to the /usr/bin/BAR binary that you want. >> >> There are no (usable) symlinks in Windows. Cygwin includes an emulation, >> but it is not understood by win32 programs, and hence this mechanism is >> unavailable for ocamlc/opt and flexlink. > > Hmmm, right. But if /usr/bin/gcc is already a symlink, ocaml wouldn't be > able to use it at all... I find it quite weird but I don't have a cygwin box > to test. > > But windows actually has symlinks. Kind of. Starting with Vista and the > corresponding NTFS version. But by default you need to be an administrator > to use them, you can only create a limited number of symlink in a given > folder afaiu, some functions work on the symlink and some on the target > (stat()/lstat()). They have a number of limitations and last time I looked > at them, I found them to be mostly unusable because of their limitations. > > They're one quite big issue I've had for packages on windows: if I > cross-compile a library from Linux, and make a tarball which has a number of > symlink in it. What to do when untarring on windows? Try to create symlinks? > Use hardlinks when possible? Copy the file's contents? Something else? > > Regards, > Adrien Nader >