Is defining _GNU_SOURCE still necessary for Linux with SDL 1.2?

At the moment the SDL 1.2 autoconf script defines _GNU_SOURCE unconditionally
for more or less all open source OS’s, although the feature test macro only
has relevance for GLIBC-using hosts so mainly Linux. I see this has been
removed for SDL 2 already. What I would like to know is if this is still
necessary to build SDL 1.2 on a relatively modern Linux environment? I
can’t imagine what functions SDL 1.2 would be using in a modern-ish
GLIBC that would be a GNU extension.

Could some Linux users try building with this and see if there are
any issues?

diff -r b1c1b7ac4b39 configure.in
— a/configure.in Wed Aug 15 02:52:42 2012 -0400
+++ b/configure.in Wed Aug 22 22:13:24 2012 -0400
@@ -78,7 +78,7 @@
BASE_LDFLAGS="-mno-cygwin"
;;
*)

  •    BASE_CFLAGS="-D_GNU_SOURCE=1"
    
  •    BASE_CFLAGS=""
       BASE_LDFLAGS=""
       ;;
    

esac–
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Could some Linux users try building with this and see if there are
any issues?

Generates the exact same SDL_config.h on this Ubuntu 11.10 system,
builds without any compiler warnings.

It does, however, build a library with a different md5 signature. I
don’t know if that’s important at all, but it definitely changes
something.

–ryan.

OK how about to be on the safe and conservative side we keep _GNU_SOURCE
for GLIBC using hosts and remove it for the rest.

diff -r b1c1b7ac4b39 configure.in
— a/configure.in Wed Aug 15 02:52:42 2012 -0400
+++ b/configure.in Fri Aug 24 20:14:28 2012 -0400
@@ -77,10 +77,14 @@
BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
BASE_LDFLAGS="-mno-cygwin"
;;

  • *)
  • --linux*|--uclinux*|--gnu*|--kbsd-gnu)
    BASE_CFLAGS="-D_GNU_SOURCE=1"
    BASE_LDFLAGS=""
    ;;
  • *)
    
  •    BASE_CFLAGS=""
    
  •    BASE_LDFLAGS=""
    
  •    ;;
    

esac
BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"On Fri, Aug 24, 2012 at 06:55:31PM -0400, Ryan C. Gordon wrote:

Could some Linux users try building with this and see if there are
any issues?

Generates the exact same SDL_config.h on this Ubuntu 11.10 system,
builds without any compiler warnings.

It does, however, build a library with a different md5 signature.
I don’t know if that’s important at all, but it definitely changes
something.

–ryan.


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

OK how about to be on the safe and conservative side we keep _GNU_SOURCE
for GLIBC using hosts and remove it for the rest.

Screw it, I just removed it outright. We’ll see if anyone complains.

–ryan.

If you want to keep things consistent between both branches there is
still an AC_GNU_SOURCE macro within the SDL 2 branches autoconf script.On Sat, Aug 25, 2012 at 04:49:47PM -0400, Ryan C. Gordon wrote:

OK how about to be on the safe and conservative side we keep _GNU_SOURCE
for GLIBC using hosts and remove it for the rest.

Screw it, I just removed it outright. We’ll see if anyone complains.

–ryan.


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Screw it, I just removed it outright. We’ll see if anyone complains.

If you want to keep things consistent between both branches there is
still an AC_GNU_SOURCE macro within the SDL 2 branches autoconf script.

Removed. Nothing has caught fire yet. I think.

–ryan.