[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)
This commit is contained in:
Neil Fortner 2015-03-27 17:17:31 -05:00
parent 50d7a32330
commit 1756ca5c13
2 changed files with 10 additions and 0 deletions

5
configure vendored
View File

@ -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

View File

@ -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