diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | configure | 6 |
2 files changed, 10 insertions, 3 deletions
@@ -1,5 +1,12 @@ 2009-11-23 Kaz Kylheku <kkylheku@gmail.com> + * configure: Don't rely on higher precision arithmetic from the build + machine's shell. POSIX requires shell arithmetic to be only signed + long. We can't compute the INT_PTR_MAX constant in the shell, but + rather generate a constant C expression to compute it. + +2009-11-23 Kaz Kylheku <kkylheku@gmail.com> + Reporting of compile errors during configuration for easier configure debugging. @@ -579,9 +579,9 @@ fi printf '"%s"\n' "$intptr" printf "typedef $intptr int_ptr_t;\n" >> config.h -intptr_max=$(( (1 << ( sizeof_ptr * 8 - 1 )) - 1 )) -printf "#define INT_PTR_MAX %d\n" $intptr_max >> config.h -printf "#define INT_PTR_MIN -%d\n" $intptr_max >> config.h +intptr_max_expr="((((($intptr) 1 << $((sizeof_ptr * 8 - 2))) - 1) << 1) + 1)" +printf "#define INT_PTR_MAX %s\n" "$intptr_max_expr" >> config.h +printf "#define INT_PTR_MIN (-INT_PTR_MAX)\n" >> config.h # # Clean up |