aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-01-17 03:22:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-01-17 03:22:52 +0000
commit7fab608205e7a29b2a9bcd344e409edbb4cea6e3 (patch)
treee0bcefb8166f240cc23212f418057deee6853784
parentcd6bc85aa2f847d49660d2d09c97c72d2bbe1ef1 (diff)
downloadpostgresql-7fab608205e7a29b2a9bcd344e409edbb4cea6e3.tar.gz
postgresql-7fab608205e7a29b2a9bcd344e409edbb4cea6e3.zip
Add configure test to see whether vsnprintf() is present,
separately from snprintf() --- HPUX, for one, has snprintf but not vsnprintf. Fix a minor typo in snprintf.c, too.
-rw-r--r--src/backend/port/snprintf.c4
-rwxr-xr-xsrc/configure254
-rw-r--r--src/configure.in5
-rw-r--r--src/include/c.h21
-rw-r--r--src/include/config.h.in3
-rw-r--r--src/include/port/hpux.h8
6 files changed, 190 insertions, 105 deletions
diff --git a/src/backend/port/snprintf.c b/src/backend/port/snprintf.c
index 5b541965b53..c49df449423 100644
--- a/src/backend/port/snprintf.c
+++ b/src/backend/port/snprintf.c
@@ -73,7 +73,7 @@ typedef unsigned long long ulong_long;
* causing nast effects.
**************************************************************/
-/*static char _id[] = "$Id: snprintf.c,v 1.15 1998/12/24 05:28:50 momjian Exp $";*/
+/*static char _id[] = "$Id: snprintf.c,v 1.16 1999/01/17 03:22:49 tgl Exp $";*/
static char *end;
static int SnprfOverflow;
@@ -115,7 +115,7 @@ vsnprintf(char *str, size_t count, const char *fmt, va_list args)
static void fmtstr __P((char *value, int ljust, int len, int zpad, int maxwidth));
-#ifndef HAVE_LONG_INT_64
+#ifndef HAVE_LONG_LONG_INT_64
static void fmtnum __P((long value, int base, int dosign, int ljust, int len, int zpad));
#else
static void fmtnum __P((long_long value, int base, int dosign, int ljust, int len, int zpad));
diff --git a/src/configure b/src/configure
index 5b97ae82c7a..e4d2d008a8d 100755
--- a/src/configure
+++ b/src/configure
@@ -4496,14 +4496,66 @@ else
SNPRINTF='snprintf.o'
fi
+echo $ac_n "checking for vsnprintf""... $ac_c" 1>&6
+echo "configure:4501: checking for vsnprintf" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vsnprintf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4506 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char vsnprintf(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char vsnprintf();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_vsnprintf) || defined (__stub___vsnprintf)
+choke me
+#else
+vsnprintf();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_vsnprintf=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_vsnprintf=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'vsnprintf`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_VSNPRINTF 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+SNPRINTF='snprintf.o'
+fi
+
echo $ac_n "checking for isinf""... $ac_c" 1>&6
-echo "configure:4502: checking for isinf" >&5
+echo "configure:4554: checking for isinf" >&5
if eval "test \"`echo '$''{'ac_cv_func_isinf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4507 "configure"
+#line 4559 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char isinf(); below. */
@@ -4526,7 +4578,7 @@ isinf();
; return 0; }
EOF
-if { (eval echo configure:4530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_isinf=yes"
else
@@ -4551,12 +4603,12 @@ fi
echo $ac_n "checking for getrusage""... $ac_c" 1>&6
-echo "configure:4555: checking for getrusage" >&5
+echo "configure:4607: checking for getrusage" >&5
if eval "test \"`echo '$''{'ac_cv_func_getrusage'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4560 "configure"
+#line 4612 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char getrusage(); below. */
@@ -4579,7 +4631,7 @@ getrusage();
; return 0; }
EOF
-if { (eval echo configure:4583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_getrusage=yes"
else
@@ -4604,12 +4656,12 @@ fi
echo $ac_n "checking for srandom""... $ac_c" 1>&6
-echo "configure:4608: checking for srandom" >&5
+echo "configure:4660: checking for srandom" >&5
if eval "test \"`echo '$''{'ac_cv_func_srandom'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4613 "configure"
+#line 4665 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char srandom(); below. */
@@ -4632,7 +4684,7 @@ srandom();
; return 0; }
EOF
-if { (eval echo configure:4636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_srandom=yes"
else
@@ -4657,12 +4709,12 @@ fi
echo $ac_n "checking for gethostname""... $ac_c" 1>&6
-echo "configure:4661: checking for gethostname" >&5
+echo "configure:4713: checking for gethostname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4666 "configure"
+#line 4718 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostname(); below. */
@@ -4685,7 +4737,7 @@ gethostname();
; return 0; }
EOF
-if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_gethostname=yes"
else
@@ -4710,12 +4762,12 @@ fi
echo $ac_n "checking for random""... $ac_c" 1>&6
-echo "configure:4714: checking for random" >&5
+echo "configure:4766: checking for random" >&5
if eval "test \"`echo '$''{'ac_cv_func_random'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4719 "configure"
+#line 4771 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char random(); below. */
@@ -4738,7 +4790,7 @@ random();
; return 0; }
EOF
-if { (eval echo configure:4742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_random=yes"
else
@@ -4763,12 +4815,12 @@ fi
echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:4767: checking for inet_aton" >&5
+echo "configure:4819: checking for inet_aton" >&5
if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4772 "configure"
+#line 4824 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char inet_aton(); below. */
@@ -4791,7 +4843,7 @@ inet_aton();
; return 0; }
EOF
-if { (eval echo configure:4795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_inet_aton=yes"
else
@@ -4816,12 +4868,12 @@ fi
echo $ac_n "checking for strerror""... $ac_c" 1>&6
-echo "configure:4820: checking for strerror" >&5
+echo "configure:4872: checking for strerror" >&5
if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4825 "configure"
+#line 4877 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strerror(); below. */
@@ -4844,7 +4896,7 @@ strerror();
; return 0; }
EOF
-if { (eval echo configure:4848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_strerror=yes"
else
@@ -4870,12 +4922,12 @@ fi
echo $ac_n "checking for strdup""... $ac_c" 1>&6
-echo "configure:4874: checking for strdup" >&5
+echo "configure:4926: checking for strdup" >&5
if eval "test \"`echo '$''{'ac_cv_func_strdup'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4879 "configure"
+#line 4931 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strdup(); below. */
@@ -4898,7 +4950,7 @@ strdup();
; return 0; }
EOF
-if { (eval echo configure:4902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_strdup=yes"
else
@@ -4923,12 +4975,12 @@ fi
echo $ac_n "checking for strtol""... $ac_c" 1>&6
-echo "configure:4927: checking for strtol" >&5
+echo "configure:4979: checking for strtol" >&5
if eval "test \"`echo '$''{'ac_cv_func_strtol'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4932 "configure"
+#line 4984 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strtol(); below. */
@@ -4951,7 +5003,7 @@ strtol();
; return 0; }
EOF
-if { (eval echo configure:4955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_strtol=yes"
else
@@ -4976,12 +5028,12 @@ fi
echo $ac_n "checking for strtoul""... $ac_c" 1>&6
-echo "configure:4980: checking for strtoul" >&5
+echo "configure:5032: checking for strtoul" >&5
if eval "test \"`echo '$''{'ac_cv_func_strtoul'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4985 "configure"
+#line 5037 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strtoul(); below. */
@@ -5004,7 +5056,7 @@ strtoul();
; return 0; }
EOF
-if { (eval echo configure:5008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_strtoul=yes"
else
@@ -5029,12 +5081,12 @@ fi
echo $ac_n "checking for strcasecmp""... $ac_c" 1>&6
-echo "configure:5033: checking for strcasecmp" >&5
+echo "configure:5085: checking for strcasecmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_strcasecmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5038 "configure"
+#line 5090 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strcasecmp(); below. */
@@ -5057,7 +5109,7 @@ strcasecmp();
; return 0; }
EOF
-if { (eval echo configure:5061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_strcasecmp=yes"
else
@@ -5082,12 +5134,12 @@ fi
echo $ac_n "checking for cbrt""... $ac_c" 1>&6
-echo "configure:5086: checking for cbrt" >&5
+echo "configure:5138: checking for cbrt" >&5
if eval "test \"`echo '$''{'ac_cv_func_cbrt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5091 "configure"
+#line 5143 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char cbrt(); below. */
@@ -5110,7 +5162,7 @@ cbrt();
; return 0; }
EOF
-if { (eval echo configure:5114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_cbrt=yes"
else
@@ -5131,7 +5183,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for cbrt in -lm""... $ac_c" 1>&6
-echo "configure:5135: checking for cbrt in -lm" >&5
+echo "configure:5187: checking for cbrt in -lm" >&5
ac_lib_var=`echo m'_'cbrt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5139,7 +5191,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5143 "configure"
+#line 5195 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5150,7 +5202,7 @@ int main() {
cbrt()
; return 0; }
EOF
-if { (eval echo configure:5154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5180,12 +5232,12 @@ fi
# this hackery with HPUXMATHLIB allows us to cope.
HPUXMATHLIB=""
echo $ac_n "checking for rint""... $ac_c" 1>&6
-echo "configure:5184: checking for rint" >&5
+echo "configure:5236: checking for rint" >&5
if eval "test \"`echo '$''{'ac_cv_func_rint'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5189 "configure"
+#line 5241 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char rint(); below. */
@@ -5208,7 +5260,7 @@ rint();
; return 0; }
EOF
-if { (eval echo configure:5212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_rint=yes"
else
@@ -5233,7 +5285,7 @@ if [ -r /lib/pa1.1/libm.a ] ; then
HPUXMATHLIB="-L /lib/pa1.1 -lm"
fi
echo $ac_n "checking for rint in -lm""... $ac_c" 1>&6
-echo "configure:5237: checking for rint in -lm" >&5
+echo "configure:5289: checking for rint in -lm" >&5
ac_lib_var=`echo m'_'rint | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5241,7 +5293,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $HPUXMATHLIB $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5245 "configure"
+#line 5297 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5252,7 +5304,7 @@ int main() {
rint()
; return 0; }
EOF
-if { (eval echo configure:5256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5282,9 +5334,9 @@ fi
echo $ac_n "checking for POSIX signal interface""... $ac_c" 1>&6
-echo "configure:5286: checking for POSIX signal interface" >&5
+echo "configure:5338: checking for POSIX signal interface" >&5
cat > conftest.$ac_ext <<EOF
-#line 5288 "configure"
+#line 5340 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {
@@ -5294,7 +5346,7 @@ act.sa_flags = SA_RESTART;
sigaction(0, &act, &oact);
; return 0; }
EOF
-if { (eval echo configure:5298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define USE_POSIX_SIGNALS 1
@@ -5318,7 +5370,7 @@ then
# Extract the first word of "tclsh", so it can be a program name with args.
set dummy tclsh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5322: checking for $ac_word" >&5
+echo "configure:5374: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5351,7 +5403,7 @@ fi
# Extract the first word of "tcl", so it can be a program name with args.
set dummy tcl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5355: checking for $ac_word" >&5
+echo "configure:5407: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5390,7 +5442,7 @@ fi
if test "$USE_TCL" = true
then
echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6
-echo "configure:5394: checking for tclConfig.sh" >&5
+echo "configure:5446: checking for tclConfig.sh" >&5
TCL_CONFIG_SH=
library_dirs=
if test -z "$TCL_DIRS"
@@ -5419,7 +5471,7 @@ USE_TK=$USE_TCL # If TCL is disabled, disable TK
if test "$USE_TK" = true
then
echo $ac_n "checking for tkConfig.sh""... $ac_c" 1>&6
-echo "configure:5423: checking for tkConfig.sh" >&5
+echo "configure:5475: checking for tkConfig.sh" >&5
TK_CONFIG_SH=
# library_dirs are set in the check for TCL
for dir in $library_dirs
@@ -5456,7 +5508,7 @@ if test "$USE_X" = true; then
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:5460: checking for X" >&5
+echo "configure:5512: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -5518,12 +5570,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 5522 "configure"
+#line 5574 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5592,14 +5644,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5596 "configure"
+#line 5648 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:5603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -5705,17 +5757,17 @@ else
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:5709: checking whether -R must be followed by a space" >&5
+echo "configure:5761: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 5712 "configure"
+#line 5764 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:5719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_nospace=yes
else
@@ -5731,14 +5783,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 5735 "configure"
+#line 5787 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:5742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_space=yes
else
@@ -5770,7 +5822,7 @@ rm -f conftest*
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:5774: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:5826: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5778,7 +5830,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5782 "configure"
+#line 5834 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5789,7 +5841,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:5793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5811,7 +5863,7 @@ fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:5815: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:5867: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5819,7 +5871,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5823 "configure"
+#line 5875 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5830,7 +5882,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:5834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5859,12 +5911,12 @@ fi
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:5863: checking for gethostbyname" >&5
+echo "configure:5915: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5868 "configure"
+#line 5920 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -5887,7 +5939,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:5891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -5908,7 +5960,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:5912: checking for gethostbyname in -lnsl" >&5
+echo "configure:5964: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5916,7 +5968,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5920 "configure"
+#line 5972 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -5927,7 +5979,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:5931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5957,12 +6009,12 @@ fi
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:5961: checking for connect" >&5
+echo "configure:6013: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5966 "configure"
+#line 6018 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -5985,7 +6037,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:5989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@@ -6006,7 +6058,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:6010: checking for connect in -lsocket" >&5
+echo "configure:6062: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6014,7 +6066,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6018 "configure"
+#line 6070 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6025,7 +6077,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:6029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6049,12 +6101,12 @@ fi
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:6053: checking for remove" >&5
+echo "configure:6105: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6058 "configure"
+#line 6110 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@@ -6077,7 +6129,7 @@ remove();
; return 0; }
EOF
-if { (eval echo configure:6081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
@@ -6098,7 +6150,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:6102: checking for remove in -lposix" >&5
+echo "configure:6154: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6106,7 +6158,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6110 "configure"
+#line 6162 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6117,7 +6169,7 @@ int main() {
remove()
; return 0; }
EOF
-if { (eval echo configure:6121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6141,12 +6193,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:6145: checking for shmat" >&5
+echo "configure:6197: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6150 "configure"
+#line 6202 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@@ -6169,7 +6221,7 @@ shmat();
; return 0; }
EOF
-if { (eval echo configure:6173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
@@ -6190,7 +6242,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:6194: checking for shmat in -lipc" >&5
+echo "configure:6246: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6198,7 +6250,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6202 "configure"
+#line 6254 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6209,7 +6261,7 @@ int main() {
shmat()
; return 0; }
EOF
-if { (eval echo configure:6213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6242,7 +6294,7 @@ fi
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:6246: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:6298: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6250,7 +6302,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6254 "configure"
+#line 6306 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6261,7 +6313,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:6265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6294,7 +6346,7 @@ fi
X11_LIBS=""
echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:6298: checking for XOpenDisplay in -lX11" >&5
+echo "configure:6350: checking for XOpenDisplay in -lX11" >&5
ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -6302,7 +6354,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lX11 ${X_PRE_LIBS} $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6306 "configure"
+#line 6358 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -6313,7 +6365,7 @@ int main() {
XOpenDisplay()
; return 0; }
EOF
-if { (eval echo configure:6317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:6369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -6360,17 +6412,17 @@ then
PWD_INCDIR=no
ac_safe=`echo "pwd.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pwd.h""... $ac_c" 1>&6
-echo "configure:6364: checking for pwd.h" >&5
+echo "configure:6416: checking for pwd.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6369 "configure"
+#line 6421 "configure"
#include "confdefs.h"
#include <pwd.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
diff --git a/src/configure.in b/src/configure.in
index 307e7fe2f2b..71c9c4749f0 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -695,9 +695,14 @@ AC_FUNC_VPRINTF
AC_CHECK_FUNCS(tzset memmove sigsetjmp kill sysconf fpclass)
AC_CHECK_FUNCS(fp_class fp_class_d class)
AC_CHECK_FUNCS(sigprocmask waitpid setsid fcvt)
+dnl We use our snprintf.c emulation if either snprintf() or vsnprintf()
+dnl is missing. Yes, there are machines that have only one.
AC_CHECK_FUNC(snprintf,
AC_DEFINE(HAVE_SNPRINTF),
SNPRINTF='snprintf.o')
+AC_CHECK_FUNC(vsnprintf,
+ AC_DEFINE(HAVE_VSNPRINTF),
+ SNPRINTF='snprintf.o')
AC_SUBST(SNPRINTF)
AC_CHECK_FUNC(isinf,
AC_DEFINE(HAVE_ISINF),
diff --git a/src/include/c.h b/src/include/c.h
index cd7ecb9de24..0432d819406 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: c.h,v 1.47 1998/12/13 03:44:38 momjian Exp $
+ * $Id: c.h,v 1.48 1999/01/17 03:22:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -45,9 +45,13 @@
/* We have to include stdlib.h here because it defines many of these macros
on some platforms, and we only want our definitions used if stdlib.h doesn't
- have its own.
+ have its own. The same goes for stddef and stdarg if present.
*/
#include <stdlib.h>
+#ifdef STDC_HEADERS
+#include <stddef.h>
+#include <stdarg.h>
+#endif
/* ----------------------------------------------------------------
* Section 1: bool, true, false, TRUE, FALSE
@@ -820,6 +824,19 @@ extern char *form(const char *fmt,...);
#define COPY_CMD "cp"
#define SEP_CHAR '/'
+/* Provide prototypes for routines not present in a particular machine's
+ * standard C library. It'd be better to put these in config.h, but
+ * in config.h we haven't yet included anything that defines size_t...
+ */
+
+#ifndef HAVE_SNPRINTF
+extern int snprintf(char *str, size_t count, const char *fmt, ...);
+#endif
+
+#ifndef HAVE_VSNPRINTF
+extern int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
+#endif
+
/* ----------------
* end of c.h
* ----------------
diff --git a/src/include/config.h.in b/src/include/config.h.in
index 3a54c89c1ff..3ab45d0a73e 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -118,6 +118,9 @@
/* Set to 1 if you have snprintf() */
#undef HAVE_SNPRINTF
+/* Set to 1 if you have vsnprintf() */
+#undef HAVE_VSNPRINTF
+
/* Set to 1 if you have fp_class() */
#undef HAVE_FP_CLASS
diff --git a/src/include/port/hpux.h b/src/include/port/hpux.h
index 4ef01af0958..0c42e6c4b76 100644
--- a/src/include/port/hpux.h
+++ b/src/include/port/hpux.h
@@ -6,6 +6,14 @@ typedef struct
int sema[4];
} slock_t;
+/* HPUX 9 has snprintf in the library, so configure will set HAVE_SNPRINTF;
+ * but it doesn't provide a prototype for it. To suppress warning messages
+ * from gcc, do this to make c.h provide the prototype:
+ */
+#ifndef HAVE_VSNPRINTF
+#undef HAVE_SNPRINTF
+#endif
+
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif