Merge pull request #3000 from Rachid-Koucha/patch-11

Config: check for %m availability
This commit is contained in:
Christian Brauner 2019-05-13 13:18:54 +02:00 committed by GitHub
commit fa9aa1fabb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -637,6 +637,33 @@ AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat ge
# - STRERROR_R_CHAR_P if it returns char * # - STRERROR_R_CHAR_P if it returns char *
AC_FUNC_STRERROR_R AC_FUNC_STRERROR_R
# Check if "%m" is supported by printf and Co
AC_MSG_CHECKING([%m format])
AC_TRY_RUN([
#include <stdio.h>
int main(void)
{
char msg[256];
int rc;
rc = snprintf(msg, sizeof(msg), "%m\n");
if ((rc > 1) && (msg[0] != '%'))
{
return 0;
}
else
{
return 1;
}
}],
[fmt_m=yes], [fmt_m=no])
if test "x$fmt_m" = "xyes"; then
AC_DEFINE([HAVE_M_FORMAT], 1, [Have %m format])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
# Check for some functions # Check for some functions
AC_CHECK_LIB(pthread, main) AC_CHECK_LIB(pthread, main)
AC_CHECK_FUNCS(statvfs) AC_CHECK_FUNCS(statvfs)