-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·125 lines (125 loc) · 2.78 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
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
#!/bin/bash
#
MAKE=Makefile.global.in
PREFIX=/usr/local
DEVEL=0
SOUND=1
OPENGL=1
for arg in $1 $2 $3 $4 $5 $6 $7 $8 $9
do
case $arg in
"--help") echo "--enable-devel - developer mode"
echo "--disable-sound - w\o sound (if you don't have SDL_mixer)"
exit ;;
"--enable-devel") DEVEL=1 ;;
"--disable-sound") SOUND=0 ;;
"--disable-opengl") OPENGL=0 ;;
"--prefix="*) PREFIX=${arg:9:265} ;;
esac
done
echo -n "#generated on " > $MAKE
date >> $MAKE
echo -n "checking for gcc..."
if which gcc &> /dev/null; then
echo "yes"
echo "CC=gcc" >> $MAKE
else
echo "no"
echo "#error#"
exit
fi;
echo -n "checking for coffee..."
if which coffee &> /dev/null; then
echo "yes"
echo "COFFEE=coffee" >> $MAKE
else
echo "no"
fi;
UGLIFY=cat
echo -n "checking for uglifyjs..."
if which uglifyjs &> /dev/null; then
echo "yes"
UGLIFY=uglifyjs
else
echo "no"
fi;
echo -n "checking for closure..."
if which closure &> /dev/null; then
echo "yes"
UGLIFY=closure
else
echo "no"
fi;
echo "UGLIFY=$UGLIFY" >> $MAKE
echo -n "writing prefix..."
echo $PREFIX
echo -n "checking os..."
echo "prefix=$PREFIX" >> $MAKE
echo "DESTDIR=" >> $MAKE
echo "PREFIX=\$(DESTDIR)\$(prefix)" >> $MAKE
if [ $HOME ]; then
echo "unix"
echo "OS=-DUNIX" >> $MAKE
else
echo "win32"
echo "OS=-DWIN32" >> $MAKE
fi;
echo -n "developer mode..."
if [ $DEVEL = 1 ]; then
echo "yes"
else
echo "no"
echo -n "#" >> $MAKE
fi;
echo "DEVEL=-DDEVEL" >> $MAKE
echo -n "checking for SDL..."
if sdl-config --version &> /dev/null; then
echo `sdl-config --version`
CLIBS=`sdl-config --libs`
else
echo "no"
echo "#error#"
exit
fi;
echo "SDLFLAGS=`sdl-config --cflags`" >> $MAKE
CLIBS="$CLIBS -lSDL_image"
echo -n "checking for SDL_mixer..."
if [ $SOUND = 1 ]; then
if ldd /usr/lib/libSDL_mixer.so* &> /dev/null; then
echo "yes"
CLIBS="$CLIBS -lSDL_mixer"
else
echo "no"
echo -n "#" >> $MAKE
fi;
else
echo "no"
echo -n "#" >> $MAKE
fi;
echo "SOUND=-DSOUND" >> $MAKE
echo -n "checking for OpenGL..."
if [ $OPENGL = 1 ]; then
if ldd /usr/lib/libGL.so* &> /dev/null; then
echo "yes"
CLIBS="$CLIBS -lGL"
else
echo "no"
echo -n "#" >> $MAKE
fi;
else
echo "no"
echo -n "#" >> $MAKE
fi;
echo "OPENGL=-DOPENGL" >> $MAKE
echo "CFLAGS=-O2 \$(SDLFLAGS) \$(OS) \$(DEVEL) \$(SOUND) \$(OPENGL)" >> $MAKE
echo "WORKDIR=\$(PREFIX)/games/oki" >> $MAKE
echo "CLIBS=$CLIBS" >> $MAKE
echo "Creating Makefile.global"
mv $MAKE Makefile.global
echo "Creating Makefile"
mv Makefile.in Makefile &> /dev/null
echo "Creating oki"
echo -e "#!/bin/bash\ncd $PREFIX/games/oki\n./oki \044*" > extra/oki_bash
chmod a=rx extra/oki_bash
echo
echo "type \"make\""