mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Un-break configure snprintf tests (partly my fault, partly Bruce's).
This commit is contained in:
126
configure
vendored
126
configure
vendored
@ -14526,6 +14526,65 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Force use of our snprintf if system's doesn't do arg control
|
||||||
|
if test $pgac_need_repl_snprintf = no; then
|
||||||
|
echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
|
||||||
|
echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
|
||||||
|
if test "${pgac_cv_printf_arg_control+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
if test "$cross_compiling" = yes; then
|
||||||
|
pgac_cv_printf_arg_control=cross
|
||||||
|
else
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
#line $LINENO "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
char buf[100];
|
||||||
|
|
||||||
|
/* can it swap arguments? */
|
||||||
|
snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
|
||||||
|
if (strcmp(buf, "4 3") != 0)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest$ac_exeext
|
||||||
|
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||||
|
(eval $ac_link) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; }; then
|
||||||
|
pgac_cv_printf_arg_control=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: program exited with status $ac_status" >&5
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
cat conftest.$ac_ext >&5
|
||||||
|
( exit $ac_status )
|
||||||
|
pgac_cv_printf_arg_control=no
|
||||||
|
fi
|
||||||
|
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5
|
||||||
|
echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6
|
||||||
|
|
||||||
|
if test $pgac_cv_printf_arg_control != yes ; then
|
||||||
|
pgac_need_repl_snprintf=yes
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "$as_me:$LINENO: checking whether long int is 64 bits" >&5
|
echo "$as_me:$LINENO: checking whether long int is 64 bits" >&5
|
||||||
echo $ECHO_N "checking whether long int is 64 bits... $ECHO_C" >&6
|
echo $ECHO_N "checking whether long int is 64 bits... $ECHO_C" >&6
|
||||||
@ -14809,68 +14868,6 @@ fi
|
|||||||
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
|
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
|
||||||
# work, fall back to our own snprintf emulation (which we know uses %lld).
|
# work, fall back to our own snprintf emulation (which we know uses %lld).
|
||||||
|
|
||||||
# Also force use of our snprintf if system's doesn't do arg control
|
|
||||||
if test $pgac_need_repl_snprintf = no; then
|
|
||||||
echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
|
|
||||||
echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
|
|
||||||
if test "${pgac_cv_printf_arg_control+set}" = set; then
|
|
||||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
|
||||||
else
|
|
||||||
if test "$cross_compiling" = yes; then
|
|
||||||
pgac_cv_printf_arg_control=cross
|
|
||||||
else
|
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
|
||||||
#line $LINENO "configure"
|
|
||||||
#include "confdefs.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
char buf[100];
|
|
||||||
|
|
||||||
/* can it swap arguments? */
|
|
||||||
snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
|
|
||||||
if (strcmp(buf, "4 3") != 0)
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
rm -f conftest$ac_exeext
|
|
||||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
|
||||||
(eval $ac_link) 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
||||||
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
|
|
||||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
|
||||||
(eval $ac_try) 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
||||||
(exit $ac_status); }; }; then
|
|
||||||
pgac_cv_printf_arg_control=yes
|
|
||||||
else
|
|
||||||
echo "$as_me: program exited with status $ac_status" >&5
|
|
||||||
echo "$as_me: failed program was:" >&5
|
|
||||||
cat conftest.$ac_ext >&5
|
|
||||||
( exit $ac_status )
|
|
||||||
pgac_cv_printf_arg_control=no
|
|
||||||
fi
|
|
||||||
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5
|
|
||||||
echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6
|
|
||||||
|
|
||||||
if test $pgac_cv_printf_arg_control != yes ; then
|
|
||||||
pgac_need_repl_snprintf=yes
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $pgac_need_repl_snprintf = yes; then
|
|
||||||
LIBOBJS="$LIBOBJS snprintf.$ac_objext"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
|
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
|
||||||
if test $pgac_need_repl_snprintf = no; then
|
if test $pgac_need_repl_snprintf = no; then
|
||||||
echo "$as_me:$LINENO: checking snprintf format for long long int" >&5
|
echo "$as_me:$LINENO: checking snprintf format for long long int" >&5
|
||||||
@ -14973,6 +14970,11 @@ cat >>confdefs.h <<_ACEOF
|
|||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
# Now we have checked all the reasons to replace snprintf
|
||||||
|
if test $pgac_need_repl_snprintf = yes; then
|
||||||
|
LIBOBJS="$LIBOBJS snprintf.$ac_objext"
|
||||||
|
fi
|
||||||
|
|
||||||
# Need a #define for the size of Datum (unsigned long)
|
# Need a #define for the size of Datum (unsigned long)
|
||||||
echo "$as_me:$LINENO: checking for unsigned long" >&5
|
echo "$as_me:$LINENO: checking for unsigned long" >&5
|
||||||
echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6
|
echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6
|
||||||
|
28
configure.in
28
configure.in
@ -1,5 +1,5 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
dnl $PostgreSQL: pgsql/configure.in,v 1.402 2005/02/28 20:36:05 momjian Exp $
|
dnl $PostgreSQL: pgsql/configure.in,v 1.403 2005/02/28 20:55:18 tgl Exp $
|
||||||
dnl
|
dnl
|
||||||
dnl Developers, please strive to achieve this order:
|
dnl Developers, please strive to achieve this order:
|
||||||
dnl
|
dnl
|
||||||
@ -1066,6 +1066,15 @@ AC_MSG_ERROR([[
|
|||||||
[AC_MSG_RESULT([cross-compiling])])
|
[AC_MSG_RESULT([cross-compiling])])
|
||||||
|
|
||||||
|
|
||||||
|
# Force use of our snprintf if system's doesn't do arg control
|
||||||
|
if test $pgac_need_repl_snprintf = no; then
|
||||||
|
PGAC_FUNC_PRINTF_ARG_CONTROL
|
||||||
|
if test $pgac_cv_printf_arg_control != yes ; then
|
||||||
|
pgac_need_repl_snprintf=yes
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
dnl Check to see if we have a working 64-bit integer type.
|
dnl Check to see if we have a working 64-bit integer type.
|
||||||
dnl This breaks down into two steps:
|
dnl This breaks down into two steps:
|
||||||
dnl (1) figure out if the compiler has a 64-bit int type with working
|
dnl (1) figure out if the compiler has a 64-bit int type with working
|
||||||
@ -1104,18 +1113,6 @@ fi
|
|||||||
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
|
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
|
||||||
# work, fall back to our own snprintf emulation (which we know uses %lld).
|
# work, fall back to our own snprintf emulation (which we know uses %lld).
|
||||||
|
|
||||||
# Also force use of our snprintf if system's doesn't do arg control
|
|
||||||
if test $pgac_need_repl_snprintf = no; then
|
|
||||||
PGAC_FUNC_PRINTF_ARG_CONTROL
|
|
||||||
if test $pgac_cv_printf_arg_control != yes ; then
|
|
||||||
pgac_need_repl_snprintf=yes
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $pgac_need_repl_snprintf = yes; then
|
|
||||||
AC_LIBOBJ(snprintf)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
|
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
|
||||||
if test $pgac_need_repl_snprintf = no; then
|
if test $pgac_need_repl_snprintf = no; then
|
||||||
PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT
|
PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT
|
||||||
@ -1143,6 +1140,11 @@ AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT,
|
|||||||
AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT,
|
AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT,
|
||||||
[Define to the appropriate snprintf format for unsigned 64-bit ints, if any.])
|
[Define to the appropriate snprintf format for unsigned 64-bit ints, if any.])
|
||||||
|
|
||||||
|
# Now we have checked all the reasons to replace snprintf
|
||||||
|
if test $pgac_need_repl_snprintf = yes; then
|
||||||
|
AC_LIBOBJ(snprintf)
|
||||||
|
fi
|
||||||
|
|
||||||
# Need a #define for the size of Datum (unsigned long)
|
# Need a #define for the size of Datum (unsigned long)
|
||||||
AC_CHECK_SIZEOF([unsigned long])
|
AC_CHECK_SIZEOF([unsigned long])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user