]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: make the crosscompile path for scanf_cv_alloc_modifier clever
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 29 Feb 2012 21:26:19 +0000 (22:26 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 29 Mar 2012 13:16:14 +0000 (15:16 +0200)
My earlier assumption was that scanf_cv_alloc_modifier is unused. This
is not true as pointed out by Karel since it used befoe checking for
libmount. Argh. So instead saying no I add a test to check for glibc
>= 2.7 which provides %m. As of uClibc v0.9.32-rc3 the situation looks
the following:
| git grep _M_SPEC__
|libc/stdio/_vfprintf.c:/* #define __UCLIBC_HAS_PRINTF_M_SPEC__ */
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:# ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:# endif /* __UCLIBC_HAS_PRINTF_M_SPEC__ */
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/old_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/perror.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__

And other libc user have to bring their own stuff.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
configure.ac

index 9da5b24f95443c6a1a5892bb9337e705746c5a9c..0bfce275ff09788ed78e7c5895c2660975df8d19 100644 (file)
@@ -388,7 +388,23 @@ AC_CACHE_VAL([scanf_cv_alloc_modifier],
       [scanf_cv_alloc_modifier=no]
     )
     ,
-    [scanf_cv_alloc_modifier=no]
+
+    [AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+     #include <stdio.h>
+
+     #ifdef __GLIBC__
+
+     #if !(__GLIBC_PREREQ(2, 7))
+     #error %m is not available
+     #endif
+
+     #else
+
+     #error Your C-library is not supported.
+     #endif
+     ])],
+    [scanf_cv_alloc_modifier=ms],
+    [scanf_cv_alloc_modifier=no])]
   )
 )