Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Do not define _POSIX_C_SOURCE when checking for sigset_t on Solaris



Trying to compile zsh on Solaris 10 fails for me right after
configuration due to misleading information in config.h

The check for sigset_t fails, due to:

configure:8654: checking for sigset_t
configure:8673: gcc -c  -Wall -Wmissing-prototypes -O2  conftest.c >&5
In file included from /usr/include/sys/types.h:17,
                 from conftest.c:85:
/usr/pkg/gcc8/lib/gcc/sparc64-sun-solaris2.10/8.4.0/include-fixed/sys/feature_tee
sts.h:346:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open aa
pplications     and pre-2001 POSIX applications"
 #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
  ^~~~~
conftest.c: In function 'main':
conftest.c:90:10: warning: unused variable 'tempsigset' [-Wunused-variable]
 sigset_t tempsigset;
          ^~~~~~~~~~
configure:8673: $? = 1

Looking at the git history it seems _POSIX_C_SOURCE is defined to ensure
configure works with systems using musl libc so the patch should not cause
any issues as it's Linux only.

Tried configuring on Solaris 11 as well and it still detects sigset_t.

diff --git a/configure.ac b/configure.ac
index 297a7482f..7494b3529 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1135,7 +1135,9 @@ dnl Check for sigset_t.  Currently I'm looking in
 dnl <sys/types.h> and <signal.h>.  Others might need
 dnl to be added.
 AC_CACHE_CHECK(for sigset_t, zsh_cv_type_sigset_t,
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_C_SOURCE 200809L
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifndef __sun
+  #define _POSIX_C_SOURCE 200809L
+#endif
 #include <sys/types.h>
 #include <signal.h>]], [[sigset_t tempsigset;]])],[zsh_cv_type_sigset_t=yes],[zsh_cv_type_sigset_t=no])])
 AH_TEMPLATE([sigset_t],





Messages sorted by: Reverse Date, Date, Thread, Author