mes-0.scm 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ;;; -*-scheme-*-
  2. ;;; GNU Mes --- Maxwell Equations of Software
  3. ;;; Copyright © 2016,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  4. ;;;
  5. ;;; mes-0.scm: This file is part of GNU Mes.
  6. ;;;
  7. ;;; GNU Mes is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Mes is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
  19. ;;; Commentary:
  20. ;;; mes-0.scm is the first file being loaded into Guile. It provides
  21. ;;; non-standard definitions that Mes modules and tests depend on.
  22. ;;; Code:
  23. (define-module (mes mes-0)
  24. #:export (
  25. builtin?
  26. mes-use-module
  27. EOF
  28. append2
  29. mes?
  30. guile?
  31. guile-1.8?
  32. guile-2?
  33. %arch
  34. %compiler
  35. ))
  36. (cond-expand
  37. (guile-2)
  38. (guile
  39. (define %host-type (string-append (utsname:machine (uname)) "linux-gnu")))
  40. (else))
  41. (define-macro (mes-use-module . rest) #t)
  42. (define builtin? procedure?) ; not strictly true, but ok for tests/*.test
  43. (define mes? #f)
  44. (define guile? #t)
  45. (define guile-1.8? (equal? (effective-version) "1.8"))
  46. (define guile-2? (equal? (major-version) "2"))
  47. (define EOF (if #f #f))
  48. (define append2 append)
  49. (define %arch (car (string-split %host-type #\-)))
  50. (define %compiler "gnuc")