benchmark on pentium stuff
[wmaker-crm.git] / Install
blob7afdf9b818836bac4539a5ce187dd7ac64ebfa3f
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
32 trap "echo Window Maker installation aborted. ; exit 1" 2 3
34 echo
35 echo "========================="
36 echo "Window Maker Installation"
37 echo "========================="
38 echo
39 echo "NOTE: If this script fails, read the INSTALL file and"
40 echo "install by hand."
41 echo
42 echo "Please read the README, INSTALL and FAQ files before e-mailing "
43 echo "questions. We will IGNORE any questions that are already"
44 echo "answered in the documentation."
45 echo
46 perai
47 echo
48 echo "Did you install libPropList? If not, please install it now."
49 echo
50 perai
51 echo "Did you read the INSTALL file?"
52 echo -n "<y/n> "
53 read rtfm
54 if [ "$rtfm" != y ]; then
55 echo "Please read the INSTALL file before installing"
56 exit
58 echo "Are you sure?"
59 echo -n "<y/n> "
60 read rtfm
61 if [ "$rtfm" != y ]; then
62 echo "Please read the INSTALL file before installing"
63 exit
65 echo "Are you lying?"
66 echo -n "<y/n> "
67 read rtfm
68 if [ "$rtfm" != n ]; then
69 echo "What a shame!"
70 echo "Please read the INSTALL file before installing"
71 exit
73 echo "Do you *swear* that you really read the INSTALL file?"
74 echo -n "<y/n> "
75 read rtfm
76 if [ "$rtfm" != y ]; then
77 echo "Please read the INSTALL file before installing"
78 exit
80 echo "Last chance. You will not get help if you have some problem"
81 echo "because you didn't read that file. Even if your computer explodes."
82 echo "Do you *really* read it?"
83 echo -n "<y/n> "
84 read rtfm
85 if [ "$rtfm" != y ]; then
86 echo "Please read the INSTALL file before installing"
87 exit
89 echo
90 echo "Ok, you have been warned."
91 echo
92 perai
95 if test "$USER" != "root"; then
96 echo
97 echo "Warning: you must run this script as root to install"
98 echo "Window Maker. Hit <Control>-<C> to quit this script."
99 perai
100 echo
104 echo
105 echo "Option Selection"
106 echo "================"
108 ######################## KDE
109 echo
110 echo "Do you want KDE support?"
111 echo -n "<y/n> [n] "
112 read kde
113 if [ "$kde" = y -o "$kde" = Y ]; then
114 OPTIONS="$OPTIONS --enable-kde"
117 ######################## GNOME
118 echo
119 echo "Do you want GNOME support?"
120 echo -n "<y/n> [n] "
121 read gnome
122 if [ "$gnome" = y -o "$gnome" = Y ]; then
123 OPTIONS="$OPTIONS --enable-gnome"
126 ######################## OLWM
127 echo
128 echo "Do you want OPEN LOOK(tm)/olwm support?"
129 echo -n "<y/n> [n] "
130 read olwm
131 if [ "$olwm" = y -o "$olwm" = Y ]; then
132 OPTIONS="$OPTIONS --enable-openlook"
135 ######################## NLS
136 echo
137 echo "Do you want National Language Support?"
138 echo -n "<y/n> [n] "
139 read NLS
141 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
142 NLS="Y"
143 echo "The supported locales are:"
144 ling=` (cd po; /bin/ls *.po) `
145 ALL_LINGUAS=""
146 for l in $ling; do
147 lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
148 lname=`echo $lname`
149 lcode=`basename $l .po`
150 ALL_LINGUAS="$ALL_LINGUAS $lcode"
151 echo "$lcode $lname"
152 done
153 echo "Type in the locales you want (all will install everything) [none]"
154 read foo
155 if test "$foo" = "all"; then
156 LINGUAS="$ALL_LINGUAS"
157 else
158 LINGUAS="$foo"
160 echo "Selected locales are: $LINGUAS"
162 MB=""
163 for i in $LINGUAS; do
164 ok=0
165 for b in $ALL_LINGUAS; do
166 if test "$b" = "$i"; then
167 ok=1
168 break
170 done
171 if test "$ok" = "0"; then
172 echo
173 echo "$i is not a supported locale"
174 perai
175 continue
178 done
179 echo
180 echo "Where do you want to put the message files? [$NLSDIR]"
181 echo -n "? "
182 read foo
183 if test "x$foo" != "x"; then
184 NLSDIR=$foo
187 ##################### Installation path
189 done=0
190 while [ $done = 0 ]; do
191 echo
192 echo "Where do you want to install Window Maker? [$PREFIX]"
193 echo "Don't change it if you don't know what you're doing."
194 if test "$USER" != "root"; then
195 echo "Make sure to specify a path where you have write permission."
197 echo "(The default will put Window Maker in $PREFIX/bin, $PREFIX/lib etc.)"
198 echo -n "? "
199 read foo
200 if test "x$foo" != "x"; then
201 if [ "$foo" = "y" -o "$foo" = "n" ]; then
202 echo
203 echo "Hmm... I don't think you really want to install Window Maker into \"$foo\""
204 echo
205 else
206 done=1
207 PREFIX=$foo
209 else
210 done=1
212 echo
213 echo " $PREFIX/bin must be in the PATH environment variable"
214 echo "of all users who will use Window Maker"
215 perai
216 done
218 OPTIONS="$OPTIONS --prefix=$PREFIX"
222 ##################### Configure
223 echo "--------------------------"
224 echo "Configuring Window Maker..."
225 echo "--------------------------"
226 if [ `uname -s` = "SCO_SV" ]; then
227 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
229 CFLAGS="$CFLAGS -belf -DANSICPP"
231 perform ./configure $OPTIONS
232 else
233 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
235 CFLAGS="$CFLAGS $GCCFLAGS"
237 perform ./configure $OPTIONS
241 #################### Compile
242 echo "-------------------------"
243 echo "Compiling Window Maker..."
244 echo "-------------------------"
245 (cd src; perform make clean)
246 perform make
248 echo "--------------------------"
249 echo "Installing Window Maker..."
250 echo "--------------------------"
252 perform make install
254 if [ `uname -s` = "Linux" ]; then
255 echo
256 echo " Make sure $PREFIX/lib is in the /etc/ld.so.conf file"
257 /sbin/ldconfig
260 echo
261 echo "Installation Finished!"
262 echo
263 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
264 echo "script that was just installed."
267 if test "$NLS" = "Y"; then
268 echo "Don't forget to set the LANG environment variable to your locale"