Update to Window Maker 0.50.2
[wmaker-crm.git] / Install
blobb8d68aea76777dccf394801575ff302f8afeb7d2
1 #!/bin/sh
3 # WindowMaker configuration and compilation script.
5 # Copyright (c) 1997, 1998 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 INSTALL and FAQ files before e-mailing "
43 echo "questions. (we are lazy to reply questions already answered "
44 echo "there as much as you are lazy to read these ;) "
45 perai
46 echo "Did you read the INSTALL file?"
47 echo -n "<y/n> "
48 read rtfm
49 if [ "$rtfm" != y ]; then
50 echo "Please read the INSTALL file before installing"
51 exit
53 echo "Are you sure?"
54 echo -n "<y/n> "
55 read rtfm
56 if [ "$rtfm" != y ]; then
57 echo "Please read the INSTALL file before installing"
58 exit
61 if test "$USER" != "root"; then
62 echo
63 echo "Warning: you must run this script as root to install"
64 echo "Window Maker. Hit <Control>-<C> to quit this script."
65 perai
66 echo
70 echo
71 echo "Option Selection"
72 echo "================"
74 ######################## KDE
75 echo
76 echo "Do you want KDE support?"
77 echo -n "<y/n> [n] "
78 read kde
79 if [ "$kde" = y -o "$kde" = Y ]; then
80 OPTIONS="$OPTIONS --enable-kde"
81 echo "Do you want to disable features that become duplicated with"
82 echo "KDE support (like root menus)?"
83 echo -n "<y/n> [n] "
84 read lite
85 if [ "$lite" = y -o "lite" = Y ]; then
86 OPTIONS="$OPTIONS --enable-lite"
90 ######################## GNOME
91 echo
92 echo "Do you want GNOME support?"
93 echo -n "<y/n> [n] "
94 read gnome
95 if [ "$gnome" = y -o "$gnome" = Y ]; then
96 OPTIONS="$OPTIONS --enable-gnome"
99 ######################## NLS
100 echo
101 echo "Do you want National Language Support?"
102 echo -n "<y/n> [n] "
103 read NLS
105 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
106 NLS="Y"
107 echo "The supported locales are:"
108 ling=` (cd po; /bin/ls *.po) `
109 ALL_LINGUAS=""
110 for l in $ling; do
111 lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
112 lname=`echo $lname`
113 lcode=`basename $l .po`
114 ALL_LINGUAS="$ALL_LINGUAS $lcode"
115 echo "$lcode $lname"
116 done
117 echo "Type in the locales you want (all will install everything) [none]"
118 read foo
119 if test "$foo" = "all"; then
120 LINGUAS="$ALL_LINGUAS"
121 else
122 LINGUAS="$foo"
124 echo "Selected locales are: $LINGUAS"
126 MB=""
127 for i in $LINGUAS; do
128 ok=0
129 for b in $ALL_LINGUAS; do
130 if test "$b" = "$i"; then
131 ok=1
132 break
134 done
135 if test "$ok" = "0"; then
136 echo
137 echo "$i is not a supported locale"
138 perai
139 continue
142 if [ "$MB" = "" -a "$i" = "ja" -o "$i" = "kr" ]; then
143 echo
144 echo "A language you selected needs multi-byte character support"
145 echo "Do you want to enable it?"
146 echo -n "<y/n> [n] "
147 read MB
148 if [ "$MB" = "y" -o "$MB" = "Y" ]; then
149 OPTIONS="$OPTIONS --enable-kanji"
152 done
153 echo
154 echo "Where do you want to put the message files? [$NLSDIR]"
155 echo -n "? "
156 read foo
157 if test "x$foo" != "x"; then
158 NLSDIR=$foo
161 ##################### Installation path
163 done=0
164 while [ $done = 0 ]; do
165 echo
166 echo "Where do you want to install Window Maker? [$PREFIX]"
167 echo "Don't change it if you don't know what you're doing."
168 if test "$USER" != "root"; then
169 echo "Make sure to specify a path where you have write permission."
171 echo "(The default will put Window Maker in $PREFIX/bin, $PREFIX/lib etc.)"
172 echo -n "? "
173 read foo
174 if test "x$foo" != "x"; then
175 if [ "$foo" = "y" -o "$foo" = "n" ]; then
176 echo
177 echo "Hmm... I don't think you really want to install Window Maker into \"$foo\""
178 echo
179 else
180 done=1
181 PREFIX=$foo
183 else
184 done=1
186 echo
187 echo " $PREFIX/bin must be in the PATH environment variable of all users"
188 echo "will who use Window Maker"
189 echo " Make sure $PREFIX/lib is in the /etc/ld.so.conf file"
190 perai
191 done
193 OPTIONS="$OPTIONS --prefix=$PREFIX"
197 ##################### Configure
198 echo "--------------------------"
199 echo "Configuring Window Maker..."
200 echo "--------------------------"
201 if [ `uname -s` = "SCO_SV" ]; then
202 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
204 CFLAGS="$CFLAGS -belf -DANSICPP"
206 perform ./configure $OPTIONS
207 else
208 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
210 CFLAGS="$CFLAGS $GCCFLAGS"
212 perform ./configure $OPTIONS
216 #################### Compile
217 echo "-------------------------"
218 echo "Compiling Window Maker..."
219 echo "-------------------------"
220 (cd src; perform make clean)
221 perform make
223 echo "--------------------------"
224 echo "Installing Window Maker..."
225 echo "--------------------------"
227 perform make install
229 if [ `uname -s` = "Linux" ]; then
230 /sbin/ldconfig -v
233 echo
234 echo "Installation Finished!"
235 echo
236 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
237 echo "script that was just installed."
240 if test "$NLS" = "Y"; then
241 echo "Don't forget to set the LANG environment variable to your locale"