Bug fixes for 0.20.3 pre-release 2
[wmaker-crm.git] / Install
blob56c21b955ed97f32c5e59ff951ca824400c95da0
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."
44 perai
46 if test "$USER" != "root"; then
47 echo
48 echo "Warning: you must run this script as root to install"
49 echo "Window Maker. Hit <Control>-<C> to quit this script."
50 perai
51 echo
55 echo
56 echo "Option Selection"
57 echo "================"
60 ######################## NLS
61 echo
62 echo "Do you want National Language Support?"
63 echo -n "<y/n> [n] "
64 read NLS
66 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
67 NLS="Y"
68 echo "The supported locales are:"
69 ling=` (cd po; /bin/ls *.po) `
70 ALL_LINGUAS=""
71 for l in $ling; do
72 lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
73 lname=`echo $lname`
74 lcode=`basename $l .po`
75 ALL_LINGUAS="$ALL_LINGUAS $lcode"
76 echo "$lcode $lname"
77 done
78 echo "Type in the locales you want (all will install everything) [none]"
79 read foo
80 if test "$foo" = "all"; then
81 LINGUAS="$ALL_LINGUAS"
82 else
83 LINGUAS="$foo"
85 echo "Selected locales are: $LINGUAS"
87 MB=""
88 for i in $LINGUAS; do
89 ok=0
90 for b in $ALL_LINGUAS; do
91 if test "$b" = "$i"; then
92 ok=1
93 break
95 done
96 if test "$ok" = "0"; then
97 echo
98 echo "$i is not a supported locale"
99 perai
100 continue
103 if [ "$MB" = "" -a "$i" = "ja" -o "$i" = "kr" ]; then
104 echo
105 echo "A language you selected needs multi-byte character support"
106 echo "Do you want to enable it?"
107 echo -n "<y/n> [n] "
108 read MB
109 if [ "$MB" = "y" -o "$MB" = "Y" ]; then
110 OPTIONS="$OPTIONS --enable-kanji"
113 done
114 echo
115 echo "Where do you want to put the message files? [$NLSDIR]"
116 echo -n "? "
117 read foo
118 if test "x$foo" != "x"; then
119 NLSDIR=$foo
122 ##################### Installation path
124 done=0
125 while [ $done = 0 ]; do
126 echo
127 echo "Where do you want to install Window Maker? [$PREFIX]"
128 echo "Don't change it if you don't know what you're doing."
129 if test $USER != root; then
130 echo "Make sure to specify a path where you have write permission."
132 echo "(The default will put Window Maker in $PREFIX/bin, $PREFIX/lib etc.)"
133 echo -n "? "
134 read foo
135 if test "x$foo" != "x"; then
136 if [ "$foo" = "y" -o "$foo" = "n" ]; then
137 echo
138 echo "Hmm... I don't think you really want to install Window Maker into \"$foo\""
139 echo
140 else
141 done=1
142 PREFIX=$foo
144 else
145 done=1
147 echo
148 echo "$PREFIX/bin must be in the PATH environment variable of all users who use Window Maker"
149 perai
150 done
152 OPTIONS="$OPTIONS --prefix=$PREFIX"
156 ##################### Configure
157 echo "--------------------------"
158 echo "Configuring Window Maker..."
159 echo "--------------------------"
160 if [ `uname -s` = "SCO_SV" ]; then
161 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
163 CFLAGS="$CFLAGS -belf -DANSICPP"
165 perform ./configure $OPTIONS
166 else
167 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
169 CFLAGS="$CFLAGS $GCCFLAGS"
171 perform ./configure $OPTIONS
175 #################### Compile
176 echo "-------------------------"
177 echo "Compiling Window Maker..."
178 echo "-------------------------"
179 (cd src; perform make clean)
180 perform make
182 echo "--------------------------"
183 echo "Installing Window Maker..."
184 echo "--------------------------"
186 perform make install
188 echo
189 echo "Installation Finished!"
190 echo
191 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
192 echo "script that was just installed."
195 if test "$NLS" = "Y"; then
196 echo "Don't forget to set the LANG environment variable to your locale"