diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2006-03-09 00:52:55 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2006-03-09 00:52:55 +0000 |
| commit | 6737f741ea45c0021af3d931abf36d9c5be073b3 (patch) | |
| tree | f816dbde634a011a6e3ed6e6d5ab037e1857dc8d /src | |
| parent | ef07f79fcd05088e323b2ad1c5fa1cba87fbd481 (diff) | |
* configure.in: Check for vsnprintf and vasprintf, and for positional
specification support in printf format strings.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17723 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/configure.in | 26 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8d40b20a9..471fa0fdd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-03-08 Ken Raeburn <raeburn@mit.edu> + + * configure.in: Check for vsnprintf and vasprintf, and for + positional specification support in printf format strings. + 2006-03-06 Ken Raeburn <raeburn@mit.edu> * configure.in: Don't check for dlopen here. Call diff --git a/src/configure.in b/src/configure.in index 63021d9f3..136404367 100644 --- a/src/configure.in +++ b/src/configure.in @@ -56,7 +56,7 @@ LIBUTIL=-lutil AC_SUBST(LIBUTIL) dnl for kdc AC_CHECK_HEADERS(syslog.h stdarg.h sys/select.h sys/sockio.h ifaddrs.h unistd.h) -AC_CHECK_FUNCS(openlog syslog closelog strftime vsprintf) +AC_CHECK_FUNCS(openlog syslog closelog strftime vsprintf vasprintf vsnprintf) KRB5_NEED_PROTO([#include <string.h> #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -496,6 +496,30 @@ AC_CHECK_TYPES([uint32_t, int32_t, uint64_t, int64_t, uint_least32_t, uintptr_t, #endif ]) dnl +dnl Test for POSIX 2001 *printf support (X/Open System Interfaces extension +dnl to ANSI/ISO C 1999 specification). Specifically, positional +dnl specifications; not checking for other features like %zx at present. +AC_MSG_CHECKING(for POSIX printf positional specification support) +AC_CACHE_VAL(ac_cv_printf_positional,[ +AC_TRY_RUN([ +#include <stdio.h> +#include <string.h> +const char expected[] = "200 100"; +int main () { + char buf[30]; + sprintf(buf, "%2\$x %1\$d", 100, 512); + if (strcmp(expected, buf)) { + fprintf(stderr,"bad result: <%s> wanted: <%s>\n", buf, expected); + return 1; + } + return 0; +}], + ac_cv_printf_positional=yes, + ac_cv_printf_positional=no, + AC_MSG_ERROR([Cannot test for printf positional argument support when cross compiling]))]) +dnl Nothing for autoconf.h for now. +AC_MSG_RESULT($ac_cv_printf_positional) +dnl dnl dnl Check for thread safety issues. dnl (Is there a better place for this?) |
