Code update for Window Maker version 0.50.0
[wmaker-crm.git] / Install
blob586b2db9e0d514c723873dbc4f1880991fd5339a
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
47 if test "$USER" != "root"; then
48 echo
49 echo "Warning: you must run this script as root to install"
50 echo "Window Maker. Hit <Control>-<C> to quit this script."
51 perai
52 echo
56 echo
57 echo "Option Selection"
58 echo "================"
60 ######################## KDE
61 echo
62 echo "Do you want KDE support?"
63 echo -n <y/n> [n] "
64 read kde
65 if [ "$kde" = y -o "$kde" = Y ]; then
66 OPTIONS="$OPTIONS --enable-kde"
67 echo "Do you want to disable features that become duplicated with"
68 echo "KDE support (like root menus)?"
69 echo -n <y/n> [n] "
70 read lite
71 if [ "$lite" = y -o "lite" = Y ]; then
72 OPTIONS="$OPTIONS --enable-lite"
76 ######################## GNOME
77 echo
78 echo "Do you want GNOME support?"
79 echo -n <y/n> [n] "
80 read gnome
81 if [ "$gnome" = y -o "$gnome" = Y ]; then
82 OPTIONS="$OPTIONS --enable-gnome"
85 ######################## NLS
86 echo
87 echo "Do you want National Language Support?"
88 echo -n "<y/n> [n] "
89 read NLS
91 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
92 NLS="Y"
93 echo "The supported locales are:"
94 ling=` (cd po; /bin/ls *.po) `
95 ALL_LINGUAS=""
96 for l in $ling; do
97 lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
98 lname=`echo $lname`
99 lcode=`basename $l .po`
100 ALL_LINGUAS="$ALL_LINGUAS $lcode"
101 echo "$lcode $lname"
102 done
103 echo "Type in the locales you want (all will install everything) [none]"
104 read foo
105 if test "$foo" = "all"; then
106 LINGUAS="$ALL_LINGUAS"
107 else
108 LINGUAS="$foo"
110 echo "Selected locales are: $LINGUAS"
112 MB=""
113 for i in $LINGUAS; do
114 ok=0
115 for b in $ALL_LINGUAS; do
116 if test "$b" = "$i"; then
117 ok=1
118 break
120 done
121 if test "$ok" = "0"; then
122 echo
123 echo "$i is not a supported locale"
124 perai
125 continue
128 if [ "$MB" = "" -a "$i" = "ja" -o "$i" = "kr" ]; then
129 echo
130 echo "A language you selected needs multi-byte character support"
131 echo "Do you want to enable it?"
132 echo -n "<y/n> [n] "
133 read MB
134 if [ "$MB" = "y" -o "$MB" = "Y" ]; then
135 OPTIONS="$OPTIONS --enable-kanji"
138 done
139 echo
140 echo "Where do you want to put the message files? [$NLSDIR]"
141 echo -n "? "
142 read foo
143 if test "x$foo" != "x"; then
144 NLSDIR=$foo
147 ##################### Installation path
149 done=0
150 while [ $done = 0 ]; do
151 echo
152 echo "Where do you want to install Window Maker? [$PREFIX]"
153 echo "Don't change it if you don't know what you're doing."
154 if test $USER != root; then
155 echo "Make sure to specify a path where you have write permission."
157 echo "(The default will put Window Maker in $PREFIX/bin, $PREFIX/lib etc.)"
158 echo -n "? "
159 read foo
160 if test "x$foo" != "x"; then
161 if [ "$foo" = "y" -o "$foo" = "n" ]; then
162 echo
163 echo "Hmm... I don't think you really want to install Window Maker into \"$foo\""
164 echo
165 else
166 done=1
167 PREFIX=$foo
169 else
170 done=1
172 echo
173 echo "$PREFIX/bin must be in the PATH environment variable of all users who use Window Maker"
174 perai
175 done
177 OPTIONS="$OPTIONS --prefix=$PREFIX"
181 ##################### Configure
182 echo "--------------------------"
183 echo "Configuring Window Maker..."
184 echo "--------------------------"
185 if [ `uname -s` = "SCO_SV" ]; then
186 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
188 CFLAGS="$CFLAGS -belf -DANSICPP"
190 perform ./configure $OPTIONS
191 else
192 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
194 CFLAGS="$CFLAGS $GCCFLAGS"
196 perform ./configure $OPTIONS
200 #################### Compile
201 echo "-------------------------"
202 echo "Compiling Window Maker..."
203 echo "-------------------------"
204 (cd src; perform make clean)
205 perform make
207 echo "--------------------------"
208 echo "Installing Window Maker..."
209 echo "--------------------------"
211 perform make install
213 echo
214 echo "Installation Finished!"
215 echo
216 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
217 echo "script that was just installed."
220 if test "$NLS" = "Y"; then
221 echo "Don't forget to set the LANG environment variable to your locale"