delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/11/09/06:20:55

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4A9BKssn3142024
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4A9BKssn3142024
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=CIY+dRar
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B6453858D26
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1731151253;
bh=dO5AYgfDYm/3lfvM7yHYGCm8W0RYjGNOCS5qTfqozU4=;
h=Subject:In-Reply-To:Date:Cc:References:To:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=CIY+dRardb5ZFPolx9HUWQ+hbpKu+y9uoxnwt2CxfBEoxXRP2/0ek4zCYCNjPMkII
jMb20R255BRlaQ9KIrrDUAI53q1bvyiZXo57msUWx7CIkZsyT2P0elvPvlS4tgbPUt
6udC8uR5ufRD5IjNJIjtE9g4CaQGFGUb3bfbFGEU=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 295203858D20
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 295203858D20
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731151230; cv=none;
b=Onm9M40umjQXxFEu7w3JYLleKmOmGSb4K1MqFsc1YjjxjKxX5IxpSkxzAn3cfODRTkaHvO9M3OWwWnEHVv0mOUd9HnB/YhKOZdZCjIE2jXOSiY2q0alI3+AKJQBE4lDfl9Rxb32pLXwU2jGVM4BQaBpk/D1AXoFO53dcidsjpSY=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1731151230; c=relaxed/simple;
bh=pM84xo1BwDLFexcvcFYjlDBppsOvbf/PGc48OvrF4SM=;
h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To;
b=WlAX6IvJwboKjITf8jJG3ammO4MMdvcXBPfwbjQuTvkRNLwEIxL4s92zhAGWww9xwlvsKivfrkQylKGa4Sbw3UhDFu3ifllijeTQK6WE6u/Oh6hRRYYLRLfiXLoYYWJIFSFRJuHEZrWVg+Cl0Y1OhlbHid3LgEO5dWVg5U0/AJA=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1731151227; x=1731756027;
h=to:references:message-id:content-transfer-encoding:cc:date
:in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=pM84xo1BwDLFexcvcFYjlDBppsOvbf/PGc48OvrF4SM=;
b=Z7m0wWu8KZAl9Agx2fv7tT5D7JRxGow4xXfZNkA8ngSZ9ckRRWCCUg+Z3uYKRQJhXm
Zk/eppB8ZpdJLoBoh6K/onSGNBKgnLSMKzbv2jlYc/VDNYrng4XuCQISd8RW8NN5+7Kx
yzBoTB01tLm/vBZLOb/5kYYKS330fCFBh7cWhK2EcishuHTp0WV+ML/l4vzezTC1wcRw
9gsaT2y2209Q1rn2n1oB67eutxomDxb4T/a29ecGSdGvaBIxM1U8NJpVpKISyLI5SPB9
Xz9m/5PyLEbQlTMI8b0ABdMgZgadZHwmD5fPeT3Nq0ZA41XTqswDKehhOW2/N8aNMsyr
6etQ==
X-Gm-Message-State: AOJu0Yym9NbyIMBW3nQZ/094a5wG6rmUy2T+BW9WaloVaX0e3Qq4lpBC
OsZJmOJX4HSdc26v/6hKKHRosr+o/YTIfkQZ+GPKZQI5UUKawgfNlFzRFjeZhWg=
X-Google-Smtp-Source: AGHT+IHr4Z4G77VLLPjJYAybrStdjREBp36shPGEUGVkQpR+k0usim2484LloVTI03GXqjpUphFJOA==
X-Received: by 2002:a17:907:a03:b0:a99:facf:cfc with SMTP id
a640c23a62f3a-a9eefeec7b7mr564002266b.17.1731151226573;
Sat, 09 Nov 2024 03:20:26 -0800 (PST)
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.9\))
Subject: Re: Testing for 32bit or 64bit Cygwin in Makefile?
In-Reply-To: <CAHnbEGKyXRToR6XnxBAfvEUfTZ0ru+BVqkB7h8o4OVOMHbi62Q@mail.gmail.com>
Date: Sat, 9 Nov 2024 12:20:25 +0100
Cc: cygwin AT cygwin DOT com
Message-Id: <4BF155F8-2CF8-43D0-8023-AA988F6F3FB0@unified-streaming.com>
References: <CAHnbEG+v9hbLoiucVjg4UqLf8Lc5ehUVDM8oEFQpT4wWpVf1zQ AT mail DOT gmail DOT com>
<EE86CE0E-BCD4-40A1-BB29-3F6E9D4B6288 AT unified-streaming DOT com>
<CAHnbEGKyXRToR6XnxBAfvEUfTZ0ru+BVqkB7h8o4OVOMHbi62Q AT mail DOT gmail DOT com>
To: Sebastian Feld <sebastian DOT n DOT feld AT gmail DOT com>
X-Mailer: Apple Mail (2.3731.700.6.1.9)
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Dimitry Andric via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Dimitry Andric <dimitry AT unified-streaming DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 4A9BKssn3142024

On 9 Nov 2024, at 11:42, Sebastian Feld via Cygwin <cygwin AT cygwin DOT com> wrote:
> 
> On Wed, Nov 6, 2024 at 4:30 PM Dimitry Andric
> <dimitry AT unified-streaming DOT com> wrote:
>> 
>> On 6 Nov 2024, at 16:11, Sebastian Feld via Cygwin <cygwin AT cygwin DOT com> wrote:
>>> 
>>> How can I test in a /usr/bin/make Makefile whether I am running on a
>>> 32bit or 64bit Cygwin (not Windows kernel)?
>> 
>> Usually in a shell you use "uname -m", or with bash specifically, the $HOSTTYPE variable.
>> 
>> However in GNU make you should be able to use the internal variable $(MAKE_HOST). On my Cygwin installation, this gives the value "x86_64-pc-cygwin". Since I do not have any 32-bit Cygwin installation, I cannot tell you what the exact value is, but my guess would be "i386-pc-cygwin", or something like that.
> 
> I need something which works with bsdmake (/usr/bin/bmake in Cygwin)
> and GNU /usr/bin/make. Moreover, how would a test statement for this
> look like in the Makefile? bmake doesn't have ifeq ()

BSD make has a different style for conditionals, using ".if", ".else", and so on. These use a more familiar logical operator syntax than GNU make.

It also has a built-in variable MACHINE corresponding to "uname -m" output. So with bmake you can do:

.if ${MACHINE} == "x86_64"
.info Go here
.else
.info Go there
.endif

However, supporting both GNU make and BSD make in one Makefile is not really possible unless you use the lowest common denominator syntax, which is just variable assignments and basic rules.

Otherwise, you would have to write two files, one called GNUmakefile for GNU make, and one called Makefile for BSD make.

-Dimitry


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019