2018-11-25 12:21:03 +00:00
|
|
|
#! @GUILE@ \
|
|
|
|
--no-auto-compile -e main -L @guile_site_dir@ -C @guile_site_ccache_dir@ -s
|
|
|
|
!#
|
|
|
|
;;; GNU Mes --- Maxwell Equations of Software
|
2023-05-03 12:47:09 +00:00
|
|
|
;;; Copyright © 2016,2017,2018,2019,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2018-11-25 12:21:03 +00:00
|
|
|
;;;
|
|
|
|
;;; This file is part of GNU Mes.
|
|
|
|
;;;
|
|
|
|
;;; GNU Mes is free software; you can redistribute it and/or modify it
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
;;; your option) any later version.
|
|
|
|
;;;
|
|
|
|
;;; GNU Mes is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2019-05-22 15:55:20 +00:00
|
|
|
(cond-expand
|
|
|
|
(mes)
|
|
|
|
(guile
|
2019-12-11 07:16:46 +00:00
|
|
|
(define %arch (car (string-split %host-type #\-)))
|
|
|
|
(define %kernel (car (filter
|
|
|
|
(compose not
|
|
|
|
(lambda (x) (member x '("pc" "portbld" "unknown"))))
|
|
|
|
(cdr (string-split %host-type #\-)))))))
|
2019-05-22 15:55:20 +00:00
|
|
|
|
2019-11-24 10:14:14 +00:00
|
|
|
(define %prefix (or (getenv "MES_PREFIX")
|
2018-11-25 12:21:03 +00:00
|
|
|
(if (string-prefix? "@prefix" "@prefix@")
|
|
|
|
""
|
2019-06-08 13:36:22 +00:00
|
|
|
"@prefix@")))
|
2018-11-25 12:21:03 +00:00
|
|
|
|
2019-11-24 10:14:14 +00:00
|
|
|
(define %includedir (or (getenv "includedir")
|
|
|
|
(string-append %prefix "/include")))
|
2018-11-25 12:21:03 +00:00
|
|
|
|
2019-11-24 10:14:14 +00:00
|
|
|
(define %libdir (or (getenv "libdir")
|
|
|
|
(string-append %prefix "/lib")))
|
|
|
|
|
|
|
|
(define %version (if (string-prefix? "@VERSION" "@VERSION@") "git"
|
|
|
|
"@VERSION@"))
|
|
|
|
|
|
|
|
(define %arch (if (string-prefix? "@mes_cpu" "@mes_cpu@") %arch
|
|
|
|
"@mes_cpu@"))
|
|
|
|
|
2019-12-11 07:16:46 +00:00
|
|
|
(define %kernel (if (string-prefix? "@mes_kernel" "@mes_kernel@") %kernel
|
|
|
|
"@mes_kernel@"))
|
|
|
|
|
2019-11-24 10:14:14 +00:00
|
|
|
(setenv "%prefix" %prefix)
|
|
|
|
(setenv "%includedir" %includedir)
|
|
|
|
(setenv "%libdir" %libdir)
|
|
|
|
(setenv "%version" %version)
|
|
|
|
(setenv "%arch" %arch)
|
2019-12-11 07:16:46 +00:00
|
|
|
(setenv "%kernel" %kernel)
|
2019-05-22 15:55:20 +00:00
|
|
|
|
2018-11-25 12:21:03 +00:00
|
|
|
(cond-expand
|
|
|
|
(mes
|
|
|
|
(mes-use-module (mescc))
|
|
|
|
(mescc:main (command-line)))
|
|
|
|
(guile
|
|
|
|
(use-modules (mescc))))
|
|
|
|
|
|
|
|
(define (main args)
|
|
|
|
(mescc:main args))
|