wined3d: Pass the correct mask to shader_glsl_add_src_param() in shader_glsl_rep().
[wine/multimedia.git] / tools / wineinstall
blob5c57f5450f02b5a3a0a4b271ba96cc23c8497dc2
1 #!/bin/bash
2 # WINE Installation script
3 # Can do almost everything from compiling to configuring...
5 # Copyright 1999 Ove Kåven
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #--- defaults (change these if you are a packager)
23 CONFARGS="" # configure args, e.g. --prefix=/usr
24 prefix=/usr/local # installation prefix
25 bindir=$prefix/bin # where winelib apps will be (or are) installed
26 libdir=$prefix/lib # where libwine.so will be (or is) installed
27 BINDIST=no # whether called from a binary package config script
29 # functions
31 function std_sleep {
32 sleep 1
35 function conf_question {
36 # parameters: $1 = importance, $2 = question-id, $3+ = message lines
37 # the first two parameters can be used by e.g. debconf in debian packages
38 # but here we just print the message
39 shift 2
40 echo
41 local LINE="$1"
42 while [ $# -gt 0 ] && shift
43 do {
44 echo "$LINE"
45 LINE="$1"
47 done
50 function conf_reset_question {
51 # parameters: $1 = question-id
52 # this is used to flush any cached answers and "already-displayed" flags
53 shift # dummy command
56 function conf_yesno_answer {
57 unset ANSWER
58 while [ "$ANSWER" != 'yes' ] && [ "$ANSWER" != 'no' ]
59 do {
60 echo -n "$1"
61 read ANSWER
63 done
66 function conf_string_answer {
67 echo -n "$1"
68 read ANSWER
71 # startup...
73 echo "WINE Installer v0.75"
74 echo
76 if [ "$BINDIST" = 'no' ]
77 then {
79 if ! [ -f configure ]
80 then {
81 if [ -f ../configure ]
82 then {
83 pushd ..
85 else {
86 echo "You're running this from the wrong directory."
87 echo "Change to the Wine source's main directory and try again."
88 exit 1
94 if [ `whoami` = 'root' ]
95 then {
96 echo "You are running wineinstall as root, this is not advisable. Please rerun as a user."
97 echo "Aborting."
98 exit 1
102 if [ ! -w . ]
103 then {
104 echo "The source directory is not writable. You probably extracted the sources as root."
105 echo "You should remove the source tree and extract it again as a normal user."
106 exit 1
110 # check whether RPM installed, and if it is, remove any old wine rpm.
111 hash rpm &>/dev/null
112 RET=$?
113 if [ $RET -eq 0 ]; then
114 if [ -n "`rpm -qi wine 2>/dev/null|grep "^Name"`" ]; then
115 echo "Warning: Old Wine RPM install detected. Do you want to remove it first?"
116 conf_yesno_answer "(yes/no) "
117 if [ "$ANSWER" = 'yes' ]; then
118 echo "We need to remove the rpm as root, please enter your root password"
119 echo
120 echo Starting wine rpm removal...
121 su -c "rpm -e wine; RET=$?"
122 if [ $RET -eq 0 ]; then
123 echo Done.
124 else
125 echo "FAILED. Probably you aren't installing as root."
126 echo "Expect problems (library conflicts with existing install etc.)."
128 else
129 echo "Sorry, I won't install Wine when an rpm version is still installed."
130 echo "(Wine support suffered from way too many conflicts between RPM"
131 echo "and source installs)"
132 echo "Have a nice day !"
133 exit 1
138 # check whether wine binary still available
139 if [ -n "`which wine 2>/dev/null|grep '/wine'`" ]; then
140 echo "Warning !! wine binary (still) found, which may indicate"
141 echo "a (conflicting) previous installation."
142 echo "You might want to abort and uninstall Wine first."
143 echo "(If you previously tried to install from source manually, "
144 echo "run 'make uninstall' from the wine root directory)"
145 std_sleep
148 # run the configure script, if necessary
150 if [ -f config.cache ] && [ -f Makefile ] && [ Makefile -nt configure ]
151 then {
152 echo
153 echo "I see that WINE has already been configured, so I'll skip that."
154 std_sleep
155 # load configure results
156 . ./config.cache
158 else {
159 echo "Running configure..."
160 echo
161 if ! ./configure -C $CONFARGS --prefix=$prefix
162 then {
163 echo
164 echo "Configure failed, aborting install."
165 rm -f config.cache
166 exit 1
169 # load configure results
170 . ./config.cache
171 # make sure X was found
172 eval "$ac_cv_have_x"
173 if [ "$have_x" != "yes" ]
174 then {
175 echo "Install the X development headers and try again."
176 rm -f config.cache
177 exit 1
183 # now do the compilation and install, we need to always do this because we
184 # don't want the 'make install' command we might run to run 'make' as root
185 if [ `whoami` != 'root' ]
186 then {
187 # ask the user if they want to build and install wine
188 echo
189 echo "We need to install wine as root user, do you want us to build wine,"
190 echo "'su root' and install Wine? Enter 'no' to continue without installing"
191 conf_yesno_answer "(yes/no) "
192 ROOTINSTALL="$ANSWER"
194 if [ "$ROOTINSTALL" = "yes" ]
195 then {
196 # start out with the basic command
197 sucommand="make install"
199 # if the user doesn't have $libdir in their ld.so.conf add this
200 # to our sucommand string
201 if [ -f /etc/ld.so.conf ]
202 then
203 if ! grep -s "$libdir" /etc/ld.so.conf >/dev/null 2>&1
204 then {
205 echo
206 echo "$libdir doesn't exist in your /etc/ld.so.conf, it will be added"
207 echo "when we perform the install..."
208 sucommand="$sucommand;echo $libdir>>/etc/ld.so.conf"
211 # run ldconfig always just in case some updated files don't get linked
212 sucommand="$sucommand;$ac_cv_path_LDCONFIG"
215 fi # [ "$ROOTINSTALL" = "yes" ]
217 echo
219 echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever,"
220 echo "in the meantime..."
221 echo
222 std_sleep
224 # try to just make wine, if this fails 'make depend' and try to remake
225 if ! { make; }
226 then {
227 if ! { make depend && make; }
228 then {
229 echo
230 echo "Compilation failed, aborting install."
231 exit 1
237 if [ "$ROOTINSTALL" = "yes" ]
238 then {
239 echo
241 echo "Performing 'make install' as root to install binaries, enter root password"
243 std_sleep
245 if ! su root -c "$sucommand"
246 then {
247 echo
248 echo "Incorrect root password. If you are running Ubuntu or a similar distribution,"
249 echo "'make install' needs to be run via the sudo wrapper, so trying that one now"
250 if ! sudo su root -c "$sucommand"
251 then {
252 echo
253 echo "Either you entered an incorrect password or we failed to"
254 echo "run '$sucommand' correctly."
255 echo "If you didn't enter an incorrect password then please"
256 echo "report this error and any steps to possibly reproduce it to"
257 echo "http://bugs.winehq.org/"
258 echo
259 echo "Installation failed, aborting."
260 exit 1
266 echo
268 # see if wine is installed on the users system, if not prompt them
269 # and then exit
270 if [ ! `which wine` ]
271 then
272 echo "Could not find wine on your system. Run wineinstall as root to install wine"
273 echo "before re-running wineinstall as a user."
274 echo
275 echo "Exiting wineinstall"
276 exit 1;
279 WINEINSTALLED=yes
281 else {
282 WINEINSTALLED=no
284 fi # [ "$ROOTINSTALL" = "yes" ]
286 fi # [ `whoami` != 'root' ]
289 fi # BINDIST
291 if [ "$WINEINSTALLED" = 'no' ]
292 then
293 tools/wineprefixcreate --use-wine-tree .
294 else
295 wineprefixcreate
297 echo
300 # it's a wrap
301 echo
302 echo "Installation complete for now. Good luck (this is still beta software)."
303 echo "If you have problems with WINE, please read the documentation first,"
304 echo "as many kinds of potential problems are explained there."
306 exit 0