diff options
author | Mattias Andrée <maandree@kth.se> | 2023-12-07 22:51:52 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-12-07 22:51:52 +0100 |
commit | 9f449569df9c94670f51fd8cd5558b66884cd877 (patch) | |
tree | 21d3c31e22b2cd0544351584c8614e70b66826e4 /linux/errors.mk | |
parent | Fourth commit (diff) | |
download | libsyscalls-9f449569df9c94670f51fd8cd5558b66884cd877.tar.gz libsyscalls-9f449569df9c94670f51fd8cd5558b66884cd877.tar.bz2 libsyscalls-9f449569df9c94670f51fd8cd5558b66884cd877.tar.xz |
Improve portability
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | linux/errors.mk | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/linux/errors.mk b/linux/errors.mk index f69bf73..b34258a 100644 --- a/linux/errors.mk +++ b/linux/errors.mk @@ -17,7 +17,7 @@ generated/linux-errors.tbl: $(LINUX_SOURCE) linux/errors.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; \ }; \ @@ -27,7 +27,7 @@ generated/linux-errors.tbl: $(LINUX_SOURCE) linux/errors.mk { \ ($$extract "-I$$toolsdir/include/uapi" "$$2" && \ cat -- "linux-src/linux-$(LINUX_VERSION)/include/linux/errno.h") \ - | sed -n 's/^\s*\x23\s*define\s\+\(E[^\s]\+\)\s\+\([0-9]\+\)\s*\(\/.*\)\?$$/'"$$1"' \2 \1/p' \ + | sed -n 's/^$(s)*$(h)$(s)*define$(s)\{1,\}\(E[^[:space:]]\{1,\}\)$(s)\{1,\}\([0-9]\{1,\}\)$(s)*\(\/.*\)\{0,1\}$$/'"$$1"' \2 \1/p' \ | sort -k 2 -nu; \ }; \ for arch in $$(printf '%s\n' "$$toolsdir/arch"/*/ | sed 's:^.*/\([^/]*\)/$$:\1:'); do \ @@ -43,7 +43,7 @@ generated/linux-errors.h: generated/linux-errors.tbl linux/errors.mk for arch in $$(cut -d ' ' -f 1 < generated/linux-errors.tbl | uniq); do \ ARCH="$$(printf '%s\n' "$$arch" | tr '[a-z]' '[A-Z]')"; \ printf '#define LIST_LINUX_ERRORS_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-errors.tbl \ | sed '$$s/ D\\//'; \ printf 'static struct libsyscalls_named_number linux_errors_for_%s[] = {\n' "$$arch"; \ |