mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-24 03:52:08 +00:00
- 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.
8 lines
249 B
Bash
Executable File
8 lines
249 B
Bash
Executable File
#!/bin/sh
|
|
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 }
|
|
}'
|