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

Commit1322791

Browse files
committed
We aren't supposed to try to run test programs until after we've
verified that AC_TRY_RUN works.
1 parente71d09a commit1322791

File tree

2 files changed

+150
-146
lines changed

2 files changed

+150
-146
lines changed

‎configure

Lines changed: 137 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -11574,84 +11574,6 @@ fi
1157411574

1157511575

1157611576

11577-
# SunOS doesn't handle negative byte comparisons properly with +/- return
11578-
echo "$as_me:$LINENO: checking for working memcmp" >&5
11579-
echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6
11580-
if test "${ac_cv_func_memcmp_working+set}" = set; then
11581-
echo $ECHO_N "(cached) $ECHO_C" >&6
11582-
else
11583-
if test "$cross_compiling" = yes; then
11584-
ac_cv_func_memcmp_working=no
11585-
else
11586-
cat >conftest.$ac_ext <<_ACEOF
11587-
#line $LINENO "configure"
11588-
#include "confdefs.h"
11589-
11590-
#ifdef F77_DUMMY_MAIN
11591-
# ifdef __cplusplus
11592-
extern "C"
11593-
# endif
11594-
int F77_DUMMY_MAIN() { return 1; }
11595-
#endif
11596-
int
11597-
main ()
11598-
{
11599-
11600-
/* Some versions of memcmp are not 8-bit clean. */
11601-
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
11602-
if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
11603-
exit (1);
11604-
11605-
/* The Next x86 OpenStep bug shows up only when comparing 16 bytes
11606-
or more and with at least one buffer not starting on a 4-byte boundary.
11607-
William Lewis provided this test program. */
11608-
{
11609-
char foo[21];
11610-
char bar[21];
11611-
int i;
11612-
for (i = 0; i < 4; i++)
11613-
{
11614-
char *a = foo + i;
11615-
char *b = bar + i;
11616-
strcpy (a, "--------01111111");
11617-
strcpy (b, "--------10000000");
11618-
if (memcmp (a, b, 16) >= 0)
11619-
exit (1);
11620-
}
11621-
exit (0);
11622-
}
11623-
11624-
;
11625-
return 0;
11626-
}
11627-
_ACEOF
11628-
rm -f conftest$ac_exeext
11629-
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
11630-
(eval $ac_link) 2>&5
11631-
ac_status=$?
11632-
echo "$as_me:$LINENO: \$? = $ac_status" >&5
11633-
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11634-
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11635-
(eval $ac_try) 2>&5
11636-
ac_status=$?
11637-
echo "$as_me:$LINENO: \$? = $ac_status" >&5
11638-
(exit $ac_status); }; }; then
11639-
ac_cv_func_memcmp_working=yes
11640-
else
11641-
echo "$as_me: program exited with status $ac_status" >&5
11642-
echo "$as_me: failed program was:" >&5
11643-
cat conftest.$ac_ext >&5
11644-
( exit $ac_status )
11645-
ac_cv_func_memcmp_working=no
11646-
fi
11647-
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11648-
fi
11649-
fi
11650-
echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
11651-
echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6
11652-
test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext"
11653-
11654-
1165511577

1165611578

1165711579

@@ -12002,7 +11924,7 @@ fi
1200211924
# We use our snprintf.c emulation if either snprintf() or vsnprintf()
1200311925
# is missing. Yes, there are machines that have only one. We may
1200411926
# also decide to use snprintf.c if snprintf() is present but does not
12005-
# haveworking "long long int" support-- see below.
11927+
# haveall the features we need --- see below.
1200611928

1200711929
pgac_need_repl_snprintf=no
1200811930

@@ -12162,61 +12084,6 @@ fi
1216212084
done
1216312085

1216412086

