summaryrefslogtreecommitdiff
path: root/src/configure.in
diff options
context:
space:
mode:
authorTom Lane1999-03-15 01:43:07 +0000
committerTom Lane1999-03-15 01:43:07 +0000
commitf621b85a2a0dba37813736f3f073c8b0b69b5d53 (patch)
tree86bcb2c330f759dc3da543c09897b436c5f80688 /src/configure.in
parent98ad3fcfaf32e23959b44ec3f06f27555eaa5605 (diff)
Fix int8 configure one more time ... prior version didn't
define INT64_FORMAT in all cases.
Diffstat (limited to 'src/configure.in')
-rw-r--r--src/configure.in47
1 files changed, 34 insertions, 13 deletions
diff --git a/src/configure.in b/src/configure.in
index 11f7f1a7485..a8ba1f46f33 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -791,8 +791,12 @@ fi
dnl If we found "long int" is 64 bits, assume snprintf handles it.
dnl If we found we need to use "long long int", better check.
+dnl We cope with snprintfs that use either %lld or %qd as the format.
+dnl If neither works, fall back to our own snprintf emulation (which we
+dnl know uses %lld).
-if [[ x$SNPRINTF = x -a $HAVE_LONG_LONG_INT_64 -eq 1 ]] ; then
+if [[ $HAVE_LONG_LONG_INT_64 -eq 1 ]] ; then
+ if [[ x$SNPRINTF = x ]] ; then
AC_MSG_CHECKING(whether snprintf handles 'long long int' as %lld)
AC_TRY_RUN([#include <stdio.h>
typedef long long int int64;
@@ -819,7 +823,8 @@ main() {
exit(! does_int64_snprintf_work());
}],
[ AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_INT64_AS_LLD) ],
+ INT64_FORMAT='"%lld"'
+ ],
[ AC_MSG_RESULT(no)
AC_MSG_CHECKING(whether snprintf handles 'long long int' as %qd)
AC_TRY_RUN([#include <stdio.h>
@@ -846,19 +851,35 @@ int does_int64_snprintf_work()
main() {
exit(! does_int64_snprintf_work());
}],
- [ AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_INT64_AS_QD) ],
- [ SNPRINTF='snprintf.o'
- AC_MSG_RESULT(no)],
- [ SNPRINTF='snprintf.o'
- AC_MSG_RESULT(assuming not on target machine)]) ],
-
- [ SNPRINTF='snprintf.o'
- AC_MSG_RESULT(no)],
- [ SNPRINTF='snprintf.o'
- AC_MSG_RESULT(assuming not on target machine)])
+ [ AC_MSG_RESULT(yes)
+ INT64_FORMAT='"%qd"'
+ ],
+ [ AC_MSG_RESULT(no)
+ # Force usage of our own snprintf, since system snprintf is broken
+ SNPRINTF='snprintf.o'
+ INT64_FORMAT='"%lld"'
+ ],
+ [ AC_MSG_RESULT(assuming not on target machine)
+ # Force usage of our own snprintf, since we cannot test foreign snprintf
+ SNPRINTF='snprintf.o'
+ INT64_FORMAT='"%lld"'
+ ]) ],
+ [ AC_MSG_RESULT(assuming not on target machine)
+ # Force usage of our own snprintf, since we cannot test foreign snprintf
+ SNPRINTF='snprintf.o'
+ INT64_FORMAT='"%lld"'
+ ])
+ else
+ # here if we previously decided we needed to use our own snprintf
+ INT64_FORMAT='"%lld"'
+ fi
+else
+ # Here if we are not using 'long long int' at all
+ INT64_FORMAT='"%ld"'
fi
+AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT)
+
dnl Check to see if platform has POSIX signal interface.
dnl NOTE: if this test fails then POSIX signals definitely don't work.