This update includes the 0.20.3pre3 code
[wmaker-crm.git] / Install
blob92b57343d965cf9fb9863a1454520385e527300d
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 "================"
61 ######################## NLS
62 echo
63 echo "Do you want National Language Support?"
64 echo -n "<y/n> [n] "
65 read NLS
67 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
68 NLS="Y"
69 echo "The supported locales are:"
70 ling=` (cd po; /bin/ls *.po) `
71 ALL_LINGUAS=""
72 for l in $ling; do
73 lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
74 lname=`echo $lname`
75 lcode=`basename $l .po`
76 ALL_LINGUAS="$ALL_LINGUAS $lcode"
77 echo "$lcode $lname"
78 done
79 echo "Type in the locales you want (all will install everything) [none]"
80 read foo
81 if test "$foo" = "all"; then
82 LINGUAS="$ALL_LINGUAS"
83 else
84 LINGUAS="$foo"
86 echo "Selected locales are: $LINGUAS"
88 MB=""
89 for i in $LINGUAS; do
90 ok=0
91 for b in $ALL_LINGUAS; do
92 if test "$b" = "$i"; then
93 ok=1
94 break
96 done
97 if test "$ok" = "0"; then
98 echo
99 echo "$i is not a supported locale"
100 perai
101 continue
104 if [ "$MB" = "" -a "$i" = "ja" -o "$i" = "kr" ]; then
105 echo
106 echo "A language you selected needs multi-byte character support"
107 echo "Do you want to enable it?"
108 echo -n "<y/n> [n] "
109 read MB
110 if [ "$MB" = "y" -o "$MB" = "Y" ]; then
111 OPTIONS="$OPTIONS --enable-kanji"
114 done
115 echo
116 echo "Where do you want to put the message files? [$NLSDIR]"
117 echo -n "? "
118 read foo
119 if test "x$foo" != "x"; then
120 NLSDIR=$foo
123 ##################### Installation path
125 done=0
126 while [ $done = 0 ]; do
127 echo
128 echo "Where do you want to install Window Maker? [$PREFIX]"
129 echo "Don't change it if you don't know what you're doing."
130 if test $USER != root; then
131 echo "Make sure to specify a path where you have write permission."
133 echo "(The default will put Window Maker in $PREFIX/bin, $PREFIX/lib etc.)"
134 echo -n "? "
135 read foo
136 if test "x$foo" != "x"; then
137 if [ "$foo" = "y" -o "$foo" = "n" ]; then
138 echo
139 echo "Hmm... I don't think you really want to install Window Maker into \"$foo\""
140 echo
141 else
142 done=1
143 PREFIX=$foo
145 else
146 done=1
148 echo
149 echo "$PREFIX/bin must be in the PATH environment variable of all users who use Window Maker"
150 perai
151 done
153 OPTIONS="$OPTIONS --prefix=$PREFIX"
157 ##################### Configure
158 echo "--------------------------"
159 echo "Configuring Window Maker..."
160 echo "--------------------------"
161 if [ `uname -s` = "SCO_SV" ]; then
162 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
164 CFLAGS="$CFLAGS -belf -DANSICPP"
166 perform ./configure $OPTIONS
167 else
168 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
170 CFLAGS="$CFLAGS $GCCFLAGS"
172 perform ./configure $OPTIONS
176 #################### Compile
177 echo "-------------------------"
178 echo "Compiling Window Maker..."
179 echo "-------------------------"
180 (cd src; perform make clean)
181 perform make
183 echo "--------------------------"
184 echo "Installing Window Maker..."
185 echo "--------------------------"
187 perform make install
189 echo
190 echo "Installation Finished!"
191 echo
192 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
193 echo "script that was just installed."
196 if test "$NLS" = "Y"; then
197 echo "Don't forget to set the LANG environment variable to your locale"