From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 15A92BC57 for ; Thu, 8 Jul 2010 12:48:09 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap8CAAVKNUzVpUAUi2dsb2JhbACgPAEBAQoLCgcPBR+/NYUlBA X-IronPort-AV: E=Sophos;i="4.53,557,1272837600"; d="scan'208";a="53810792" Received: from mail.gmx.net ([213.165.64.20]) by mail3-smtp-sop.national.inria.fr with SMTP; 08 Jul 2010 12:48:08 +0200 Received: (qmail invoked by alias); 08 Jul 2010 10:48:07 -0000 Received: from nocat-out.u-bordeaux.fr (EHLO localhost) [147.210.179.68] by mail.gmx.net (mp047) with SMTP; 08 Jul 2010 12:48:07 +0200 X-Authenticated: #229240 X-Provags-ID: V01U2FsdGVkX1+8QDBzMgu84CWStmFEiUlLigIBi9jCJUgQeC/kkp K16OkpEtXJkdJI Date: Thu, 8 Jul 2010 12:48:05 +0200 From: Alex To: Richard Jones , Daniel =?iso-8859-1?Q?B=FCnzli?= Cc: caml-list List Subject: Re: [Caml-list] Distinguish between osx and linux programmatically Message-ID: <20100708104517.GA848@Stubb-2.local> References: <20100708102314.GA16057@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100708102314.GA16057@annexia.org> User-Agent: mutt X-Y-GMX-Trusted: 0 X-Spam: no; 0.00; ocamltools:01 ocamlc:01 ocamlopt:01 ocamlc:01 runtime:01 ocaml:01 mailinglist:98 config:01 config:01 unix:01 compile:01 caml-list:01 grep:01 parameter:02 sys:03 Hello, > > 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 Ocamlbuild_pack.Ocamlbuild_Myocamlbuild_config.system and Ocamlbuild_pack.Ocamlbuild_Myocamlbuild_config.arch 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. regards, alex