[native files fixes atsmyles@earthlink.net**20100215220410 Ignore-this: e26732ceede7ca406d0811c977412dba Fixes to handle the native-files parameter in catalogs ] hunk ./primitives.scm 31 + +(define (get-environment . vars) + (filter values + (map (lambda (var) (let* ((v (value->string var)) (val (getenv v #f))) (if val (string-append v "=" val) val))) vars))) + hunk ./primitives.scm 37 - (let ((env (list + (let ((env (append + (list hunk ./primitives.scm 45 - (envar 'GAMBC_CC_VERBOSE verbose: "")))) + (envar 'GAMBC_CC_VERBOSE verbose: "")) + (get-environment 'LIBRARY_PATH 'CPATH)))) hunk ./primitives.scm 151 - (cond - ((pair? files) - (for-each (lambda (file) - (apply compile-file-to-c file output: tmp-dir compiler-options)) files)) - ((null? files)) - (else (compile-files-to-c (list files))))) + (if (list? files) + (map (lambda (file) + (apply compile-file-to-c file output: tmp-dir compiler-options)) files) + + (compile-files-to-c (list files)))) hunk ./primitives.scm 158 - (let ((file (string-append (library-filename library) "_.scm")) + (let ((file (path-expand (string-append (library-filename library) "_.scm") tmp-dir)) hunk ./primitives.scm 161 - (compile-files-to-c file) - (path-strip-extension file))) + (compile-files-to-c file))) hunk ./primitives.scm 164 - (compile-files-to-c native-files) - (parameterize ((current-directory tmp-dir)) - (let ((c-files (append (map path-expand native-files) (list (compile-library-to-c library-form)))) - (link-file (string-append (library-filename library-form) ".o1"))) - (link-flat c-files output: (string-append link-file ".c") warnings?: (get-compiler-option compiler-options warnings?: #f)) - (gambc-cc 'dyn - input-files: (map (lambda (file) (string-append file ".c")) - (append c-files (list link-file)) - ) - output: (path-expand output-file) - cc-options: (get-compiler-option compiler-options cc-options: "") - ld-options: (get-compiler-option compiler-options ld-options: "") - ld-options-prelude: (get-compiler-option compiler-options ld-options-prelude: "")) + (parameterize ((current-directory tmp-dir)) + (let* ((c-files (append (compile-files-to-c native-files) (compile-library-to-c library-form))) + (input-files (append c-files (list (link-flat (map path-strip-extension c-files) output: (string-append (library-filename library-form) ".o1.c") warnings?: (get-compiler-option compiler-options warnings?: #f)))))) + (gambc-cc 'dyn + input-files: input-files + output: (path-expand output-file) + cc-options: (get-compiler-option compiler-options cc-options: "") + ld-options: (get-compiler-option compiler-options ld-options: "") + ld-options-prelude: (get-compiler-option compiler-options ld-options-prelude: "") + verbose: (get-compiler-option compiler-options verbose: "")) hunk ./primitives.scm 175 - (if (get-compiler-option compiler-options keep-files: #f) - (void) - (begin - (for-each delete-file (directory-files tmp-dir)) - (delete-directory tmp-dir)))))) + (if (get-compiler-option compiler-options keep-files: #f) + (void) + (begin + (for-each delete-file (directory-files tmp-dir)) + (delete-directory tmp-dir)))))) hunk ./primitives.scm 224 - (native-files (version-property version 'native-files '()) )) - (ex:compile-native-library (ex:read-library in-file) out-file native-files compiler-options) + (native-files (map (lambda (f) (path-expand f base-dir)) (version-property version 'native-files '()) )) + (version-compiler-options (version-property version 'compiler-options '()))) + (ex:compile-native-library (ex:read-library in-file) out-file native-files (append (list keep-files: #t) version-compiler-options compiler-options))