On 07/May/2021 07:19, aotto wrote: > Thanks, > > first: > The "too late" was just an assumption because the "ac_XXX" definition > use the CFLAGS > before the CFLAGS is set by me, I understand that my try to force 32 > bit is not > quite common but if the source-code is ONLY written and tested for > 32bit it would > be quite "unfriendly" to let the user build 64bit code which is > probably broken. > > second: > I think the hint about -m32 and -mx32 is good because -mx32 is > probably the thing I really > want. A "autoconf" option is a good approach to let the used decide > between -m32 and > -mx32 > > third: > The alternative would be to write a "wrapper-script" for "configure" > to force the thing > I want, I think this would be the most-worse thing. > > what I really missing is the proper (--host or --target) option which > set the 32bit code > correct and portable. Any --host option seems to search for compiler > with "host" prefix > -> this does not work together with gnu "gcc" because the option > approach uses the same > compiler front-end as 64bit. > > If I use my second approach the configure output start with: > > configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu > checking build system type... x86_64-pc-linux-gnu > checking host system type... x86_64-pc-linux-gnu > checking target system type... x86_64-pc-linux-gnu > > > there is NOTHING about 32 bit, even the -m32/-mx32 flag is not recognized > > in the "host/target system type message. > > I feel uncomfortable about the "32bit" support in autoconf. Forcing 32-bit is inappropriate, instead, the configure script should do what it's told, if it can, or abort otherwise. Example: AC_CANONICAL_HOST AS_CASE(["$host_os"], [i?86-*], [] [*], [ AC_MSG_ERROR([Unsupported host architecture.]) ]) # and here you could check the compiler output to see it matches # host_os too.