mksysinfo: remove incorrect quotes in st_fsid handling for Hurd
[gcc.git] / libgo / mksigtab.sh
index c3319705b81180405a701aa5b1f50b14603f29c1..11e4ec436bd893202ebca4c685d41b9ea50b1ce8 100644 (file)
@@ -29,7 +29,7 @@ addsig() {
     echo "     $1: $2,"
     # Get the signal number and add it to SIGLIST
     signum=`grep "const $1 = " gen-sysinfo.go | sed -e 's/.* = //'`
-    if echo "$signum" | grep -q '^_SIG[A-Z0-9_]*$'; then
+    if echo "$signum" | grep '^_SIG[A-Z0-9_]*$' >/dev/null 2>&1; then
         # Recurse once to obtain signal number
         # This is needed for some MIPS signals defined as aliases of other signals
         signum=`grep "const $signum = " gen-sysinfo.go | sed -e 's/.* = //'`
@@ -91,6 +91,7 @@ checksig _SIGCANCEL  '{_SigSetStack + _SigUnblock, "SIGCANCEL: reserved signal f
 checksig _SIGXRES    '{_SigNotify, "SIGXRES: resource control exceeded"}'
 checksig _SIGJVM1    '{_SigNotify, "SIGJVM1: reserved signal for Java Virtual Machine"}'
 checksig _SIGJVM2    '{_SigNotify, "SIGJVM2: reserved signal for Java Virtual Machine"}'
+checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (GNU)"}'
 
 # Special handling of signals 32 and 33 on GNU/Linux systems,
 # because they are special to glibc.
@@ -107,6 +108,24 @@ if test "${GOOS}" = "aix"; then
     nsig=`expr $nsig + 1`
 else
     nsig=`grep 'const _*NSIG = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
+    if test -z "$nsig"; then
+       if grep 'const _*NSIG = [ (]*_*SIGRTMAX + 1[ )]*' gen-sysinfo.go >/dev/null 2>&1; then
+           rtmax=`grep 'const _*SIGRTMAX = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
+           if test -n "$rtmax"; then
+               nsig=`expr $rtmax + 1`
+           elif grep 'const _*SIGRTMAX = [ (]*_*SIGRTMIN[ )]*' gen-sysinfo.go >/dev/null 2>&1; then
+               rtmin=`grep 'const _*SIGRTMIN = [0-9]*$' gen-sysinfo.go | sed -e 's/.* = \([0-9]*\)/\1/'`
+               if test -n "$rtmin"; then
+                   nsig=`expr $rtmin + 1`
+               fi
+           fi
+       fi
+    fi
+fi
+
+if test -z "$nsig"; then
+    echo 1>&2 "could not determine number of signals"
+    exit 1
 fi
 
 i=1