[PATCH libxtrans] configure: under glibc define _GNU_SOURCE rather then _BSD_SOURCE
Alan Coopersmith
alan.coopersmith at oracle.com
Tue Mar 4 16:13:35 PST 2014
On 03/ 4/14 08:54 AM, Hans de Goede wrote:
> Hi Daniel,
>
> On 03/03/2014 03:14 PM, Daniel Stone wrote:
>> Hi,
>>
>> On 3 March 2014 07:56, Hans de Goede <hdegoede at redhat.com> wrote:
>>> The latest glibc considers _BSD_SOURCE deprecated, leading to the following
>>> warning being issued for pretty much every C-file in the xserver:
>>>
>>> In file included from /usr/include/stdint.h:25:0,
>>> from
>>> /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stdint.h:9,
>>> from ../include/misc.h:81,
>>> from miexpose.c:82:
>>> /usr/include/features.h:145:3: warning: #warning "_BSD_SOURCE and
>>> _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
>>> # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
>>> ^
>>>
>>> This silences up these warnings by switching to _GNU_SOURCE, which also
>>> includes all the necessary functions from BSD.
>>
>> AC_USE_SYSTEM_EXTENSIONS is better than hardcoded _*_SOURCE. The
>> latter is often reductive (e.g. can mean 'only expose me the
>> functionality from this platform', rather than 'add extensions from
>> this platform'), so the autoconf macro will do the right thing.
>
> Hmm, I took the GLIBC test for using _GNU_SOURCE from configure.ac from the
> xserver itself,
> if we move to AC_USE_SYSTEM_EXTENSIONS we should probably do this in the xserver's
> configure.ac and completely drop the -D_BSD_SOURCE from the xtrans.pc file, does
> that sound like a plan ?
The X server already has AC_USE_SYSTEM_EXTENSIONS in configure.ac, it just we
never cleaned up/dropped the older _GNU_SOURCE check.
The one advantage to doing it in libxtrans is that it can provide a common
setting across all xtrans consumers, if the setting is needed in all of them.
--
-Alan Coopersmith- alan.coopersmith at oracle.com
Oracle Solaris Engineering - http://blogs.oracle.com/alanc
More information about the xorg-devel
mailing list