-
Notifications
You must be signed in to change notification settings - Fork 1
/
Espresso
executable file
·63 lines (55 loc) · 1.81 KB
/
Espresso
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
# This is the Espresso-wrapper that is used in the source directory
# Copyright (C) 2007, Olaf Lenz
#
# This file is part of ESPResSo.
#
# ESPResSo 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.
#
# ESPResSo 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 this program. If not, see <http://www.gnu.org/licenses/>.
# get the name of the directory from the script name
script=$0
while test -L $script; do
script=`readlink -f "$script"`
done
dir=`dirname $script`
# if Makefile-am is not found there, we must assume that we are in
# the srcdir
if test ! -f $dir/Makefile-am; then
# try to find the objdir
objdir="$dir/obj-`$dir/config/config.guess`"
if test ! -d $objdir; then
# we didn't find the objdir
echo "Error: Could not find the build dir $objdir"
exit 1
fi
if test ! -f $objdir/Espresso; then
# we didn't find the Espresso script
echo "Error: Could not find Espresso in $objdir"
exit 1
fi
# found it: execute Espresso there
exec $objdir/Espresso "$@"
# otherwise we are in the objdir
else
# try to find the Espresso binary
if test ! -f $dir/Espresso_bin; then
echo "Error: Could not find Espresso_bin in $dir"
exit 1
fi
# call Espresso
if test .$2 != .; then NP=$2; else NP=2; fi
ESPRESSO_SCRIPTS=$HOME/Espresso/scripts
export ESPRESSO_SCRIPTS
ESPRESSO_CALL="$dir/Espresso_bin $*"
$ESPRESSO_CALL
fi