forked from newville/ifeffit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iconf_iff
executable file
·81 lines (71 loc) · 2.36 KB
/
iconf_iff
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
77
78
79
80
81
#!/bin/sh
##
## shell script to help configure ifeffit:
## 1. get version number from Changelog (and return to rest of configure script)
## 2. write maxpts.h and sys.h for ifeffit library
##
prefix=$1
ARRSIZE=$2
PACKAGE=$3
def_prefix=$4
test "x$prefix" = "xNONE" && prefix=$def_prefix
test "x$prefix" = "xNONE" && prefix='/usr/local'
test "x$prefix" = "x" && prefix='/usr/local'
test "x$ARRSIZE" = "x" && ARRSIZE='large'
test "x$PACKAGE" = "x" && PACKAGE='ifeffit'
VERSION=`grep '* Version' ChangeLog | head -1| sed 's/[ ]*\* Version[ ]*//g' | sed 's/:.*//g'`
srcdir='src/lib'
cright="Copyright (c) 2005 Matt Newville, Univ of Chicago"
##
## set arraysize to maxpts.h
case $ARRSIZE in
huge) size=16384 ;;
medium) size=4096 ;;
small) size=2048 ;;
tiny) size=1024 ;;
large) size=8192 ;;
*) size=4096 ;;
esac
current=`cat $srcdir/arrsize.dat`
maxpts_h="$srcdir/maxpts.h"
if test "x$current" == "x$size" && [ -f $maxpts_h ] ; then \
x=1
else
echo "c{maxpts.h -*-fortran-*- " > $maxpts_h
echo " integer maxpts, maxsize_array" >> $maxpts_h
echo " parameter(maxsize_array = $size)" >> $maxpts_h
echo " parameter(maxpts = maxsize_array)" >> $maxpts_h
echo "c}" >> $maxpts_h
echo "$size" > $srcdir/arrsize.dat
fi
##
## write sys.h
sys_h="$srcdir/sys.h"
echo "c{sys.h -*-fortran-*- " > $sys_h
echo "c system and build specific stuff goes here" >> $sys_h
echo "c to be included in iff_config.f" >> $sys_h
seglen=40
prefixlen=${#prefix}
let nseg=$prefixlen/$seglen
if [ $prefixlen -gt $seglen ]
then
echo " sysdir='${prefix:0:$seglen}'//" >> $sys_h
echo " $ '${prefix:$seglen:$prefixlen}'//" >> $sys_h
else
echo " sysdir='$prefix'//" >> $sys_h
fi
echo " $ '/share/$PACKAGE'" >> $sys_h
sysname=`uname`
if test $sysname = Darwin
then
echo " pgdev = '/AQT'" >> $sys_h
else
echo " pgdev = '/xserve'" >> $sys_h
fi
echo " inifile= 'startup.iff .ifeffit'" >> $sys_h
echo " build = '$VERSION'//" >> $sys_h
echo " $ ' $cright'" >> $sys_h
echo "c}" >> $sys_h
##
## finally, output the version number
echo $VERSION