From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8349C7FCCB for ; Tue, 14 Apr 2015 13:23:58 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AbAQCF9yxVnEpWN0pcg15cgxXEG4V/AoF8EQEBAQEBAQERAQEBAQEGDQkJFC6EIAEBBCNWEAsODAImAgJHEAYbFogMBAm1MJYTAQEBBwEBAQEBGQSBIYoKgmaBYzMHgmgvgRYBBJUHjSEPjVSCVYE+bYJDAQEB X-IPAS-Result: A0AbAQCF9yxVnEpWN0pcg15cgxXEG4V/AoF8EQEBAQEBAQERAQEBAQEGDQkJFC6EIAEBBCNWEAsODAImAgJHEAYbFogMBAm1MJYTAQEBBwEBAQEBGQSBIYoKgmaBYzMHgmgvgRYBBJUHjSEPjVSCVYE+bYJDAQEB X-IronPort-AV: E=Sophos;i="5.11,576,1422918000"; d="scan'208";a="110994715" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail3-smtp-sop.national.inria.fr with ESMTP; 14 Apr 2015 13:23:57 +0200 Received: from [172.20.10.2] (254.232.197.178.dynamic.wless.lssmb00p-cgnat.res.cust.swisscom.ch [178.197.232.254]) by smtp.webfaction.com (Postfix) with ESMTP id 316F420EFDF9; Tue, 14 Apr 2015 11:23:54 +0000 (UTC) Date: Tue, 14 Apr 2015 13:23:50 +0200 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: Malcolm Matalka Cc: caml-list@inria.fr Message-ID: In-Reply-To: <877ftfoudd.fsf@gmail.com> References: <877ftfoudd.fsf@gmail.com> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Caml-list] Suggested way to determine platform specific capabilities in build system? Le mardi, 14 avril 2015 =C3=A0 12:51, Malcolm Matalka a =C3=A9crit : > What is the current suggested way to determine what, roughly, autoconf > would do for you? I have some platform specific functionality to be > included (or excluded) depending on the OS. I don't know if there's a suggested way but here are various ways to procee= d. If you are using ocamlbuild, you can use `Sys.win32` since 4.01.0 or `Sys.o= s_type =3D "Win32"` to determine if you are on windows and otherwise get th= e (stripped and lowercased) result of `uname -s`, see e.g (but it's missing= the win bit):=20=20 https://github.com/dbuenzli/tsdl/blob/master/myocamlbuild.ml#L6 If you are using Makefiles you may want include `$(ocamlc -where)/lib/ocaml= /Makefile.config` and use the `$SYSTEM` variable. If this is only needed for C stubs you can also try solve this at the CPP l= evel =E2=80=94 but I guess this can be quite brittle =E2=80=94 see e.g (her= e again missing the win bit as it's undefined for now):=20=20 https://github.com/dbuenzli/mtime/blob/master/src-os/mtime_stubs.c#L11-L21 In any case make sure the value can be overridden from the command line for= cross compilation scenarios.=20=20 Best, Daniel