-
Notifications
You must be signed in to change notification settings - Fork 0
/
config
76 lines (65 loc) · 1.61 KB
/
config
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#! /bin/sh
usage () {
echo "Usage: config [options] <configuration>"
echo " where one of the following options must be selected: "
echo " -d (debug)"
echo " -O (optimized)"
echo " -p (profiling)"
echo " and <configuration> is one of the following:"
echo " lf95 (Lahey-Fujitsu fortran95 compiler"
echo " intel (Intel fortran95 compiler vers. 8 and later)"
echo " MAC (Intel Fortran95 compiler for MAC)"
echo " gfortran (GNU F95 compiler) requires gcc 4.1 and later "
echo " the program may compile with the following compilers,"
echo " but there are problems: "
echo " HP90 (HP FORTRAN 90)"
echo " g95 (g95 free software, http://g95.sourceforge.net)"
exit 1
}
if [ $# -lt 1 ]; then
usage
fi
# Compilation options (debug/optimize)
opt="d"
if [ "$1" = "-d" ]; then
opt="d"
shift
elif [ "$1" = "-p" ]; then
opt="p"
shift
elif [ "$1" = "-O" ]; then
opt="O"
shift
fi
if [ $# -ne 1 ]; then
usage
fi
# Configuration
conf=$1
mffile=conf/mf.$conf.$opt
optfile=conf/opt.$conf
if [ ! -f $mffile ]; then
usage
fi
# Makefile options
cp $mffile src/make.flags
if [ -f conf/rules ]; then
cat conf/rules >> src/make.flags
fi
# Selection of installation-dependent source files
if [ -f $optfile ]; then
. $optfile
fi
for dir in ephem propag suit orbfit include
do
if [ -d src/$dir ]; then
cd src/$dir
# ../lib/inst_src $SRCSEL
if [ -f config.sh ]; then
./config.sh
fi
cd ../..
fi
done
echo $conf $opt > .conf.status
echo $conf > src/.compiler