From 5009ee7b13623efc0ad88a7dc0b16e04921c4241 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 4 Nov 1998 23:29:52 +0000 Subject: [PATCH] Add tests for vsnprintf and snprintf. --- configure | 94 ++++++++++++++++++++++++++++++++++++------- configure.in | 11 +++++ include/portable.h.in | 6 +++ include/portable.h.nt | 8 +++- 4 files changed, 103 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 2b83e44f7f..042120049f 100755 --- a/configure +++ b/configure @@ -6142,8 +6142,67 @@ fi fi + +if test $ac_cv_func_vprintf = yes ; then + for ac_func in vsnprintf +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:6151: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* 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 $ac_func(); + +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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +fi + echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 -echo "configure:6147: checking for wait3 that fills in rusage" >&5 +echo "configure:6206: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6151,7 +6210,7 @@ else ac_cv_func_wait3_rusage=no else cat > conftest.$ac_ext < #include @@ -6182,7 +6241,7 @@ main() { } } EOF -if { (eval echo configure:6186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes else @@ -6222,6 +6281,7 @@ for ac_func in \ setsid \ signal \ sigset \ + snprintf \ socket \ strerror \ strstr \ @@ -6236,12 +6296,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6240: checking for $ac_func" >&5 +echo "configure:6300: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6292,12 +6352,12 @@ done for ac_func in getopt strdup tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6296: checking for $ac_func" >&5 +echo "configure:6356: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6350,13 +6410,13 @@ done # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:6354: checking declaration of sys_errlist" >&5 +echo "configure:6414: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6366,7 +6426,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:6370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes else @@ -6387,20 +6447,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:6391: checking existence of sys_errlist" >&5 +echo "configure:6451: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:6404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ol_cv_have_sys_errlist=yes else @@ -6529,6 +6589,10 @@ if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \ BUILD_SLURPD=yes fi +if test $ol_enable_ldapd != no ; then + BUILD_SLURPD=yes +fi + diff --git a/configure.in b/configure.in index 71e560a72a..04529dd225 100644 --- a/configure.in +++ b/configure.in @@ -803,6 +803,12 @@ dnl Checks for library functions. AC_FUNC_MEMCMP AC_FUNC_STRFTIME AC_FUNC_VPRINTF + +if test $ac_cv_func_vprintf = yes ; then + dnl check for vsnprintf + AC_CHECK_FUNCS(vsnprintf) +fi + AC_FUNC_WAIT3 AC_CHECK_FUNCS( \ @@ -822,6 +828,7 @@ AC_CHECK_FUNCS( \ setsid \ signal \ sigset \ + snprintf \ socket \ strerror \ strstr \ @@ -911,6 +918,10 @@ if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \ BUILD_SLURPD=yes fi +if test $ol_enable_ldapd != no ; then + BUILD_SLURPD=yes +fi + dnl ---------------------------------------------------------------- AC_SUBST(BUILD_LDAPD) diff --git a/include/portable.h.in b/include/portable.h.in index 62b316c5a2..7c5937824a 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -290,6 +290,9 @@ is provided ``as is'' without express or implied warranty. /* Define if you have the sigset function. */ #undef HAVE_SIGSET +/* Define if you have the snprintf function. */ +#undef HAVE_SNPRINTF + /* Define if you have the socket function. */ #undef HAVE_SOCKET @@ -323,6 +326,9 @@ is provided ``as is'' without express or implied warranty. /* Define if you have the tempnam function. */ #undef HAVE_TEMPNAM +/* Define if you have the vsnprintf function. */ +#undef HAVE_VSNPRINTF + /* Define if you have the waitpid function. */ #undef HAVE_WAITPID diff --git a/include/portable.h.nt b/include/portable.h.nt index 43502973c1..64e86cbb35 100644 --- a/include/portable.h.nt +++ b/include/portable.h.nt @@ -1,5 +1,5 @@ /* include/portable.h.nt -- manually updated of MS NT (MS VC5) */ -/* synced with portable.h.in 1.5 */ +/* synced with portable.h.in 1.6 */ /* Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA All rights reserved. @@ -89,6 +89,9 @@ typedef char * caddr_t; /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 +/* Define if you have the vsnprintf function. */ +/* #undef HAVE_VSNPRINTF */ + /* Define if you have the wait3 system call. */ /* #undef HAVE_WAIT3 */ @@ -315,6 +318,9 @@ typedef char * caddr_t; /* Define if you have the sigset function. */ /* #undef HAVE_SIGSET */ +/* Define if you have the snprintf function. */ +/* #undef HAVE_SNPRINTF */ + /* Define if you have the socket function. */ #define HAVE_SOCKET 1 -- 2.39.5