public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 1/2] conifigure: add a crosscompile path for scanf_cv_alloc_modifier
Date: Wed, 29 Feb 2012 22:31:28 +0100	[thread overview]
Message-ID: <20120229213128.GA11628@linutronix.de> (raw)
In-Reply-To: <20120228141226.GC22034@x2.net.home>

* Karel Zak | 2012-02-28 15:12:26 [+0100]:

>> @@ -387,6 +387,8 @@ AC_CACHE_VAL([scanf_cv_alloc_modifier],
>>        [scanf_cv_alloc_modifier=as],
>>        [scanf_cv_alloc_modifier=no]
>>      )
>> +    ,
>> +    [scanf_cv_alloc_modifier=no]
>>    )
>>  )
>
> Applied, thanks.
>
> ...but it means that you will compile the package without libmount.
> Is it expected? In the next release fsck will depend on the library,
> we have new mount and umount, ....
>
> Is it really true that your glibc is without %as / %ms ?

So I've been greping for have_scanf_alloc_modifier and did not find a
user. Well now that you mentioned, I see a user in configure.... So now
we need something like a proper fix hmm.... What about this:
- you don't want %as as it is non-standard evil
- %m is good enough an available since glibc 2.7. Why should someone
  take old glibc (2.7 was released Thu Oct 18 00:09:32 2007 +0000) and
  new util-linux?
- uClibc seems not to support it. The code seems to be behind an ifdef
  and the define itseld is hidden in a comment

If this is okay then what about:

>From 921475f1b5f11699bc311c0f1c94d5da830edfd6 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed, 29 Feb 2012 22:26:19 +0100
Subject: [PATCH] build-sys: make the crosscompile path for
 scanf_cv_alloc_modifier clever

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 |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index b40a636..0a3016b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -384,7 +384,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])]
   )
 )
 
-- 
1.7.9

Which results in:
| grep -E "%m|mount" log
|checking scanf string alloc modifiers... (%ms) yes
|config.status: creating libmount/Makefile
|config.status: creating libmount/docs/Makefile
|config.status: creating libmount/docs/version.xml
|config.status: creating libmount/mount.pc
|config.status: creating libmount/src/Makefile
|config.status: creating libmount/src/libmount.h
|config.status: creating mount/Makefile


>
>    Karel
>

Sebastian

  reply	other threads:[~2012-02-29 21:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24 17:16 [PATCH 1/2] conifigure: add a crosscompile path for scanf_cv_alloc_modifier Sebastian Andrzej Siewior
2012-02-24 17:16 ` [PATCH 2/2] Add uuid to the linker flags if using built LIBBLKID Sebastian Andrzej Siewior
2012-02-28 14:35   ` Karel Zak
2012-02-29 21:38     ` Sebastian Andrzej Siewior
2012-02-28 14:12 ` [PATCH 1/2] conifigure: add a crosscompile path for scanf_cv_alloc_modifier Karel Zak
2012-02-29 21:31   ` Sebastian Andrzej Siewior [this message]
2012-03-20  8:18     ` Karel Zak
2012-03-30 19:49     ` Mike Frysinger
2012-03-30 20:52       ` Mike Frysinger
2012-04-02  7:14         ` Sebastian Andrzej Siewior
2012-04-02 19:00           ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120229213128.GA11628@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox