English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2010-07-08 (10:48)
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.