From fa6a2c009c6886f0968303270a8b0267bac090a3 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 23 Feb 2006 20:06:52 +0000 Subject: [PATCH] if buildinfo is available and it doesn't have USE_GL, then assume a particular GL configuration svn: r2309 --- collects/sgl/make-gl-info.ss | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/collects/sgl/make-gl-info.ss b/collects/sgl/make-gl-info.ss index 68ac8df0a2..a516cd1bf1 100644 --- a/collects/sgl/make-gl-info.ss +++ b/collects/sgl/make-gl-info.ss @@ -124,13 +124,30 @@ end-string (lambda () (display c-file)) 'replace) (compile-c-to-so file c so home))) + + (define (effective-system-type home) + (let ([t (system-type)]) + (if (eq? t 'unix) + ;; Check "buildinfo" for USE_GL flag: + (let ([buildinfo (build-path home "lib" "buildinfo")]) + (if (file-exists? buildinfo) + (with-input-from-file buildinfo + (lambda () + (let loop () + (let ([l (read-line)]) + (cond + [(eof-object? l) 'no-gl] + [(regexp-match #rx"-DUSE_GL" l) t] + [else (loop)]))))) + t)) + t))) (define (make-gl-info compile-directory home) (let ((zo (build-path compile-directory "gl-info.zo")) (mod (compile - (case (system-type) - ((macosx windows) + (case (effective-system-type home) + ((macosx windows no-gl) '(module gl-info mzscheme (provide (all-defined)) (define gl-byte-size 1)