I am working on a cross-platform project that uses GNU Autotools for the build system, and I was wondering if there is a way to run a simple sizeof(int)
and pass the result to the configure
script (or even simply to the standard output) when cross-compiling.
Let's imagine I am using a 32-bit machine for compiling a program for a 64-bit machine. If my compiler is able to compile code for a different architecture it means that surely knows the result of sizeof(int)
on the target architecture.
My question is: How do I interrogate the compiler for obtaining that information when cross-compiling?