zsh-workers
 help / color / mirror / code / Atom feed
* signames problem
@ 1999-02-24 11:37 Bernd Eggink
  1999-02-24 13:00 ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Eggink @ 1999-02-24 11:37 UTC (permalink / raw)
  To: zsh Workers

In SuSE Linux 6.0, zsh-3.1.5-pws-9 doesn't know any signames.

Possibly because the former /usr/include/asm/signal.h has moved to
/usr/include/signum.h !?

Regards,
	Bernd

--
Bernd Eggink
Regionales Rechenzentrum der Uni Hamburg
eggink@rrz.uni-hamburg.de
http://www.rrz.uni-hamburg.de/eggink/BEggink.html


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

* Re: signames problem
  1999-02-24 11:37 signames problem Bernd Eggink
@ 1999-02-24 13:00 ` Peter Stephenson
  1999-02-24 14:41   ` Bernd Eggink
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 1999-02-24 13:00 UTC (permalink / raw)
  To: Bernd Eggink, Zsh hackers list

> In SuSE Linux 6.0, zsh-3.1.5-pws-9 doesn't know any signames.
> 
> Possibly because the former /usr/include/asm/signal.h has moved to
> /usr/include/signum.h !?

configure has changed so it's now supposed to work it out from the files
that `#include <signal.h>' actually includes.  Anything with `sig' in it is
tested. Is zsh_cv_path_signal_h set to /dev/null in config.cache?  What
does the new code (I've replaced $CPP with gcc -E, $AWK with awk assuming
that's what's used):

echo "#include <signal.h>" > nametmp.c
sigfile_list="`gcc -E nametmp.c |
sed -n 's/^#[ 	].*\"\(.*\)\"/\1/p' |
sed 's/\\\\\\\\/\//g' |
awk '{ if (\$1 ~ \"sig\") files[\$1] = \$1 }
  END { for (var in files) print var }'`"

produce for $sigfile_list?  (There's a space and a tab in the empty [ ]
which does funny things if you paste it into zsh.)

I can add /usr/include/signum.h to the fallback list anyway, but I'd like
to find out why it can't find it.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

* Re: signames problem
  1999-02-24 13:00 ` Peter Stephenson
@ 1999-02-24 14:41   ` Bernd Eggink
  1999-02-24 15:01     ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Eggink @ 1999-02-24 14:41 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

Peter Stephenson wrote:
> 
> > In SuSE Linux 6.0, zsh-3.1.5-pws-9 doesn't know any signames.
> >
> > Possibly because the former /usr/include/asm/signal.h has moved to
> > /usr/include/signum.h !?
> 
> configure has changed so it's now supposed to work it out from the files
> that `#include <signal.h>' actually includes.  Anything with `sig' in it is
> tested. Is zsh_cv_path_signal_h set to /dev/null in config.cache?  What
> does the new code (I've replaced $CPP with gcc -E, $AWK with awk assuming
> that's what's used):
> 
> echo "#include <signal.h>" > nametmp.c
> sigfile_list="`gcc -E nametmp.c |
> sed -n 's/^#[   ].*\"\(.*\)\"/\1/p' |
> sed 's/\\\\\\\\/\//g' |
> awk '{ if (\$1 ~ \"sig\") files[\$1] = \$1 }
>   END { for (var in files) print var }'`"
> 
> produce for $sigfile_list?  (There's a space and a tab in the empty [ ]
> which does funny things if you paste it into zsh.)

The result is

   /usr/include/sigstack.h
   ... 5 more files ...
   /usr/include/signum.h

which is OK so far, but unfortunately /usr/include/sigstack.h contains a
line 

  #define SIGSTKSZ 8192

which causes configure to take /usr/include/sigstack.h as the result.

The test in configure:4024 is too weak. I guess it would be better to
test for a minimum number (e.g., 7) of "#define SIG..."s in each file.
This works for me:

   for SIGNAL_H in $sigfile_list
   do
     n=0
     test -f $SIGNAL_H && \
     grep '#[  ]*define[   ][  ]*SIG[0-9A-Z]*[     ]*[0-9][0-9]*'
$SIGNAL_H | \
     wc -l | read n dummy && [ $n -ge 7 ] && break
   done


Regards,
	Bernd
--
Bernd Eggink
Regionales Rechenzentrum der Uni Hamburg
eggink@rrz.uni-hamburg.de
http://www.rrz.uni-hamburg.de/eggink/BEggink.html


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

* Re: signames problem
  1999-02-24 14:41   ` Bernd Eggink
@ 1999-02-24 15:01     ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 1999-02-24 15:01 UTC (permalink / raw)
  To: Zsh hackers list

Bernd Eggink wrote:
> The test in configure:4024 is too weak. I guess it would be better to
> test for a minimum number (e.g., 7) of "#define SIG..."s in each file.

Thanks.  Here's what I came up with based on your suggestion.  Maybe it's
even safer to check for signals we know should be defined, i.e. look for
SIGHUP or SIGKILL, but goodness knows what's out there these days.

--- configure.in.sig	Wed Feb 24 13:46:04 1999
+++ configure.in	Wed Feb 24 15:52:13 1999
@@ -682,6 +682,7 @@
   dnl In case we don't get the stuff from the preprocesor, use the old
   dnl list of standard places.
   sigfile_list="/usr/include/bsd/sys/signal.h
+/usr/include/signum.h
 /usr/include/asm/signum.h
 /usr/include/asm/signal.h
 /usr/include/linux/signal.h
@@ -690,9 +691,13 @@
 fi
 for SIGNAL_H in $sigfile_list
 do
-  test -f $SIGNAL_H && \
-  grep '#[ 	]*define[ 	][ 	]*SIG[0-9A-Z]*[ 	]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \
-  break
+  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 | \
+  wc -l | sed 's/[ 	]//g'`
+  test "x$nsigs" != x && test "$nsigs" -ge 7 && break
 done
 zsh_cv_path_signal_h=$SIGNAL_H
 ])

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

end of thread, other threads:[~1999-02-28 21:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-24 11:37 signames problem Bernd Eggink
1999-02-24 13:00 ` Peter Stephenson
1999-02-24 14:41   ` Bernd Eggink
1999-02-24 15:01     ` Peter Stephenson

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).