[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Aw: Re: Supressing output from AC_CHECK_DECL
From: |
jcurlmail |
Subject: |
Aw: Re: Supressing output from AC_CHECK_DECL |
Date: |
Tue, 8 May 2007 17:52:15 +0200 (CEST) |
> Hello Jason, all,
>
> * address@hidden wrote on Tue, May 08, 2007 at 02:46:53PM CEST:
> >
> > When I use AC_CHECK_DECL, how can I prevent it from outputting to the
> > console for a specific message only? I don't want to supress all
> > messages, only one specific message (and replace it with my own, more
> > complex reusable macro).
>
> Hmm. Reimplementing AC_CHECK_DECL may be easier than trying to use it,
> as Noah already indicated. Especially, I think if you need to work
> around the output, then it seems likely that you will also need to work
> around caching as well: if you check for the same symbol more than once,
> with different code snippets then it will skew your results. (Which
> begs the question whether your identical double checking of timeradd in
> the macro you posted was intentional.)
In the original post, the 'timeradd' twice was unintentional but the double
check of localtime_r wasn't (visible with Solaris 9 and Interix 3.5), tiemradd
was there to test ideas on more convenient platforms but I forgot to remove it
earlier. And you're right, I had to work around caching as well, by unsetting
the environment variable.
>
> > In the end, I've done:
> > pushdef([AS_MESSAGE_FD], [/dev/null])
> > popdef([AS_MESSAGE_FD])
>
> First, be encouraged to use m4_pushdef rather than pushdef, etc.
> But also this ends up generating code like
> echo "$message" >&/dev/null
>
> which is not portable:
>
> $ ksh -c 'echo >&/dev/null'
> ksh: >&/dev/null : illegal file descriptor name
Thinking about it, it'll probably be better to implement the guts of
AC_DECL_CHECK here instead of using all the workarounds as Noah had already
mentioned.
Thanks,
Jason.