autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use system extensions conditionally?


From: Fredrik Tolf
Subject: Re: Use system extensions conditionally?
Date: Thu, 27 Feb 2014 07:12:22 +0100 (CET)
User-agent: Alpine 2.10 (DEB 1266 2009-07-14)

On Wed, 26 Feb 2014, Eric Blake wrote:
On 02/26/2014 07:16 PM, Fredrik Tolf wrote:
On glibc, I need to define `_GNU_SOURCE' in order to gain access to
fopencookie() and cookie_io_functions_t. Autoconf neatly supports
turning this on with `AC_USE_SYSTEM_EXTENSIONS(_GNU_SOURCE)', but I
can't quite seem to figure out how to only do this when necessary.

That's not how AC_USE_SYSTEM_EXTENSIONS works.  The macro does not take
arguments.

Oh, right. I seem to have read the docs a bit too fast. Thanks. :)

Yes, it really is bad practice to mix compilation tests before turning
extensions with compilation tests done afterwards.  Turning on
extensions is such a drastic change to the compilation environment that
you want ALL your tests to run under the same environment.  Either you
plan on using extensions, and should enable them unconditionally up
front, or you do not need extensions, and should not use the macro.

Hm. I see your reasoning, and I see where you're coming from. However, on FreeBSD, I don't actually have to turn on any extensions to use the corresponding functionality (funopen &c.). Isn't it ugly, then, to always enable system extensions, regardless of environment?

--
Fredrik Tolf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]