fixed bug with zombies after wmaker crashed
[wmaker-crm.git] / Install
blobf1a95a6dd8c810019449d3da7025d0fbb156a340
1 #!/bin/sh
3 # WindowMaker configuration and compilation script.
5 # Copyright (c) 1997, 1998, 1999 Alfredo K. Kojima
8 export LINGUAS;LINGUAS=""
9 if test "$NLSDIR" = ""; then
10 export NLSDIR;NLSDIR="/usr/lib/locale"
14 OPTIONS=""
15 PREFIX="/usr/local"
17 perai() {
18 echo "Type <Return> to continue"
19 read nada
23 perform() {
24 if ! $* ; then
25 echo
26 echo "Window Maker installation failed or aborted by user."
27 exit 1
31 help() {
32 echo "Usage: $(basename $0) <switch>"
33 echo "Where switches are:"
34 echo " -s --quiet make silent build"
35 echo " -h --help show this message"
36 echo ""
37 exit $1
41 OPTIONS=""
42 MAKE_OPTIONS=""
43 while [ -n "$1" ]
45 case "$1" in
46 "-s"|"--quiet") OPTIONS="--quiet"
47 MAKE_OPTIONS="-s";;
48 "-h"|"--help") help 0;;
49 *) echo "bad command-line parameter $1"
50 help 1;;
51 esac
52 shift
53 done
55 trap "echo Window Maker installation aborted. ; exit 1" 2 3
57 echo
58 echo "========================="
59 echo "Window Maker Installation"
60 echo "========================="
61 echo
62 echo "NOTE: If this script fails, read the INSTALL file and"
63 echo "install by hand."
64 echo
65 echo "Please read the README, INSTALL and FAQ files before e-mailing "
66 echo "questions. We will IGNORE any questions that are already"
67 echo "answered in the documentation."
68 echo
69 perai
70 echo "Did you read the INSTALL file?"
71 echo -n "<y/n> "
72 read rtfm
73 if [ "$rtfm" != y ]; then
74 echo "Please read the INSTALL file before installing"
75 exit
77 echo "Are you sure?"
78 echo -n "<y/n> "
79 read rtfm
80 if [ "$rtfm" != y ]; then
81 echo "Please read the INSTALL file before installing"
82 exit
84 echo "Are you lying?"
85 echo -n "<y/n> "
86 read rtfm
87 if [ "$rtfm" != n ]; then
88 echo "What a shame!"
89 echo "Please read the INSTALL file before installing"
90 exit
92 echo "Do you *swear* that you really read the INSTALL file?"
93 echo -n "<y/n> "
94 read rtfm
95 if [ "$rtfm" != y ]; then
96 echo "Please read the INSTALL file before installing"
97 exit
99 echo "Last chance. You will not get help if you have some problem"
100 echo "because you didn't read that file. Even if your computer explodes."
101 echo "Do you *really* read it?"
102 echo -n "<y/n> "
103 read rtfm
104 if [ "$rtfm" != y ]; then
105 echo "Please read the INSTALL file before installing"
106 exit
108 echo
109 echo "Ok, you have been warned."
110 echo
111 perai
114 if test "$USER" != "root"; then
115 echo
116 echo "Warning: you must run this script as root to install"
117 echo "Window Maker. Hit <Control>-<C> to quit this script."
118 perai
119 echo
123 echo
124 echo "Option Selection"
125 echo "================"
127 ######################## KDE
128 echo
129 echo "Do you want KDE support?"
130 echo -n "<y/n> [n] "
131 read kde
132 if [ "$kde" = y -o "$kde" = Y ]; then
133 OPTIONS="$OPTIONS --enable-kde"
136 ######################## GNOME
137 echo
138 echo "Do you want GNOME support?"
139 echo -n "<y/n> [n] "
140 read gnome
141 if [ "$gnome" = y -o "$gnome" = Y ]; then
142 OPTIONS="$OPTIONS --enable-gnome"
145 ######################## OLWM
146 echo
147 echo "Do you want OPEN LOOK(tm)/olwm support?"
148 echo -n "<y/n> [n] "
149 read olwm
150 if [ "$olwm" = y -o "$olwm" = Y ]; then
151 OPTIONS="$OPTIONS --enable-openlook"
154 ######################## NLS
155 echo
156 echo "Do you want National Language Support?"
157 echo -n "<y/n> [n] "
158 read NLS
160 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
161 NLS="Y"
162 echo "The supported locales are:"
163 ling=` (cd po; /bin/ls *.po) `
164 ALL_LINGUAS=""
165 for l in $ling; do
166 lname=`(cd po; grep Language-Team $l|cut -f2- -d:|cut -f1 -d\\\\|cut -f1 -d\<)`
167 lname=`echo $lname`
168 lcode=`basename $l .po`
169 ALL_LINGUAS="$ALL_LINGUAS $lcode"
170 echo "$lcode $lname"
171 done
172 echo "Type in the locales you want (all will install everything) [none]"
173 read foo
174 if test "$foo" = "all"; then
175 LINGUAS="$ALL_LINGUAS"
176 else
177 LINGUAS="$foo"
179 echo "Selected locales are: $LINGUAS"
181 MB=""
182 for i in $LINGUAS; do
183 ok=0
184 for b in $ALL_LINGUAS; do
185 if test "$b" = "$i"; then
186 ok=1
187 break
189 done
190 if test "$ok" = "0"; then
191 echo
192 echo "$i is not a supported locale"
193 perai
194 continue
197 done
198 echo
199 echo "Where do you want to put the message files? [$NLSDIR]"
200 echo -n "? "
201 read foo
202 if test "x$foo" != "x"; then
203 NLSDIR=$foo
206 ##################### Installation path
208 done=0
209 while [ $done = 0 ]; do
210 echo
211 echo "Where do you want to install Window Maker? [$PREFIX]"
212 echo "Don't change it if you don't know what you're doing."
213 if test "$USER" != "root"; then
214 echo "Make sure to specify a path where you have write permission."
216 echo "(The default will put Window Maker in $PREFIX/bin, $PREFIX/lib etc.)"
217 echo -n "? "
218 read foo
219 if test "x$foo" != "x"; then
220 if [ "$foo" = "y" -o "$foo" = "n" ]; then
221 echo
222 echo "Hmm... I don't think you really want to install Window Maker into \"$foo\""
223 echo
224 else
225 done=1
226 PREFIX=$foo
228 else
229 done=1
231 echo
232 echo " $PREFIX/bin must be in the PATH environment variable"
233 echo "of all users who will use Window Maker"
234 perai
235 done
237 OPTIONS="$OPTIONS --prefix=$PREFIX"
240 ##################### Install stripped binaries?
242 INSTALL="install"
243 echo "Do you want stripped binaries to be installed?"
244 echo "Installed binaries will be smaller (with debug info removed)."
245 echo -n "<y/n> [n] "
246 read foo
247 if [ "$foo" = y -o "$foo" = Y ]; then
248 INSTALL="install-strip"
252 ##################### Configure
253 echo "--------------------------"
254 echo "Configuring Window Maker..."
255 echo "--------------------------"
256 if [ `uname -s` = "SCO_SV" ]; then
257 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
259 CFLAGS="$CFLAGS -belf -DANSICPP"
261 perform ./configure $OPTIONS
262 else
263 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
265 CFLAGS="$CFLAGS $GCCFLAGS"
267 perform ./configure $OPTIONS
271 #################### Compile
272 echo "-------------------------"
273 echo "Compiling Window Maker..."
274 echo "-------------------------"
275 (cd src; perform make $MAKE_OPTIONS clean)
276 perform make $MAKE_OPTIONS
278 echo "--------------------------"
279 echo "Installing Window Maker..."
280 echo "--------------------------"
282 perform make $MAKE_OPTIONS $INSTALL
284 if [ `uname -s` = "Linux" ]; then
285 echo
286 echo " Make sure $PREFIX/lib is in the /etc/ld.so.conf file"
287 /sbin/ldconfig
290 echo
291 echo "Installation Finished!"
292 echo
293 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
294 echo "script that was just installed."
297 if test "$NLS" = "Y"; then
298 echo "Don't forget to set the LANG environment variable to your locale"