Testing for 32bit or 64bit Cygwin in Makefile?
Brian Inglis
Brian.Inglis@SystematicSW.ab.ca
Sun Nov 10 17:49:52 GMT 2024
On 2024-11-06 08:30, Dimitry Andric via Cygwin 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.
Cygwin 32 (no longer supported) was i686-pc-cygwin as are Mingw cross-builds:
$ ls -1 /usr/bin/i*-gcc-[0-9]*
/usr/bin/i686-w64-mingw32-gcc-6.4.0.exe
/usr/bin/i686-w64-mingw32-gcc-7.4.0.exe
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry
More information about the Cygwin
mailing list