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 p=${prefix-/usr/local}
35 srcdir=${srcdir-$(dirname $0)}
36 . ${srcdest}build-aux/trace.sh
38 BASH=${BASH-$(command -v bash)}
39 GUILE=${GUILE-$(command -v guile)} || true
41 if [ "$srcdir" = . ]; then
47 abs_top_srcdir=${abs_top_srcdir-$(cd ${srcdir} && pwd)}
50 if [ -z "$GUILE" -o "$GUILE" = true ]; then
51 GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-2.2}
53 GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-$(guile -c '(display (effective-version))')}
55 datadir=$(eval echo ${datadir-$prefix/share})
56 docdir=$(eval echo ${docdir-$datadir/doc/mes-$VERSION})
57 infodir=$(eval echo ${infodir-$datadir/info})
58 mandir=$(eval echo ${mandir-$datadir/man})
59 moduledir=$(eval echo ${moduledir-$datadir/mes/module})
60 moduledir_="$moduledir/"
61 guile_site_dir=$(eval echo ${guile_site_dir-$prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION})
62 guile_site_ccache_dir=$(eval echo ${guile_site_ccache_dir-$prefix/lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache})
63 arch=$(get_machine || uname -m)
67 -e s,"@srcdest@,$srcdest,"\
68 -e s,"@srcdir@,$srcdir,"\
69 -e s,"@abs_top_srcdir@,$abs_top_srcdir,"\
70 -e s,"@abs_top_builddir@,$abs_top_builddir,"\
71 -e s,"@top_builddir@,$top_builddir,"\
73 -e s,"@GUILE@,$GUILE,"\
74 -e s,"@prefix@,$prefix,"\
75 -e s,"@guile_site_dir@,$guile_site_dir,"\
76 -e s,"@guile_site_ccache_dir@,$guile_site_ccache_dir,"\
77 -e s,"@VERSION@,$VERSION,"\
79 -e s,"mes/module/,$moduledir/,"\
83 subst ${srcdest}build-aux/pre-inst-env.in pre-inst-env
85 subst ${srcdest}mes/module/mes/boot-0.scm.in mes/module/mes/boot-0.scm
86 subst ${srcdest}scripts/mescc.in scripts/mescc
88 subst ${srcdest}build-aux/GNUmakefile.in GNUmakefile
89 subst ${srcdest}build-aux/build.sh.in build.sh
90 subst ${srcdest}build-aux/check.sh.in check.sh
91 subst ${srcdest}build-aux/install.sh.in install.sh
92 subst ${srcdest}build-aux/uninstall.sh.in uninstall.sh
94 chmod +x scripts/mescc
98 ./build.sh to build mes
99 ./check.sh to check mes
100 ./install.sh to install mes