-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·60 lines (60 loc) · 1.59 KB
/
configure
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
#! /bin/sh
# Written by Michael O'Reilly ([email protected])
# auto configure for LPmud 3.0
#
# Maybe something more general should be made, to be used by config.h ?
#
if (test -f config.data) then
echo config.data exists
echo -n 'read in config file ? (y/n):'
read ans
echo ans = $ans
if (test a$ans = ay) then
echo reading from config.data
read bin_dir mud_dir gcc nodebug < config.data
else
ASK=yes
fi
else
ASK=yes
fi
if (test $ASK) then
echo What directory is your binary directory?
echo -n :
read bin_dir
echo What directory is your mudlib in?
echo -n :
read mud_dir
gcc=no
if (test `which gcc|grep -v 'no gcc'` ) then
echo -n 'gcc found. Use it ? (Y/n):'
read ans
if (test a$ans != an) then
gcc=yes
fi
fi
echo -n 'Would you like run time debugging. (Y/n) :'
read ans
if (test an != a$ans) then
nodebug=no
else
nodebug=yes
fi
echo Writing a config.data
echo $bin_dir $mud_dir $gcc $nodebug > config.data
fi
echo bin = $bin_dir mud = $mud_dir
cp Makefile Makefile.old
chmod u+w Makefile
cat Makefile | sed 's!^BINDIR.*$!BINDIR = '$bin_dir'!' > Makefile.new
cat Makefile.new | sed 's!^MUD_LIB.*$!MUD_LIB = '$mud_dir'!' > Makefile
if (test $gcc = no) then
cat Makefile | sed 's!^WARN=.*$!WARN=!' | \
sed 's!CC=gcc!CC=cc!' > Makefile.new
mv Makefile.new Makefile
fi
if (test $nodebug = yes) then
cat Makefile | sed 's!^DEBUG=!#DEBUG=!' > Makefile.new
mv Makefile.new Makefile
fi
rm -f Makefile.new