mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Make Bison version detection more portable
- POSIX sh actually does NOT support `+=`, but Bash does even in compatibility mode - `mawk` does not fully support POSIX EREs (regexes), so work around its lack of brace support Fixes building on Debian, apparently.
This commit is contained in:
2
Makefile
2
Makefile
@@ -125,7 +125,7 @@ src/asm/parser.c: src/asm/parser.y
|
||||
$QDEFS=; \
|
||||
add_flag(){ \
|
||||
if src/check_bison_ver.sh $$1 $$2; then \
|
||||
DEFS+=-D$$3; \
|
||||
DEFS="$$DEFS -D$$3"; \
|
||||
fi \
|
||||
}; \
|
||||
add_flag 3 5 api.token.raw=true; \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
bison -V | awk '
|
||||
/^bison.*[0-9]+(\.[0-9]+){1,2}$/ {
|
||||
match($0, /[0-9]+(\.[0-9]+){1,2}$/);
|
||||
bison -V | awk -v major="$1" -v minor="$2" '
|
||||
/^bison.*[0-9]+(\.[0-9]+)(\.[0-9]+)?$/ {
|
||||
match($0, /[0-9]+(\.[0-9]+)(\.[0-9]+)?$/);
|
||||
split(substr($0, RSTART), ver, ".");
|
||||
if (ver[1] == major && ver[2] >= minor) { exit 0 } else { exit 1 }
|
||||
}' major="$1" minor="$2"
|
||||
}'
|
||||
|
||||
Reference in New Issue
Block a user