Define __EXTENSIONS__ on Solaris, too.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 4 Dec 2024 01:21:23 +0000 (20:21 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 4 Dec 2024 01:21:23 +0000 (20:21 -0500)
Apparently, if you define _POSIX_C_SOURCE on Solaris,
that's interpreted as "you get ONLY what's defined by POSIX".
Results from BF member hake show that that breaks perl.h,
and doubtless it'd cause more problems if we got past that.
Adopt the suggestion from standards(7) that we also need to
define __EXTENSIONS__, in hopes of un-breaking things.

Discussion: https://postgr.es/m/1654508.1733162761@sss.pgh.pa.us

configure
configure.ac
meson.build

index 7029e0362691c77ee15c848cc561d7838085d606..cf2d83b93ad2ad95f1331f30571f7601c6513e9b 100755 (executable)
--- a/configure
+++ b/configure
@@ -7593,7 +7593,7 @@ fi
 # On Solaris, we need these #defines to get POSIX-conforming versions
 # of many interfaces (sigwait, getpwuid_r, shmdt, ...).
 if test "$PORTNAME" = "solaris"; then
-  CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_POSIX_PTHREAD_SEMANTICS"
+  CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS"
 fi
 
 # We already have this in Makefile.win32, but configure needs it too
index afc229e729b5b578431d196bca6b109d5358ecb7..399aae4eed914429ebeb02534e64f8be267c0204 100644 (file)
@@ -696,7 +696,7 @@ fi
 # On Solaris, we need these #defines to get POSIX-conforming versions
 # of many interfaces (sigwait, getpwuid_r, shmdt, ...).
 if test "$PORTNAME" = "solaris"; then
-  CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_POSIX_PTHREAD_SEMANTICS"
+  CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS"
 fi
 
 # We already have this in Makefile.win32, but configure needs it too
index ec5cd9259dfb8d8e44c2070cb616fc3796c541aa..7d9a247d21c0350d010e8a0f05f8a2aa50bd13f4 100644 (file)
@@ -263,7 +263,11 @@ elif host_system == 'sunos'
   export_fmt = '-Wl,-M@0@'
   # We need these #defines to get POSIX-conforming versions
   # of many interfaces (sigwait, getpwuid_r, shmdt, ...).
-  cppflags += [ '-D_POSIX_C_SOURCE=200112L', '-D_POSIX_PTHREAD_SEMANTICS' ]
+  cppflags += [
+    '-D_POSIX_C_SOURCE=200112L',
+    '-D__EXTENSIONS__',
+    '-D_POSIX_PTHREAD_SEMANTICS',
+  ]
 
 elif host_system == 'windows'
   portname = 'win32'