Masami Hiramatsu | 6f5f672 | 2009-11-20 12:13:14 -0500 | [diff] [blame] | 1 | # GNU objdump version checker |
| 2 | # |
| 3 | # Usage: |
| 4 | # objdump -v | awk -f chkobjdump.awk |
| 5 | BEGIN { |
| 6 | # objdump version 2.19 or later is OK for the test. |
| 7 | od_ver = 2; |
| 8 | od_sver = 19; |
| 9 | } |
| 10 | |
Masami Hiramatsu | 8bee738 | 2009-12-18 10:40:13 -0500 | [diff] [blame] | 11 | /^GNU objdump/ { |
| 12 | verstr = "" |
| 13 | for (i = 3; i <= NF; i++) |
| 14 | if (match($(i), "^[0-9]")) { |
| 15 | verstr = $(i); |
| 16 | break; |
| 17 | } |
| 18 | if (verstr == "") { |
| 19 | printf("Warning: Failed to find objdump version number.\n"); |
| 20 | exit 0; |
| 21 | } |
| 22 | split(verstr, ver, "."); |
Masami Hiramatsu | 6f5f672 | 2009-11-20 12:13:14 -0500 | [diff] [blame] | 23 | if (ver[1] > od_ver || |
| 24 | (ver[1] == od_ver && ver[2] >= od_sver)) { |
| 25 | exit 1; |
| 26 | } else { |
| 27 | printf("Warning: objdump version %s is older than %d.%d\n", |
Masami Hiramatsu | 8bee738 | 2009-12-18 10:40:13 -0500 | [diff] [blame] | 28 | verstr, od_ver, od_sver); |
Masami Hiramatsu | 6f5f672 | 2009-11-20 12:13:14 -0500 | [diff] [blame] | 29 | print("Warning: Skipping posttest."); |
| 30 | # Logic is inverted, because we just skip test without error. |
| 31 | exit 0; |
| 32 | } |
| 33 | } |