Updating to version 0.20.2
[wmaker-crm.git] / Install
blob9942ce4fdb461f0a7ed79a4505d8ffd20c36696c
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"
13 OPTIONS=""
14 PREFIX="/usr/local"
16 perai() {
17 echo "Type <Return> to continue"
18 read nada
22 perform() {
23 result=
24 eval $*
25 if [ "$result" != 0 ]; then
26 echo
27 echo "Window Maker installation failed or aborted by user."
28 exit 1
33 trap "echo Window Maker installation aborted. ; exit 1" 2 3
35 echo
36 echo "========================="
37 echo "Window Maker Installation"
38 echo "========================="
39 echo
40 echo "NOTE: If this script fails, read the INSTALL file and"
41 echo "install by hand."
42 echo
43 echo "Please read the INSTALL and FAQ files before e-mailing "
44 echo "questions."
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 ######################## Sound
62 echo
63 echo "Do you want sound support? Note that you need a module distributed"
64 echo "separately to make it work. You can get it at:"
65 echo "http://www.frontiernet.net/~southgat/wmsound"
66 echo -n "<y/n> [y] "
67 read SFX
69 if [ "x$SFX" = "x" -o "$SFX" = "y" -o "$SFX" = "Y" ]; then
70 OPTIONS="$OPTIONS --enable-sound"
73 ######################## NLS
74 echo
75 echo "Do you want National Language Support?"
76 echo -n "<y/n> [n] "
77 read NLS
79 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
80 NLS="Y"
81 echo "The supported locales are:"
82 ling=` (cd po; /bin/ls *.po) `
83 ALL_LINGUAS=""
84 for l in $ling; do
85 lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
86 lname=`echo $lname`
87 lcode=`basename $l .po`
88 ALL_LINGUAS="$ALL_LINGUAS $lcode"
89 echo "$lcode $lname"
90 done
91 echo "Type in the locales you want [$ALL_LINGUAS]"
92 read foo
93 if test "x$foo" = "x"; then
94 LINGUAS=$ALL_LINGUAS
95 else
96 LINGUAS="$foo"
98 echo "Selected locales are: $LINGUAS"
100 MB=""
101 for i in $LINGUAS; do
102 ok=0
103 for b in $ALL_LINGUAS; do
104 if test "$b" = "$i"; then
105 ok=1
106 break
108 done
109 if test "$ok" = "0"; then
110 echo
111 echo "$i is not a supported locale"
112 perai
113 continue
116 if [ "$MB" = "" -a "$i" = "ja" -o "$i" = "kr" ]; then
117 echo
118 echo "A language you selected needs multi-byte character support"
119 echo "Do you want to enable it?"
120 echo -n "<y/n> [n] "
121 read MB
122 if [ "$MB" = "y" -o "$MB" = "Y" ]; then
123 OPTIONS="$OPTIONS --enable-kanji"
126 done
127 echo
128 echo "Where do you want to put the message files? [$NLSDIR]"
129 echo -n "? "
130 read foo
131 if test "x$foo" != "x"; then
132 NLSDIR=$foo
135 ##################### Installation path
137 done=0
138 while [ $done = 0 ]; do
139 echo
140 echo "Where do you want to install Window Maker? [$PREFIX]"
141 echo "Don't change it if you don't know what you're doing."
142 if test $USER != root; then
143 echo "Make sure to specify a path where you have write permission."
145 echo "(The default will put Window Maker in $PREFIX/bin, $PREFIX/lib etc.)"
146 echo -n "? "
147 read foo
148 if test "x$foo" != "x"; then
149 if [ "$foo" = "y" -o "$foo" = "n" ]; then
150 echo
151 echo "Hmm... I don't think you really want to install Window Maker into \"$foo\""
152 echo
153 else
154 done=1
155 PREFIX=$foo
157 else
158 done=1
160 echo
161 echo "$PREFIX/bin must be in the PATH environment variable of all users who use Window Maker"
162 perai
163 done
165 OPTIONS="$OPTIONS --prefix=$PREFIX"
169 ##################### Configure
170 echo "--------------------------"
171 echo "Configuring Window Maker..."
172 echo "--------------------------"
173 if [ `uname -s` = "SCO_SV" ]; then
174 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
176 perform CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS
177 else
178 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
180 perform CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS
184 #################### Compile
185 echo "-------------------------"
186 echo "Compiling Window Maker..."
187 echo "-------------------------"
188 perform (cd src; make clean)
189 perform make
191 echo "--------------------------"
192 echo "Installing Window Maker..."
193 echo "--------------------------"
195 perform make install
197 echo
198 echo "Installation Finished!"
199 echo
200 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
201 echo "script that was just installed."
204 if test "$NLS" = "Y"; then
205 echo "Don't forget to set the LANG environment variable to your locale"