File: aConfigure

package info (click to toggle)
magnus 4.1.1-beta-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 21,060 kB
  • ctags: 22,166
  • sloc: cpp: 154,830; ansic: 36,975; tcl: 10,579; perl: 1,109; makefile: 886; sh: 381; yacc: 368; csh: 57; awk: 33; asm: 10
file content (181 lines) | stat: -rwxr-xr-x 4,183 bytes parent folder | download | duplicates (2)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#!/bin/sh
##
##   $Id: aConfigure,v 1.4 2000/09/26 20:58:41 bormotov Exp $
##

## Copyright (C) 1994 The New York Group Theory Cooperative
## See magnus/doc/COPYRIGHT for the full notice.

## Contents: Configuration script for Magnus
##
## Principal Author: Jon Lennox
##
## Status: Useable.
##
## Revision History:
##
## 05/30/95 Roger modified this for use with alpha releases.


echo "Setting up default Magnus paths..."
echo

DEFAULT_MAGNUSHOME=`pwd`
DEFAULT_MAGNUSCURRENTHOME=`pwd`
DEFAULT_WISH=/usr/bin/wish
DEFAULT_MAGNUSTMP=/tmp
MAGNUSTMP=/tmp

echo "Enter the path to the Magnus source tree (the directory where"
echo "the Magnus source is currently located):"
echo -n "[$DEFAULT_MAGNUSCURRENTHOME]"
read MAGNUSCURRENTHOME
if [ "$MAGNUSCURRENTHOME" = "" ]
then
	MAGNUSCURRENTHOME=$DEFAULT_MAGNUSCURRENTHOME
fi

echo -n "Checking existence of $MAGNUSCURRENTHOME ... "
if [ -d $MAGNUSCURRENTHOME ]
then
	echo "ok"
else
	echo
	echo "Uh-oh ... $MAGNUSCURRENTHOME doesn't seem to exist!"
	echo -n "Continue? [n]"
	read YN
	if [ "`echo $YN | sed 's/\(.\).*/\1/'`" != "y" ]
	then
		exit 1
	fi
fi

# this section should wait until we have a real install script

#echo
#echo "Enter the path to the Magnus root directory (the directory where "
#echo "Magnus will eventually be installed):"
#echo -n [$DEFAULT_MAGNUSHOME]"
#read MAGNUSHOME
#if [ "$MAGNUSHOME" = "" ]
#then
#	MAGNUSHOME=$DEFAULT_MAGNUSHOME
#fi
#
#echo -n "Checking existence of $MAGNUSHOME ... "
#if [ -d $MAGNUSHOME ]
#then
#	echo "ok"
#else
#	echo
#	echo "Uh-oh ... $MAGNUSHOME doesn't seem to exist!"
#	echo -n "Continue? [y]"
#	read YN
#	if [ "`echo $YN | sed 's/\(.\).*/\1/'`" = "n" ]
#	then
#		exit 1
#	fi
#fi

# in the meantime, just do this

MAGNUSHOME=$MAGNUSCURRENTHOME

echo
echo "Enter the path to the Wish executable (with the addinput extensions):"
echo -n "[$DEFAULT_WISH]"
read WISH
if [ "$WISH" = "" ]
then
	WISH=$DEFAULT_WISH
fi

echo -n "Checking existence of $WISH ... "
if [ -x $WISH ]
then
	echo "ok"
else
	echo
	echo "Uh-oh ... $WISH doesn't seem to exist!"
	echo -n "Continue? [n]"
	read YN
	if [ "`echo $YN | sed 's/\(.\).*/\1/'`" != "y" ]
	then
		exit 1
	fi
fi

echo "Enter the path to the Magnus temporary directory:"
echo -n  "[$DEFAULT_MAGNUSTMP]"
read MAGNUSTMP
if [ "$MAGNUSTMP" = "" ]
then
	MAGNUSTMP=$DEFAULT_MAGNUSTMP
fi

echo -n "Checking existence of $MAGNUSTMP ... "
if [ -d $MAGNUSTMP ]
then
	echo "ok"
else
	echo
	echo "Uh-oh ... $MAGNUSTMP doesn't seem to exist!"
	echo -n "Continue? [n]"
	read YN
	if [ "`echo $YN | sed 's/\(.\).*/\1/'`" != "y" ]
	then
		exit 1
	fi
fi

SEDSCRIPT="s,%MAGNUSHOME%,$MAGNUSHOME,;s,%WISH%,$WISH,;s,%MAGNUSTMP%,$MAGNUSTMP,"

## Leave this out for alpha releases:
##
#echo
#echo "Creating $MAGNUSCURRENTHOME/back_end/global/config.h ..."
#if [ ! -f $MAGNUSCURRENTHOME/back_end/global/config.h.in ]
#then
#	echo "$MAGNUSCURRENTHOME/back_end/global/config.h.in is missing!"
#	exit 1
#fi
#
#if [ -f $MAGNUSCURRENTHOME/back_end/global/config.h ]
#then
#	echo "	$MAGNUSCURRENTHOME/back_end/global/config.h already exists!"
#	echo "	Copying it to $MAGNUSCURRENTHOME/back_end/global/config.h.old"
#	cp $MAGNUSCURRENTHOME/back_end/global/config.h $MAGNUSCURRENTHOME/back_end/global/config.h.old
#fi
#
#sed $SEDSCRIPT < $MAGNUSCURRENTHOME/back_end/global/config.h.in > $MAGNUSCURRENTHOME/back_end/global/config.h
#
#echo "$MAGNUSCURRENTHOME/back_end/global/config.h created."

echo
echo "Creating $MAGNUSCURRENTHOME/front_end/magnus ..."
if [ ! -f $MAGNUSCURRENTHOME/front_end/magnus.in ]
then
	echo "$MAGNUSCURRENTHOME/front_end/magnus.in is missing!"
	exit 1
fi

if [ -f $MAGNUSCURRENTHOME/front_end/magnus ]
then
	echo "	$MAGNUSCURRENTHOME/front_end/magnus already exists!"
	echo "	Copying it to $MAGNUSCURRENTHOME/front_end/magnus.old"
	cp $MAGNUSCURRENTHOME/front_end/magnus $MAGNUSCURRENTHOME/front_end/magnus.old
fi

sed $SEDSCRIPT < $MAGNUSCURRENTHOME/front_end/magnus.in > $MAGNUSCURRENTHOME/front_end/magnus

chmod ug+x $MAGNUSCURRENTHOME/front_end/magnus
chmod 777 $MAGNUSCURRENTHOME
chmod 777 $MAGNUSCURRENTHOME/back_end/SessionManager/test/bin/tmp

echo "$MAGNUSCURRENTHOME/front_end/magnus created."

echo

echo "Configuration complete."

exit 0