summaryrefslogtreecommitdiffstats
path: root/linux/signals.mk
diff options
context:
space:
mode:
Diffstat (limited to 'linux/signals.mk')
-rw-r--r--linux/signals.mk18
1 files changed, 9 insertions, 9 deletions
diff --git a/linux/signals.mk b/linux/signals.mk
index 8fb9f07..4bb8812 100644
--- a/linux/signals.mk
+++ b/linux/signals.mk
@@ -17,7 +17,7 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk
printf '%s\n' "$$file"; \
done \
done \
- ) | grep '/\(gcc\|clang\)\(-[0-9.]\+\)\?$$'; \
+ ) | grep '/\(gcc\|clang\)\(-[0-9.]\{1,\}\)\{0,1\}$$'; \
printf '%s\n' gcc; \
) | sed 1q; \
}; \
@@ -40,17 +40,17 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk
set -e; \
signals="$$( \
$$extract "-I$$srcdir/tools/include" $$fixes "$$2" \
- | sed -n 's/^\s*\x23\s*define\s\+\(SIG[^\s]\+\)\s\+\([0-9]\+\)\s*\(\/.*\)\?$$/'"$$1"' \2 \1/p' \
+ | sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}\(SIG[^[:space:]]\{1,\}\)$(s)\{1,\}\([0-9]\{1,\}\)$(s)*\(\/.*\)\{0,1\}$$/'"$$1"' \2 \1/p' \
| grep -v ' SIG_' \
| grep -v ' SIGSTKSZ' \
| sort -k 2 -nu; \
)"; \
if test "$$1" = arm; then \
- signals="$$(printf "%s\n" "$$signals" | sed 's/\bSIGSWI\b/SIGRTMIN/')"; \
+ signals="$$(printf "%s\n" "$$signals" | sed 's/\(^\|[^A-Z0-9a-z_]\)SIGSWI\([^A-Z0-9a-z_]\|$$\)/\1SIGRTMIN\2/')"; \
fi; \
printf "%s\n" "$$signals"; \
- sigrtmin="$$(printf "%s\n" "$$signals" | sed -n 's/^.* \([0-9]\+\) SIGRTMIN$$/\1/p')"; \
- maxnamed="$$(printf "%s\n" "$$signals" | sed -n '$$s/^.* \([0-9]\+\) .*$$/\1/p')"; \
+ sigrtmin="$$(printf "%s\n" "$$signals" | sed -n 's/^.* \([0-9]\{1,\}\) SIGRTMIN$$/\1/p')"; \
+ maxnamed="$$(printf "%s\n" "$$signals" | sed -n '$$s/^.* \([0-9]\{1,\}\) .*$$/\1/p')"; \
test "$$sigrtmin" = "$$maxnamed"; \
maxsig=_NSIG; \
depth=0; \
@@ -58,7 +58,7 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk
printf '%s: looking for %s\n' "$$1" "$$maxsig" >&2; \
def="$$maxsig"; \
maxsig="$$($$extract "-I$$srcdir/tools/include" $$fixes "$$2" \
- | sed -n 's/^\s*\x23\s*define\s\+'"$$def"'\s\+\([A-Z0-9_]\+\)\s*\(\/.*\)\?$$/\1/p')"; \
+ | sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}'"$$def"'$(s)\{1,\}\([A-Z0-9_]\{1,\}\)$(s)*\(\/.*\)\{0,1\}$$/\1/p')"; \
if test -z "$$maxsig"; then \
maxsig="$$($$extract "-I$$srcdir/tools/include" \
"-I$$srcdir/arch/$$1/include" \
@@ -66,7 +66,7 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk
"-I$$srcdir" \
$$fixes \
"$$(printf '%s\n' "$$2" | sed 's:/uapi/:/:')" \
- | sed -n 's/^\s*\x23\s*define\s\+'"$$def"'\s\+\([A-Z0-9_]\+\)\s*\(\/.*\)\?$$/\1/p')"; \
+ | sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}'"$$def"'$(s)\{1,\}\([A-Z0-9_]\{1,\}\)$(s)*\(\/.*\)\{0,1\}$$/\1/p')"; \
fi; \
printf '%s: found %s\n' "$$1" "$$maxsig" >&2; \
: $$(( depth++ )); \
@@ -80,7 +80,7 @@ generated/linux-signals.tbl: $(LINUX_SOURCE) linux/signals.mk
done; \
}; \
getsigs () { \
- process_arch "$$@" | sed 's/\bSIGRTMIN\b/_&/'; \
+ process_arch "$$@" | sed 's/\(^\|[^A-Z0-9a-z_]\)\(SIGRTMIN\)\([^A-Z0-9a-z_]\|$$\)/\1_\2\3/'; \
}; \
for arch in $$(printf '%s\n' "$$srcdir/arch"/*/ | sed 's:^.*/\([^/]*\)/$$:\1:'); do \
if test ! "$$arch" = s390 && test -f "$$srcdir/arch/$$arch/include/uapi/asm/signal.h"; then \
@@ -129,7 +129,7 @@ generated/linux-signals.h: generated/linux-signals.tbl linux/signals.mk
for arch in $$(cut -d ' ' -f 1 < generated/linux-signals.tbl | uniq); do \
ARCH="$$(printf '%s\n' "$$arch" | tr '[a-z]' '[A-Z]')"; \
printf '#define LIST_LINUX_SIGNALS_FOR_%s(X, D)\\\n' "$$ARCH"; \
- sed -n 's/^'"$$arch"' \([0-9]\+\) \(.*\)$$/\tX(\1, "\2") D\\/p' \
+ sed -n 's/^'"$$arch"' \([0-9]\{1,\}\) \(.*\)$$/\tX(\1, "\2") D\\/p' \
< generated/linux-signals.tbl \
| sed '$$s/ D\\//'; \
printf 'static struct libsyscalls_named_number linux_signals_for_%s[] = {\n' "$$arch"; \