Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Do not define _POSIX_C_SOURCE when checking for sigset_t on Solaris
- X-seq: zsh-workers 49634
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Claes Nästén <pekdon@xxxxxxxxx>
- Cc: zsh-workers <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Do not define _POSIX_C_SOURCE when checking for sigset_t on Solaris
- Date: Tue, 07 Dec 2021 19:20:45 +0100
- Archived-at: <https://zsh.org/workers/49634>
- In-reply-to: <1637648446-sup-9516@debian9>
- List-id: <zsh-workers.zsh.org>
- References: <1637648446-sup-9516@debian9>
On 23 Nov, Claes Nästén wrote:
> 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:
Thank you for isolating the cause of this and for the clear report.
The definition of _POSIX_C_SOURCE was added in 28989 (April 2011) for
compatibility with musl libc.
I was thinking it'd be better to define it only for musl rather building
up a list of exceptions such as Solaris. Trying a zsh build on a recent
Alpine Linux system running within podman, it appears to return "yes"
for the sigset_t test both with and without the #define. Perhaps musl
has evolved for greater compatibility with glibc since 2011. I don't
think we should be too concerned about the potential for someone to still
be using old musl. Solaris 10, while quite a bit older than that if
you don't count updates, is still relevant.
patch -R wouldn't work with 28989 because it was using the old
AC_TRY_COMPILE macro at that time so I have attached a patch.
Oliver
diff --git a/configure.ac b/configure.ac
index 1af5a2854..8bba78c56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1135,8 +1135,7 @@ 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
-#include <sys/types.h>
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#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],
[Define to `unsigned int' if <sys/types.h> or <signal.h> doesn't define])
Messages sorted by:
Reverse Date,
Date,
Thread,
Author