zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] configure: support split signal.h
@ 2018-04-10 12:41 Benedikt Morbach
  0 siblings, 0 replies; 2+ messages in thread
From: Benedikt Morbach @ 2018-04-10 12:41 UTC (permalink / raw)
  To: zsh-workers; +Cc: Benedikt Morbach

Since glibc 2.25 signal.h is split into signum-generic.h and signum.h[1]

This adds support for gathering signal names from multiple files to configure.ac
(approach adapted from the ERRNO_H handling below)

Src/zsh.mdd and Src/signames{1,2}.awk work fine with this without modifications

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=8082d91e1c449e0cb137468b731004a5e605c8c6
---

Please CC me on any replies as I'm not subscribed to the list

 configure.ac | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1a498f8b2..c0686b674 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1540,17 +1540,20 @@ if test -z "$sigfile_list"; then
 /usr/include/bits/signum.h
 /dev/null"
 fi
-for SIGNAL_H in $sigfile_list
+for SIGNAL_TRY_H in $sigfile_list
 do
   dnl Try to make sure it doesn't get confused by files that don't
   dnl have real signal definitions in, but do #define SIG* by counting
   dnl the number of signals.  Maybe we could even check for e.g. SIGHUP?
-  nsigs=`test -f $SIGNAL_H && \
-  grep '#[ 	]*define[ 	][ 	]*SIG[0-9A-Z]*[ 	]*[0-9][0-9]*' $SIGNAL_H | \
+  nsigs=`test -f $SIGNAL_TRY_H && \
+  grep '#[ 	]*define[ 	][ 	]*SIG[0-9A-Z]*[ 	]*[0-9][0-9]*' $SIGNAL_TRY_H | \
   wc -l | sed 's/[ 	]//g'`
-  test "x$nsigs" != x && test "$nsigs" -ge 7 && break
+  if test "x$nsigs" != x && test "$nsigs" -ge 7
+  then
+    SIGNAL_H="$SIGNAL_H $SIGNAL_TRY_H"
+  fi
 done
-if test x$SIGNAL_H = x"/dev/null"; then
+if test x$SIGNAL_H = x; then
   AC_MSG_ERROR(SIGNAL MACROS NOT FOUND:  please report to developers)
 fi
 zsh_cv_path_signal_h=$SIGNAL_H
-- 
2.16.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] configure: support split signal.h
@ 2018-04-12 15:52 Benedikt Morbach
  0 siblings, 0 replies; 2+ messages in thread
From: Benedikt Morbach @ 2018-04-12 15:52 UTC (permalink / raw)
  To: zsh-workers; +Cc: Benedikt Morbach

Since glibc 2.25 signal.h is split into signum-generic.h and signum.h[1]

This adds support for gathering signal names from multiple files to configure.ac
(approach adapted from the ERRNO_H handling below)

Src/zsh.mdd and Src/signames{1,2}.awk work fine with this without modifications

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=8082d91e1c449e0cb137468b731004a5e605c8c6
---

v2: Fix error reported by Alexander Kapshuna[2] (quoted x$SIGNAL_H)
> checking where signal.h is located... ./configure: line 8998: test: too many arguments
>  /usr/x86_64-pc-linux-gnu/include/bits/signum.h /usr/x86_64-pc-linux-gnu/include/bits/signum-generic.h

[2] http://www.zsh.org/mla/workers/2018/msg00426.html

 configure.ac | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1a498f8b2..38776742c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1540,17 +1540,20 @@ if test -z "$sigfile_list"; then
 /usr/include/bits/signum.h
 /dev/null"
 fi
-for SIGNAL_H in $sigfile_list
+for SIGNAL_TRY_H in $sigfile_list
 do
   dnl Try to make sure it doesn't get confused by files that don't
   dnl have real signal definitions in, but do #define SIG* by counting
   dnl the number of signals.  Maybe we could even check for e.g. SIGHUP?
-  nsigs=`test -f $SIGNAL_H && \
-  grep '#[ 	]*define[ 	][ 	]*SIG[0-9A-Z]*[ 	]*[0-9][0-9]*' $SIGNAL_H | \
+  nsigs=`test -f $SIGNAL_TRY_H && \
+  grep '#[ 	]*define[ 	][ 	]*SIG[0-9A-Z]*[ 	]*[0-9][0-9]*' $SIGNAL_TRY_H | \
   wc -l | sed 's/[ 	]//g'`
-  test "x$nsigs" != x && test "$nsigs" -ge 7 && break
+  if test "x$nsigs" != x && test "$nsigs" -ge 7
+  then
+    SIGNAL_H="$SIGNAL_H $SIGNAL_TRY_H"
+  fi
 done
-if test x$SIGNAL_H = x"/dev/null"; then
+if test x"$SIGNAL_H" = x; then
   AC_MSG_ERROR(SIGNAL MACROS NOT FOUND:  please report to developers)
 fi
 zsh_cv_path_signal_h=$SIGNAL_H
-- 
2.16.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-12 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 12:41 [PATCH] configure: support split signal.h Benedikt Morbach
2018-04-12 15:52 Benedikt Morbach

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).