Initial revision
[wmaker-crm.git] / Install
blob4ef270a6aced06f6b1a4036decd356abcc1521a6
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 echo
23 echo "========================"
24 echo "WindowMaker Installation"
25 echo "========================"
26 echo
27 echo "NOTE: If the installation procedure fails, read the INSTALL file and do"
28 echo "the installation manually."
29 perai
31 if test "$USER" != "root"; then
32 echo "Warning: you must run this script as the root user."
33 perai
34 echo
35 echo "Be sure to specify an installation path where you have"
36 echo "write persmission."
37 echo
41 echo
42 echo "Option Selection"
43 echo "================"
45 ######################## Sound
47 echo
48 echo "Do you want sound support? Note that you need a module distributed"
49 echo "separately to make it work. You can get it at:"
50 echo "http://www.frontiernet.net/~southgat/wmsound"
51 echo -n "<y/n> [y] "
52 read SFX
54 if [ "x$SFX" = "x" -o "$SFX" = "y" -o "$SFX" = "Y" ]; then
55 OPTIONS="$OPTIONS --enable-sound"
58 ######################## NLS
59 echo
60 echo "Do you want National Language Support?"
61 echo -n "<y/n> [n] "
62 read NLS
64 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
65 NLS="Y"
66 echo "The supported locales are:"
67 ling=` (cd po; /bin/ls *.po) `
68 ALL_LINGUAS=""
69 for l in $ling; do
70 lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
71 lname=`echo $lname`
72 lcode=`basename $l .po`
73 ALL_LINGUAS="$ALL_LINGUAS $lcode"
74 echo "$lcode $lname"
75 done
76 echo "Type in the locales you want [$ALL_LINGUAS]"
77 read foo
78 if test "x$foo" = "x"; then
79 LINGUAS=$ALL_LINGUAS
80 else
81 LINGUAS="$foo"
83 echo "Selected locales are: $LINGUAS"
85 MB=""
86 for i in $LINGUAS; do
87 ok=0
88 for b in $ALL_LINGUAS; do
89 if test "$b" = "$i"; then
90 ok=1
91 break
93 done
94 if test "$ok" = "0"; then
95 echo
96 echo "$i is not a supported locale"
97 perai
98 continue
101 if [ "$MB" = "" -a "$i" = "ja" -o "$i" = "kr" ]; then
102 echo
103 echo "A language you selected needs multi-byte character support"
104 echo "Do you want to enable it?"
105 echo -n "<y/n> [n] "
106 read MB
107 if [ "$MB" = "y" -o "$MB" = "Y" ]; then
108 OPTIONS="$OPTIONS --enable-kanji"
111 done
112 echo
113 echo "Where do you want to put the message files? [$NLSDIR]"
114 echo -n "? "
115 read foo
116 if test "x$foo" != "x"; then
117 NLSDIR=$foo
120 ##################### Installation path
122 done=0
123 while [ $done = 0 ]; do
124 echo
125 echo "Where do you want to install WindowMaker? [$PREFIX]"
126 echo "Don't change it if you don't know what you're doing."
127 echo "(The default path will install WindowMaker in "
128 echo "$PREFIX/bin, $PREFIX/lib etc.)"
129 echo -n "? "
130 read foo
132 if test "x$foo" != "x"; then
133 if [ "$foo" = "y" -o "$foo" = "n" ]; then
134 echo
135 echo "Hmm... I don't think you really want to install WindowMaker into \"$foo\""
136 echo
137 else
138 done=1
139 PREFIX=$foo
141 else
142 done=1
144 echo
145 echo "$PREFIX/bin must be in the PATH environment variable of all users who use WindowMaker"
146 perai
147 done
149 OPTIONS="$OPTIONS --prefix=$PREFIX"
152 ###################### Build libPropList
154 if [ ! -d libPropList ]; then
155 gzip -d -c libPropList.tar.gz | tar xf -
158 echo "-----------------------"
159 echo "Building libPropList..."
160 echo "-----------------------"
161 cd libPropList
162 if [ ! -f config.status ]; then
163 ./configure
165 make
166 cd ..
168 if [ ! -f libPropList/libPropList.a ]; then
169 echo "Build of libPropList was not successfull. "
170 exit
174 ##################### Configure
175 echo "--------------------------"
176 echo "Configuring WindowMaker..."
177 echo "--------------------------"
178 if [ `uname -s` = "SCO_SV" ]; then
179 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
180 CFLAGS="$CFLAGS -belf -DANSICPP" ./configure $OPTIONS
181 else
182 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
183 CFLAGS="$CFLAGS $GCCFLAGS" ./configure $OPTIONS
187 #################### Compile
188 echo "------------------------"
189 echo "Compiling WindowMaker..."
190 echo "------------------------"
191 (cd src; make clean)
192 make
194 echo "-------------------------"
195 echo "Installing WindowMaker..."
196 echo "-------------------------"
198 make install
200 echo
201 echo "Installation Finished!"
202 echo
203 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
204 echo "script that was just installed."
207 if test "$NLS" = "Y"; then
208 echo "Don't forget to set the LANG environment variable to your locale"