2018-07-21 22:43:39 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
2018-07-23 17:10:34 +00:00
|
|
|
# GNU Mes --- Maxwell Equations of Software
|
|
|
|
# Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
|
|
|
#
|
|
|
|
# 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/>.
|
|
|
|
|
2018-07-21 22:43:39 +00:00
|
|
|
set -e
|
|
|
|
|
2018-10-04 21:15:25 +00:00
|
|
|
VERSION=0.18
|
2018-07-21 22:43:39 +00:00
|
|
|
|
|
|
|
# parse --prefix=prefix
|
|
|
|
cmdline=$(echo "$@")
|
|
|
|
p=${cmdline##*--prefix=}
|
|
|
|
p=${p% *}
|
|
|
|
p=${p% -*}
|
2018-07-25 06:14:13 +00:00
|
|
|
if [ -z "$p" ]; then
|
|
|
|
p=${prefix-/usr/local}
|
2018-07-21 22:43:39 +00:00
|
|
|
fi
|
2018-07-25 06:14:13 +00:00
|
|
|
prefix=$p
|
2018-07-21 22:43:39 +00:00
|
|
|
|
2018-07-25 06:14:13 +00:00
|
|
|
srcdir=${srcdir-$(dirname $0)}
|
|
|
|
. ${srcdest}build-aux/trace.sh
|
2018-07-21 22:43:39 +00:00
|
|
|
|
|
|
|
BASH=${BASH-$(command -v bash)}
|
|
|
|
GUILE=${GUILE-$(command -v guile)} || true
|
|
|
|
|
2018-07-25 06:14:13 +00:00
|
|
|
if [ "$srcdir" = . ]; then
|
|
|
|
top_builddir=.
|
|
|
|
else
|
|
|
|
srcdest=${srcdest}
|
|
|
|
top_builddir=$PWD
|
|
|
|
fi
|
|
|
|
abs_top_srcdir=${abs_top_srcdir-$(cd ${srcdir} && pwd)}
|
|
|
|
abs_top_builddir=$PWD
|
2018-07-21 22:43:39 +00:00
|
|
|
|
|
|
|
if [ -z "$GUILE" -o "$GUILE" = true ]; then
|
|
|
|
GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-2.2}
|
|
|
|
else
|
|
|
|
GUILE_EFFECTIVE_VERSION=${GUILE_EFFECTIVE_VERSION-$(guile -c '(display (effective-version))')}
|
|
|
|
fi
|
2018-08-09 09:00:10 +00:00
|
|
|
datadir=$(eval echo ${datadir-$prefix/share})
|
|
|
|
docdir=$(eval echo ${docdir-$datadir/doc/mes-$VERSION})
|
|
|
|
infodir=$(eval echo ${infodir-$datadir/info})
|
|
|
|
mandir=$(eval echo ${mandir-$datadir/man})
|
|
|
|
moduledir=$(eval echo ${moduledir-$datadir/mes/module})
|
|
|
|
moduledir_="$moduledir/"
|
|
|
|
guile_site_dir=$(eval echo ${guile_site_dir-$prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION})
|
|
|
|
guile_site_ccache_dir=$(eval echo ${guile_site_ccache_dir-$prefix/lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache})
|
2018-07-21 22:43:39 +00:00
|
|
|
|
2018-07-25 06:14:13 +00:00
|
|
|
subst () {
|
|
|
|
sed \
|
|
|
|
-e s,"@srcdest@,$srcdest,"\
|
2018-07-21 22:43:39 +00:00
|
|
|
-e s,"@srcdir@,$srcdir,"\
|
|
|
|
-e s,"@abs_top_srcdir@,$abs_top_srcdir,"\
|
|
|
|
-e s,"@abs_top_builddir@,$abs_top_builddir,"\
|
|
|
|
-e s,"@top_builddir@,$top_builddir,"\
|
|
|
|
-e s,"@BASH@,$BASH,"\
|
|
|
|
-e s,"@GUILE@,$GUILE,"\
|
2018-08-09 06:58:20 +00:00
|
|
|
-e s,"@prefix@,$prefix,"\
|
2018-07-21 22:43:39 +00:00
|
|
|
-e s,"@guile_site_dir@,$guile_site_dir,"\
|
|
|
|
-e s,"@guile_site_ccache_dir@,$guile_site_ccache_dir,"\
|
|
|
|
-e s,"@VERSION@,$VERSION,"\
|
2018-08-09 09:00:10 +00:00
|
|
|
-e s,"mes/module/,$moduledir/,"\
|
2018-07-25 06:14:13 +00:00
|
|
|
$1 > $2
|
|
|
|
}
|
2018-07-21 22:43:39 +00:00
|
|
|
|
2018-07-25 06:14:13 +00:00
|
|
|
subst ${srcdest}build-aux/pre-inst-env.in pre-inst-env
|
2018-07-21 22:43:39 +00:00
|
|
|
chmod +x pre-inst-env
|
2018-07-25 06:14:13 +00:00
|
|
|
subst ${srcdest}mes/module/mes/boot-0.scm.in mes/module/mes/boot-0.scm
|
|
|
|
subst ${srcdest}scripts/mescc.in scripts/mescc
|
2018-07-21 22:43:39 +00:00
|
|
|
|
2018-07-25 06:14:13 +00:00
|
|
|
subst ${srcdest}build-aux/GNUmakefile.in GNUmakefile
|
|
|
|
subst ${srcdest}build-aux/build.sh.in build.sh
|
|
|
|
subst ${srcdest}build-aux/check.sh.in check.sh
|
|
|
|
subst ${srcdest}build-aux/install.sh.in install.sh
|
|
|
|
subst ${srcdest}build-aux/uninstall.sh.in uninstall.sh
|
2018-07-21 22:43:39 +00:00
|
|
|
|
|
|
|
chmod +x scripts/mescc
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
Run:
|
2018-07-25 06:14:13 +00:00
|
|
|
./build.sh to build mes
|
|
|
|
./check.sh to check mes
|
|
|
|
./install.sh to install mes
|
2018-07-21 22:43:39 +00:00
|
|
|
EOF
|