3 # GNU Mes --- Maxwell Equations of Software
4 # Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
6 # This file is part of GNU Mes.
8 # GNU Mes is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or (at
11 # your option) any later version.
13 # GNU Mes is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
25 # parse --prefix=prefix
27 p=${cmdline##*--prefix=}
31 if [ -z "$prefix" ]; then
37 BASH=${BASH-$(command -v bash)}
38 GUILE=${GUILE-$(command -v guile)} || true
41 top_builddest=${top_builddest-}
42 top_builddir=${top_builddest-.}
43 abs_top_srcdir=${abs_top_srcdir-$PWD}
44 abs_top_builddir=${abs_top_srcdir-$abs_top_builddir}
46 if [ -z "$GUILE" -o "$GUILE" = true ]; then
47 GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-2.2}
49 GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-$(guile -c '(display (effective-version))')}
51 datadir=${datadir-$prefix/share}
52 docdir=${docdir-$datadir/doc/mes-$VERSION}
53 infodir=${infodir-$datadir/info}
54 mandir=${mandir-$datadir/man}
55 moduledir=${moduledir-$datadir/mes/module}
56 guile_site_dir=${guile_site_dir-$prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION}
57 guile_site_ccache_dir=${guile_site_ccache_dir-$prefix/lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache}
60 -e s,"@srcdir@,$srcdir,"\
61 -e s,"@abs_top_srcdir@,$abs_top_srcdir,"\
62 -e s,"@abs_top_builddir@,$abs_top_builddir,"\
63 -e s,"@top_builddir@,$top_builddir,"\
64 -e s,"@top_builddest@,$top_builddest,"\
66 -e s,"@GUILE@,$GUILE,"\
67 -e s,"@guile_site_dir@,$guile_site_dir,"\
68 -e s,"@guile_site_ccache_dir@,$guile_site_ccache_dir,"\
69 -e s,"@VERSION@,$VERSION,"\
70 -e s,"mes/module/,$moduledir,"\
71 build-aux/pre-inst-env.in\
77 -e s,"@srcdir@,$srcdir,"\
78 -e s,"@abs_top_srcdir@,$abs_top_srcdir,"\
79 -e s,"@abs_top_builddir@,$abs_top_builddir,"\
80 -e s,"@top_builddir@,$top_builddir,"\
81 -e s,"@top_builddest@,$top_builddest,"\
83 -e s,"@GUILE@,$GUILE,"\
84 -e s,"@guile_site_dir@,$guile_site_dir,"\
85 -e s,"@guile_site_ccache_dir@,$guile_site_ccache_dir,"\
86 -e s,"@VERSION@,$VERSION,"\
87 -e s,"mes/module/,$moduledir,"\
88 mes/module/mes/boot-0.scm.in\
89 > mes/module/mes/boot-0.scm
92 -e s,"@srcdir@,$srcdir,"\
93 -e s,"@abs_top_srcdir@,$abs_top_srcdir,"\
94 -e s,"@abs_top_builddir@,$abs_top_builddir,"\
95 -e s,"@top_builddir@,$top_builddir,"\
96 -e s,"@top_builddest@,$top_builddest,"\
98 -e s,"@GUILE@,$GUILE,"\
99 -e s,"@guile_site_dir@,$guile_site_dir,"\
100 -e s,"@guile_site_ccache_dir@,$guile_site_ccache_dir,"\
101 -e s,"@VERSION@,$VERSION,"\
102 -e s,"mes/module/,$moduledir,"\
106 chmod +x scripts/mescc
108 if [ "$srcdir" != . ]; then
109 mkdir -p mes/module/mes
110 { cd mes/module/mes; ln -sf $abs_top_srcdir/mes/module/mes/*.mes .; }
115 prefix=$prefix ./build.sh to build mes
116 prefix=$prefix ./check.sh to check mes
117 prefix=$prefix ./install.sh to install mes