From ffcb3542377c62cf972ff683c101e7268332f8a0 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Wed, 25 Nov 2020 07:26:35 -0800 Subject: Minor/solaris gcc fix (#126) * Adds gnu99 as the standard when building with gcc on Solaris * Adds a note to RELEASE.txt and improves comments For Solaris + gcc fix (HDFFV-11191) --- config/gnu-flags | 12 ++++++++---- release_docs/RELEASE.txt | 13 +++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index 7cf90b8..5c6745c 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -118,12 +118,16 @@ if test "X-gcc" = "X-$cc_vendor"; then esac case "$host_os-$host_cpu" in - # cygwin needs the "-std=c99" flag removed, so make - # a specific case for Cygwin without the flag and a default - # case to add the flag everywhere else + # Cygwin needs the "-std=c99" flag removed. cygwin-*) ;; - + # On Solaris, gcc needs the gnu99 standard to pick up certain POSIX + # things. Do NOT use this as the gcc norm as this encourages the use + # of non-standard gcc extensions. + *solaris*) + H5_CFLAGS="$H5_CFLAGS -std=gnu99" + ;; + # Everybody else gets c99 as the standard. *) H5_CFLAGS="$H5_CFLAGS -std=c99" ;; diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 67fbe51..690635a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -47,6 +47,19 @@ New Features Configuration: ------------- + - Fixed POSIX problems when building w/ gcc on Solaris + + When building on Solaris using gcc, the POSIX symbols were not + being set correctly, which could lead to issues like clock_gettime() + not being found. + + The standard is now set to gnu99 when building with gcc on Solaris, + which allows POSIX things to be #defined and linked correctly. This + differs slightly from the gcc norm, where we set the standard to c99 + and manually set POSIX #define symbols. + + (DER - 2020/11/25, HDFFV-11191) + - Added a configure-time option to consider certain compiler warnings as errors -- cgit v0.12