Version franaise
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
Distinguish between osx and linux programmatically
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alex <alex.mailinglist@g...>
Subject: Re: [Caml-list] Distinguish between osx and linux programmatically


> > Is there something in the standard library that allows me to
> > distinguish between oxs and linux (Sys.os_type just returns "Unix" for
> > both).
we had a similar problem, but finally (ab)used 
in the context of an ocamlbuild script to get
the system and the current architecture (32 vs
64 bit). just adapt to your demands.

it's the same variable that it accessible via the 
"-config" parameter of the ocamltools (ocamlc/ocamlopt/...)
   shell~> ocamlc -config|grep system
please note, that it's not the runtime configuration
but the system configuration at compile time of your
ocaml distribution.