You can create a program which outputs that size. I saw this apporach on several ./configure
files:
cat << EOF > test.c
#include <stdio.h>
int main ()
{
printf("int %d\n", sizeof(int));
return 0;
}
EOF
$(CC) test.c -o out
./out >> sizes
rm -f test.c out
Of course, with testing of erroneous cases and such.
Edit: See the waf documentation. Specially, read the run_c_code
method. For saving the value of sizeof
you can write to a file instead and read it from Python/Waf. Or, see the define_ret
argument.