12165-
echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
12166-
echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
12167-
if test "${pgac_cv_printf_arg_control+set}" = set; then
12168-
echo $ECHO_N "(cached) $ECHO_C" >&6
12169-
else
12170-
if test "$cross_compiling" = yes; then
12171-
pgac_cv_printf_arg_control=cross
12172-
else
12173-
cat >conftest.$ac_ext <<_ACEOF
12174-
#line $LINENO "configure"
12175-
#include "confdefs.h"
12176-
#include <stdio.h>
12177-
#include <string.h>
12178-
12179-
int main()
12180-
{
12181-
char buf[100];
12182-
12183-
/* can it swap arguments? */
12184-
snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
12185-
if (strcmp(buf, "4 3") != 0)
12186-
return 1;
12187-
return 0;
12188-
}
12189-
_ACEOF
12190-
rm -f conftest$ac_exeext
12191-
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
12192-
(eval $ac_link) 2>&5
12193-
ac_status=$?
12194-
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12195-
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12196-
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12197-
(eval $ac_try) 2>&5
12198-
ac_status=$?
12199-
echo "$as_me:$LINENO: \$? = $ac_status" >&5
12200-
(exit $ac_status); }; }; then
12201-
pgac_cv_printf_arg_control=yes
12202-
else
12203-
echo "$as_me: program exited with status $ac_status" >&5
12204-
echo "$as_me: failed program was:" >&5
12205-
cat conftest.$ac_ext >&5
12206-
( exit $ac_status )
12207-
pgac_cv_printf_arg_control=no
12208-
fi
12209-
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12210-
fi
12211-
12212-
fi
12213-
echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5
12214-
echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6
12215-
12216-
# cross compiler should use our snprintf too
12217-
if test $pgac_cv_printf_arg_control != yes ; then
12218-
pgac_need_repl_snprintf=yes
12219-
fi
1222012087

1222112088
# Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
1222212089
# include/c.h will provide declarations. Note this is a separate test
@@ -15044,6 +14911,64 @@ cat >>confdefs.h <<_ACEOF
1504414911
_ACEOF
1504514912

1504614913

14914+
# Also force use of our snprintf if system's doesn't do arg control
14915+
if test $pgac_need_repl_snprintf = no; then
14916+
echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
14917+
echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
14918+
if test "${pgac_cv_printf_arg_control+set}" = set; then
14919+
echo $ECHO_N "(cached) $ECHO_C" >&6
14920+
else
14921+
if test "$cross_compiling" = yes; then
14922+
pgac_cv_printf_arg_control=cross
14923+
else
14924+
cat >conftest.$ac_ext <<_ACEOF
14925+
#line $LINENO "configure"
14926+
#include "confdefs.h"
14927+
#include <stdio.h>
14928+
#include <string.h>
14929+
14930+
int main()
14931+
{
14932+
char buf[100];
14933+
14934+
/* can it swap arguments? */
14935+
snprintf(buf, 100, "%2\$d %1\$d", 3, 4);
14936+
if (strcmp(buf, "4 3") != 0)
14937+
return 1;
14938+
return 0;
14939+
}
14940+
_ACEOF
14941+
rm -f conftest$ac_exeext
14942+
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
14943+
(eval $ac_link) 2>&5
14944+
ac_status=$?
14945+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14946+
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14947+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
14948+
(eval $ac_try) 2>&5
14949+
ac_status=$?
14950+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
14951+
(exit $ac_status); }; }; then
14952+
pgac_cv_printf_arg_control=yes
14953+
else
14954+
echo "$as_me: program exited with status $ac_status" >&5
14955+
echo "$as_me: failed program was:" >&5
14956+
cat conftest.$ac_ext >&5
14957+
( exit $ac_status )
14958+
pgac_cv_printf_arg_control=no
14959+
fi
14960+
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14961+
fi
14962+
14963+
fi
14964+
echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5
14965+
echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6
14966+
14967+
if test $pgac_cv_printf_arg_control != yes ; then
14968+
pgac_need_repl_snprintf=yes
14969+
fi
14970+
fi
14971+
1504714972
if test $pgac_need_repl_snprintf = yes; then
1504814973
LIBOBJS="$LIBOBJS snprintf.$ac_objext"
1504914974
fi
@@ -17947,6 +17872,84 @@ fi
1794717872

1794817873
fi
1794917874

