Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5c4a91c

Browse files
committed
Un-break configure snprintf tests (partly my fault, partly Bruce's).
1 parentf1430ce commit5c4a91c

File tree

2 files changed

+79
-75
lines changed

2 files changed

+79
-75
lines changed

‎configure

Lines changed: 64 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -14526,6 +14526,65 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
1452614526
fi
1452714527

1452814528

14529+
# Force use of our snprintf if system's doesn't do arg control
14530+
if test $pgac_need_repl_snprintf = no; then
14531+
echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
14532+
echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
14533+
if test "${pgac_cv_printf_arg_control+set}" = set; then
14534+
echo $ECHO_N "(cached) $ECHO_C" >&6
14535+
else
14536+
if test "$cross_compiling" = yes; then
14537+
pgac_cv_printf_arg_control=cross
14538+
else
14539+
cat >conftest.$ac_ext <<_ACEOF
14540+
#line $LINENO "configure"
14541+
#include "confdefs.h"
14542+
#include <stdio.h>
14543+
#include <string.h>
14544+
14545+
int main()
14546+
{
14547+
char buf[100];
14548+
14549+
/* can it swap arguments? */
14550+
snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
14551+
if (strcmp(buf, "4 3") != 0)
14552+
return 1;
14553+
return 0;
14554+
}
14555+
_ACEOF
14556+
rm -f conftest$ac_exeext
14557+
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
14558+
(eval $ac_link) 2>&5
14559+
ac_status=$?
14560+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14561+
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14562+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
14563+
(eval $ac_try) 2>&5
14564+
ac_status=$?
14565+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14566+
(exit $ac_status); }; }; then
14567+
pgac_cv_printf_arg_control=yes
14568+
else
14569+
echo "$as_me: program exited with status $ac_status" >&5
14570+
echo "$as_me: failed program was:" >&5
14571+
cat conftest.$ac_ext >&5
14572+
( exit $ac_status )
14573+
pgac_cv_printf_arg_control=no
14574+
fi
14575+
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14576+
fi
14577+
14578+
fi
14579+
echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5
14580+
echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6
14581+
14582+
if test $pgac_cv_printf_arg_control != yes ; then
14583+
pgac_need_repl_snprintf=yes
14584+
fi
14585+
fi
14586+
14587+
1452914588

1453014589
echo "$as_me:$LINENO: checking whether long int is 64 bits" >&5
1453114590
echo $ECHO_N "checking whether long int is 64 bits... $ECHO_C" >&6
@@ -14809,68 +14868,6 @@ fi
1480914868
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
1481014869
# work, fall back to our own snprintf emulation (which we know uses %lld).
1481114870

14812-
# Also force use of our snprintf if system's doesn't do arg control
14813-
if test $pgac_need_repl_snprintf = no; then
14814-
echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
14815-
echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
14816-
if test "${pgac_cv_printf_arg_control+set}" = set; then
14817-
echo $ECHO_N "(cached) $ECHO_C" >&6
14818-
else
14819-
if test "$cross_compiling" = yes; then
14820-
pgac_cv_printf_arg_control=cross
14821-
else
14822-
cat >conftest.$ac_ext <<_ACEOF
14823-
#line $LINENO "configure"
14824-
#include "confdefs.h"
14825-
#include <stdio.h>
14826-
#include <string.h>
14827-
14828-
int main()
14829-
{
14830-
char buf[100];
14831-
14832-
/* can it swap arguments? */
14833-
snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
14834-
if (strcmp(buf, "4 3") != 0)
14835-
return 1;
14836-
return 0;
14837-
}
14838-
_ACEOF
14839-
rm -f conftest$ac_exeext
14840-
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
14841-
(eval $ac_link) 2>&5
14842-
ac_status=$?
14843-
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14844-
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14845-
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
14846-
(eval $ac_try) 2>&5
14847-
ac_status=$?
14848-
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14849-
(exit $ac_status); }; }; then
14850-
pgac_cv_printf_arg_control=yes
14851-
else
14852-
echo "$as_me: program exited with status $ac_status" >&5
14853-
echo "$as_me: failed program was:" >&5
14854-
cat conftest.$ac_ext >&5
14855-
( exit $ac_status )
14856-
pgac_cv_printf_arg_control=no
14857-
fi
14858-
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14859-
fi
14860-
14861-
fi
14862-
echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5
14863-
echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6
14864-
14865-
if test $pgac_cv_printf_arg_control != yes ; then
14866-
pgac_need_repl_snprintf=yes
14867-
fi
14868-
fi
14869-
14870-
if test $pgac_need_repl_snprintf = yes; then
14871-
LIBOBJS="$LIBOBJS snprintf.$ac_objext"
14872-
fi
14873-
1487414871
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
1487514872
if test $pgac_need_repl_snprintf = no; then
1487614873
echo "$as_me:$LINENO: checking snprintf format for long long int" >&5
@@ -14973,6 +14970,11 @@ cat >>confdefs.h <<_ACEOF
1497314970
_ACEOF
1497414971

1497514972

14973+
# Now we have checked all the reasons to replace snprintf
14974+
if test $pgac_need_repl_snprintf = yes; then
14975+
LIBOBJS="$LIBOBJS snprintf.$ac_objext"
14976+
fi
14977+
1497614978
# Need a #define for the size of Datum (unsigned long)
1497714979
echo "$as_me:$LINENO: checking for unsigned long" >&5
1497814980
echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6

‎configure.in

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.402 2005/02/28 20:36:05 momjian Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.403 2005/02/28 20:55:18 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -1066,6 +1066,15 @@ AC_MSG_ERROR([[
10661066
[AC_MSG_RESULT([cross-compiling])])
10671067

10681068

1069+
# Force use of our snprintf if system's doesn't do arg control
1070+
if test $pgac_need_repl_snprintf = no; then
1071+
PGAC_FUNC_PRINTF_ARG_CONTROL
1072+
if test $pgac_cv_printf_arg_control != yes ; then
1073+
pgac_need_repl_snprintf=yes
1074+
fi
1075+
fi
1076+
1077+
10691078
dnl Check to see if we have a working 64-bit integer type.
10701079
dnl This breaks down into two steps:
10711080
dnl (1) figure out if the compiler has a 64-bit int type with working
@@ -1104,18 +1113,6 @@ fi
11041113
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
11051114
# work, fall back to our own snprintf emulation (which we know uses %lld).
11061115

1107-
# Also force use of our snprintf if system's doesn't do arg control
1108-
if test $pgac_need_repl_snprintf = no; then
1109-
PGAC_FUNC_PRINTF_ARG_CONTROL
1110-
if test $pgac_cv_printf_arg_control != yes ; then
1111-
pgac_need_repl_snprintf=yes
1112-
fi
1113-
fi
1114-
1115-
if test $pgac_need_repl_snprintf = yes; then
1116-
AC_LIBOBJ(snprintf)
1117-
fi
1118-
11191116
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
11201117
if test $pgac_need_repl_snprintf = no; then
11211118
PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT
@@ -1143,6 +1140,11 @@ AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT,
11431140
AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT,
11441141
[Define to the appropriate snprintf format for unsigned 64-bit ints, if any.])
11451142

1143+
# Now we have checked all the reasons to replace snprintf
1144+
if test $pgac_need_repl_snprintf = yes; then
1145+
AC_LIBOBJ(snprintf)
1146+
fi
1147+
11461148
# Need a #define for the size of Datum (unsigned long)
11471149
AC_CHECK_SIZEOF([unsigned long])
11481150

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp