Testing for 32bit or 64bit Cygwin in Makefile?

Sebastian Feld sebastian.n.feld@gmail.com
Sat Nov 9 10:42:55 GMT 2024


On Wed, Nov 6, 2024 at 4:30 PM Dimitry Andric
<dimitry@unified-streaming.com> wrote:
>
> On 6 Nov 2024, at 16:11, Sebastian Feld via Cygwin <cygwin@cygwin.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 ()

Sebi
-- 
Sebastian Feld - IT secruity expert


More information about the Cygwin mailing list