17875+
# SunOS doesn't handle negative byte comparisons properly with +/- return
17876+
echo "$as_me:$LINENO: checking for working memcmp" >&5
17877+
echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6
17878+
if test "${ac_cv_func_memcmp_working+set}" = set; then
17879+
echo $ECHO_N "(cached) $ECHO_C" >&6
17880+
else
17881+
if test "$cross_compiling" = yes; then
17882+
ac_cv_func_memcmp_working=no
17883+
else
17884+
cat >conftest.$ac_ext <<_ACEOF
17885+
#line $LINENO "configure"
17886+
#include "confdefs.h"
17887+
17888+
#ifdef F77_DUMMY_MAIN
17889+
# ifdef __cplusplus
17890+
extern "C"
17891+
# endif
17892+
int F77_DUMMY_MAIN() { return 1; }
17893+
#endif
17894+
int
17895+
main ()
17896+
{
17897+
17898+
/* Some versions of memcmp are not 8-bit clean. */
17899+
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
17900+
if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
17901+
exit (1);
17902+
17903+
/* The Next x86 OpenStep bug shows up only when comparing 16 bytes
17904+
or more and with at least one buffer not starting on a 4-byte boundary.
17905+
William Lewis provided this test program. */
17906+
{
17907+
char foo[21];
17908+
char bar[21];
17909+
int i;
17910+
for (i = 0; i < 4; i++)
17911+
{
17912+
char *a = foo + i;
17913+
char *b = bar + i;
17914+
strcpy (a, "--------01111111");
17915+
strcpy (b, "--------10000000");
17916+
if (memcmp (a, b, 16) >= 0)
17917+
exit (1);
17918+
}
17919+
exit (0);
17920+
}
17921+
17922+
;
17923+
return 0;
17924+
}
17925+
_ACEOF
17926+
rm -f conftest$ac_exeext
17927+
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
17928+
(eval $ac_link) 2>&5
17929+
ac_status=$?
17930+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
17931+
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17932+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
17933+
(eval $ac_try) 2>&5
17934+
ac_status=$?
17935+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
17936+
(exit $ac_status); }; }; then
17937+
ac_cv_func_memcmp_working=yes
17938+
else
17939+
echo "$as_me: program exited with status $ac_status" >&5
17940+
echo "$as_me: failed program was:" >&5
17941+
cat conftest.$ac_ext >&5
17942+
( exit $ac_status )
17943+
ac_cv_func_memcmp_working=no
17944+
fi
17945+
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17946+
fi
17947+
fi
17948+
echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
17949+
echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6
17950+
test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext"
17951+
17952+
1795017953

1795117954
# Select semaphore implementation type.
1795217955
if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then

‎configure.in

Lines changed: 13 additions & 12 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.400 2005/02/22 03:55:12 momjian Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.401 2005/02/24 02:12:15 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -841,9 +841,6 @@ PGAC_VAR_INT_TIMEZONE
841841
AC_FUNC_ACCEPT_ARGTYPES
842842
PGAC_FUNC_GETTIMEOFDAY_1ARG
843843

844-
# SunOS doesn't handle negative byte comparisons properly with +/- return
845-
AC_FUNC_MEMCMP
846-
847844
AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs])
848845

849846
AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
@@ -875,17 +872,12 @@ fi
875872
# We use our snprintf.c emulation if either snprintf() or vsnprintf()
876873
# is missing. Yes, there are machines that have only one. We may
877874
# also decide to use snprintf.c if snprintf() is present but does not
878-
# haveworking "long long int" support-- see below.
875+
# haveall the features we need --- see below.
879876

880877
pgac_need_repl_snprintf=no
881878
AC_CHECK_FUNCS(snprintf, [], pgac_need_repl_snprintf=yes)
882879
AC_CHECK_FUNCS(vsnprintf, [], pgac_need_repl_snprintf=yes)
883880

884-
PGAC_FUNC_PRINTF_ARG_CONTROL
885-
# cross compiler should use our snprintf too
886-
if test $pgac_cv_printf_arg_control != yes ; then
887-
pgac_need_repl_snprintf=yes
888-
fi
889881

890882
# Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
891883
# include/c.h will provide declarations. Note this is a separate test
@@ -1074,8 +1066,6 @@ AC_MSG_ERROR([[
10741066
[AC_MSG_RESULT([cross-compiling])])
10751067

10761068

1077-
dnl 64-bit section
1078-
dnl
10791069
dnl Check to see if we have a working 64-bit integer type.
10801070
dnl This breaks down into two steps:
10811071
dnl (1) figure out if the compiler has a 64-bit int type with working
@@ -1141,6 +1131,14 @@ AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT,
11411131
AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT,
11421132
[Define to the appropriate snprintf format for unsigned 64-bit ints, if any.])
11431133

1134+
# Also force use of our snprintf if system's doesn't do arg control
1135+
if test $pgac_need_repl_snprintf = no; then
1136+
PGAC_FUNC_PRINTF_ARG_CONTROL
1137+
if test $pgac_cv_printf_arg_control != yes ; then
1138+
pgac_need_repl_snprintf=yes
1139+
fi
1140+
fi
1141+
11441142
if test $pgac_need_repl_snprintf = yes; then
11451143
AC_LIBOBJ(snprintf)
11461144
fi
@@ -1197,6 +1195,9 @@ if test $ac_cv_func_fseeko = yes; then
11971195
AC_SYS_LARGEFILE
11981196
fi
11991197

1198+
# SunOS doesn't handle negative byte comparisons properly with +/- return
1199+
AC_FUNC_MEMCMP
1200+
12001201

12011202
# Select semaphore implementation type.
12021203
if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp