From b52f3800c2b83ea2f6e48d15a8f154f7dd3530ad Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 11 Mar 2013 01:05:19 +0100 Subject: configure: add _GNU_SOURCE to CFLAGS by default In theory, projects have to define feature test macros to enable various system functionality in system headers. (This is done so to ensure new identifiers can be added to system headers, without breaking old programs by causing name conflicts.) This includes macros like _GNU_SOURCE, _BSD_SOURCE, _POSIX_C_SOURCE etc. Traditionally, gcc as well as glibc headers implicitly assumed _GNU_SOURCE if no feature test macros were defined by the user. clang did this too to ensure compatibility with gcc centric programs (which in practice includes most Linux programs). However, it appears recent clang versions started to prefer BSD traditional function over the POSIX, which switches the definition of a function used by mp_msg.c: pid_t getpgrp(void); /* POSIX.1 version */ pid_t getpgrp(pid_t pid); /* BSD version */ mp_msg.c expects the POSIX version, while clang gives us the BSD version, resulting in a compilation failure. Solve this by defining _GNU_SOURCE. This requests most features from system headers, and explicitly prefers POSIX definitions over BSD, which should fix the compilation issue. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index d2beb5fce2..c674a55bf1 100755 --- a/configure +++ b/configure @@ -872,7 +872,7 @@ else # if test -z "$_target" fi fi -extra_cflags="-I. $extra_cflags" +extra_cflags="-I. -D_GNU_SOURCE $extra_cflags" _timer=timer-linux.c _getch=getch2.c -- cgit v1.2.3