scx/scheme/configure.scm

24 lines
834 B
Scheme
Raw Normal View History

2003-11-28 10:41:39 -05:00
(define-structure configure (export host)
(open scheme-with-scsh)
(begin
(define (canonical-machine uname-record)
(let* ((machine (uname:machine uname-record))
(os (uname:os-name uname-record)))
(case machine
(("i386" "i486" "i586" "i686") "i386")
(("Power Machintosh") "powerpc")
(else (cond ((and (string=? os "AIX")
(regexp-search? (rx (: "00" (= 6 digit) any any "00")) machine))
"powerpc")
(else machine))))))
(define (canonical-os-name uname-record)
(uname:os-name uname-record))
(define (host)
(let ((uname-record (uname)))
(string-append (canonical-machine uname-record)
"-"
(canonical-os-name uname-record))))))