]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: Use _POSIX_VERSION to determine support for %m
authorMichael Forney <mforney@mforney.org>
Thu, 3 Oct 2013 09:36:05 +0000 (02:36 -0700)
committerKarel Zak <kzak@redhat.com>
Fri, 4 Oct 2013 09:50:33 +0000 (11:50 +0200)
%m is included in POSIX 2008, so we can check if the libc implements
that before failing.

Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac

index cbcda46c845cb2199ccb0deb3a504bfef38cee83..95ff8b3d262464c73a7889794234b3cd3f9fb790 100644 (file)
@@ -430,6 +430,7 @@ AC_CACHE_VAL([scanf_cv_alloc_modifier],
 
     [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
      #include <stdio.h>
+     #include <unistd.h>
 
      #ifdef __GLIBC__
 
@@ -437,8 +438,13 @@ AC_CACHE_VAL([scanf_cv_alloc_modifier],
      #error %m is not available
      #endif
 
-     #else
+     #elif defined(_POSIX_VERSION)
 
+     #if _POSIX_VERSION < 200809L
+     #error %m is not available
+     #endif
+
+     #else
      #error Your C-library is not supported.
      #endif
      ])],