From 1756ca5c13d79af26a6bae1c9913c2fbbde09ca0 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 27 Mar 2015 17:17:31 -0500 Subject: [svn-r26633] Add -D_DEFAULT_SOURCE to CPPFLAGS on Linux systems. -D_BSD_SOURCE is deprecated in recent versions of glibc, and -D_DEFAULT_SOURCE is the replacement. Keep -D_BSD_SOURCE for now to support older systems. gcc will not issue a warning about -D_BSD_SOURCE being deprecated when -D_DEFAULT_SOURCE is supplied as well. Tested: jam, koala, ostrich (h5committest) --- configure | 5 +++++ configure.ac | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/configure b/configure index a272c8d..6863855 100755 --- a/configure +++ b/configure @@ -22929,6 +22929,11 @@ case "$host_cpu-$host_vendor-$host_os" in ## however, we do not do this since it breaks the big test on some ## older platforms. H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS" + + ## _BSD_SOURCE is deprecated as of glibc 2.20, in favor of _DEFAULT_SOURCE. + ## To avoid warnings, we define _DEFAULT_SOURCE in addition to _BSD_SOURCE, + ## which should work for all versions of glibc. + H5_CPPFLAGS="-D_DEFAULT_SOURCE $H5_CPPFLAGS" ;; esac diff --git a/configure.ac b/configure.ac index 2150de2..ea7608c 100644 --- a/configure.ac +++ b/configure.ac @@ -1120,6 +1120,11 @@ case "$host_cpu-$host_vendor-$host_os" in ## however, we do not do this since it breaks the big test on some ## older platforms. H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS" + + ## _BSD_SOURCE is deprecated as of glibc 2.20, in favor of _DEFAULT_SOURCE. + ## To avoid warnings, we define _DEFAULT_SOURCE in addition to _BSD_SOURCE, + ## which should work for all versions of glibc. + H5_CPPFLAGS="-D_DEFAULT_SOURCE $H5_CPPFLAGS" ;; esac -- cgit v0.12