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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 299787F7AF for ; Fri, 9 Oct 2015 14:03:23 +0200 (CEST) IronPort-PHdr: 9a23:/jEXUxQ1mExk9TsVP+lksb+wz9psv+yvbD5Q0YIujvd0So/mwa64ZxON2/xhgRfzUJnB7Loc0qyN4/ymBDRIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/ni6bvo9X6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD86Fpy8kVWqz/e+E8TKdEJDUgKWE8osPx5jfZSg7a3WcRXGwQ2jpFBwzI9hTzWJG55jDmu+R03gGGPcCsSLkvRTm49OFnRUm72288Kzcl/TSP2YRLh6VBrUf5qg== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=stefan@the2masters.de; spf=Pass smtp.mailfrom=stefan@the2masters.de; spf=None smtp.helo=postmaster@mail-wi0-f179.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of stefan@the2masters.de) identity=pra; client-ip=209.85.212.179; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="stefan@the2masters.de"; x-sender="stefan@the2masters.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of stefan@the2masters.de designates 209.85.212.179 as permitted sender) identity=mailfrom; client-ip=209.85.212.179; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="stefan@the2masters.de"; x-sender="stefan@the2masters.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f179.google.com) identity=helo; client-ip=209.85.212.179; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="stefan@the2masters.de"; x-sender="postmaster@mail-wi0-f179.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DDAwDbqxdWm7PUVdFeg3pugU23coQwgVoXAoJ6ggqCSjoSAQEBAQEBAQEQAQEBAQEGCwsJIS6CH4IgLgEBOE5GAQUBFkGIDAQBoS6BMT4xiliFVgEFjyomAgQKkRKCFwxDgTGHQY5WhRmIW36EOoJxDJEkNYEXKAiCWoFdb4dqAQEB X-IPAS-Result: A0DDAwDbqxdWm7PUVdFeg3pugU23coQwgVoXAoJ6ggqCSjoSAQEBAQEBAQEQAQEBAQEGCwsJIS6CH4IgLgEBOE5GAQUBFkGIDAQBoS6BMT4xiliFVgEFjyomAgQKkRKCFwxDgTGHQY5WhRmIW36EOoJxDJEkNYEXKAiCWoFdb4dqAQEB X-IronPort-AV: E=Sophos;i="5.17,657,1437429600"; d="scan'208";a="181942582" Received: from mail-wi0-f179.google.com ([209.85.212.179]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 09 Oct 2015 14:03:22 +0200 Received: by wicfx3 with SMTP id fx3so63729433wic.0 for ; Fri, 09 Oct 2015 05:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=the2masters.de; s=mail; h=from:to:subject:date:message-id; bh=0nmt9+v1y7ck4px+iKVjdRq6myXDbRMKsrS4p1eQhpQ=; b=nzlRQqpZKViK42io14orFwHmbD4GRsVyOoOYGwxYlP+ix8IxOElk6+GvhG/9WJ0s87 URRXUTS7nr9Aih6ukPUNf5dsq4XnG5d0n1iz9p9tTG5bUbz5jzFKN8ITSE6u/XS01RMc AGwGGpNC18n/w6TuDoeNTZoxcvtnbi0f1ngec= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=0nmt9+v1y7ck4px+iKVjdRq6myXDbRMKsrS4p1eQhpQ=; b=RsYkkI8ZtlVD0S9eVkY/Q3Bg4tmGNqb+GVL3AJmKwGCkfu4CA3yScJy9oQYeLWkvWm Mz+JuH70tU/WUL5XWdc5bPH0d14u50WjpMYstRRM2hgl3N2NxWy7WwYrSDwU8lLDyBdH xSKdBsPMTkoK1AN8bFGMrzxqr6wwTx1Fi/DdeMgV1jUPggbwMFqly+0ggW47BW0MI0Ky NPO/91td7X6F9JmlgtxMbZLx7Nez3LuPAhVOYXh2w/HO6RT8+MxdcAAYEO3ESr7+7r6O TPGBpRiPX/2CEJj4OhRkUxU+0zekfkq7u2mMW/XvXoY11Ldti8LpCZ12RRF9qN97SLSl TwBw== X-Gm-Message-State: ALoCoQnQYnBBl2b+kxXavB2f84CzL8C2m2Bp49OSkjsOriOqNxYSEp5xkBrldts56V9T3Icjv+qH X-Received: by 10.194.206.38 with SMTP id ll6mr14282711wjc.116.1444392202507; Fri, 09 Oct 2015 05:03:22 -0700 (PDT) Received: from devel.eslohe.lan (p579F4BD2.dip0.t-ipconnect.de. [87.159.75.210]) by smtp.googlemail.com with ESMTPSA id h7sm1754456wjz.7.2015.10.09.05.03.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Oct 2015 05:03:21 -0700 (PDT) From: Stefan Hellermann To: caml-list@inria.fr Date: Fri, 9 Oct 2015 14:03:12 +0200 Message-Id: <1444392194-18276-1-git-send-email-stefan@the2masters.de> X-Mailer: git-send-email 2.1.4 Subject: [Caml-list] [PATCH 0/2] use preprocessor to get infos about target arch I'm trying to port OCaml to the openwrt router distribution [1]. Openwrt makes heavy use of cross-compiling, and supports about 40 different target archs. When cross-compiling OCaml the configure script fails on 2 tests, it cannot detect integer and pointer sizes and it cannot detect endianess. I could now add rules and manually set the values for all 40 openwrt targets into the configure script, but I think this doesn't scale well and is only useful for openwrt. So I sat down and wrote an alternative way to detect pointer sizes and endianess by using the preprocessor and parsing it's output. This is currently lightly tested on a few archs, so please comment and test. There is also a test in configure script which checks if negative division rounds to zero. This check currently fails in case of cross-compile, but is only a warning. I see no way to do this check in the preprocessor. Is this test really needed? Which compiler do misbehave? Sind C99 round to zero is mandated by the C Standard. [1] https://openwrt.org/ Stefan Hellermann (2): configure: Check sizes of integers and pointers by using the preprocessor configure: Check endianess by using the preprocessor config/auto-aux/endian.c | 60 ++++++++++++----------------- config/auto-aux/preprocesstest | 22 +++++++++++ config/auto-aux/sizes.c | 85 ++++++++++++++++++++++++++++++------------ configure | 28 ++++++++------ 4 files changed, 123 insertions(+), 72 deletions(-) create mode 100755 config/auto-aux/preprocesstest -- 2.1.4