Skip to content

Commit c47934f

Browse files
authored
Fix nasm version check (#29)
* Fix nasm version check Recently updated to nasm 3.01 and the previous check started to fail. * Fix typo * Make nasm version check more specific to warn against 3.x on macOS
1 parent e93b286 commit c47934f

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

a86/check-nasm.rkt

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,26 @@ HERE
3737
(and (system "nasm -v")
3838
(get-output-string (current-output-port)))))
3939

40-
(define (nasm-version-2.15+?)
41-
(match (nasm-version)
42-
[(list maj min) (and (>= maj 2) (>= min 15))]
40+
;; 'low => [0.00, 2.15)
41+
;; 'ok => [2.15, 3.00)
42+
;; 'high => [3.00, ----)
43+
;; #f => no nasm found
44+
(define (nasm-version-acceptability ver)
45+
(match ver
46+
[(list maj min)
47+
(cond
48+
[(and (= maj 2)
49+
(>= min 15)) 'ok]
50+
[(> maj 2) 'high]
51+
[(or (< maj 2)
52+
(< min 15)) 'low])]
4353
[_ #f]))
4454

55+
(define (nasm-version-2.15+?)
56+
(case (nasm-version-acceptability (nasm-version))
57+
[(ok high) #t]
58+
[else #f]))
59+
4560
;; -> [Maybe (list Natural Natural)]
4661
(define (nasm-version)
4762
(match (nasm-version-string)
@@ -57,6 +72,7 @@ HERE
5772
(unless v
5873
(error (format nasm-msg
5974
(getenv "PATH")
60-
(if (and (drracket?) (macos?) (launched-with-finder?)) macosx-msg ""))))
61-
(unless (nasm-version-2.15+?)
62-
(eprintf "nasm 2.15 or later is recommended; some faatures may not work as expected.\n")))
75+
(if (and (drracket?) (macos?) (launched-with-finder?)) macosx-msg ""))))
76+
(case (nasm-version-acceptability v)
77+
[(high) (when (macos?) (eprintf "nasm 3.x is not recommended on macOS; please install nasm 2.15+\n"))]
78+
[(low) (eprintf "nasm 2.15 or later is recommended; some features may not work as expected.\n")]))

0 commit comments

Comments
 (0)