Release 941107
[wine/multimedia.git] / Configure
blobda4a11a3224740cfc09005caa54ebd232df6ae23
1 #! /bin/sh
3 # Configure script for wine
5 : ${EDITOR:=vi}
6 : ${PAGER:=more}
8 ALLDEFINES=''
10 # Ask question 'str' and sets 'var' reply (defaulting to 'def' on CR)
11 prompt ()
13 str="$1"
14 var="$2"
15 def="$3"
17 eval $var='$def'
18 echo
19 echo -n "$str [$def]? "
20 input=`head -1` # When using read, user must double all backslashes
21 if [ -n "$input" ]
22 then
23 eval $var='$input'
27 echo -n 'Build Wine as emulator or library (E/L) [E]? '
28 read input
29 if [ "$input" = 'l' -o "$input" = 'L' ]
30 then
31 WINELIB='#define WINELIB -DWINELIB'
32 ALLDEFINES="$ALLDEFINES -DWINELIB"
33 else
34 WINELIB=''
36 # Commented out until the processor emulator starts to work.
38 # echo
39 # echo -n 'Use processor emulator (*DOES*NOT*WORK*YET*) (Y/N) [N]? '
40 # read input
41 # if [ "$input" = 'y' -o "$input" = 'Y' ]
42 # then
43 # PROCEMU='#define PROCEMU'
44 # ALLDEFINES="$ALLDEFINES -DPROCEMU"
45 # echo
46 # echo -n 'bochs directory [/usr/src/bochs]? '
47 # read input
48 # if [ "$input" = '' ]
49 # then
50 # ALLDEFINES="$ALLDEFINES -DPROC_EMU_DIR=/usr/src/bochs"
51 # else
52 # ALLDEFINES="$ALLDEFINES -DPROC_EMU_DIR="$input
53 # fi
54 # fi
58 echo
59 echo -n 'Short filenames (Y/N) [N]? '
60 read input
61 if [ "$input" = 'y' -o "$input" = 'Y' ]
62 then
63 SHORTNAMES='#define ShortNames -DSHORTNAMES'
64 ALLDEFINES="$ALLDEFINES -DSHORTNAMES"
65 else
66 SHORTNAMES=''
69 echo
70 echo -n 'Use the XPM library (Y/N) [N]? '
71 read input
72 if [ "$input" = 'y' -o "$input" = 'Y' ]
73 then
74 XPM='#define USE_XPM'
75 ALLDEFINES="$ALLDEFINES -DUSE_XPM"
76 else
77 XPM=''
80 prompt "Global configfile name" WINE_CONFIGFILE /usr/local/etc/wine.conf
82 WINE_INI_GLOBAL='#define WINE_INI_GLOBAL "'$WINE_CONFIGFILE'"'
84 if [ -r $WINE_CONFIGFILE ]
85 then
86 DEFAULT_ANS=N
87 else
88 DEFAULT_ANS=Y
91 echo
92 echo -n "Do you want to make a config file now (Y/N) [$DEFAULT_ANS]? "
93 read input
94 if [ "$input" = '' ]
95 then
96 input="$DEFAULT_ANS"
98 if [ "$input" = 'y' -o "$input" = 'Y' ]
99 then
100 if [ -r $WINE_CONFIGFILE ]
101 then
102 echo "Backing up the old file to ${WINE_CONFIGFILE}.old."
103 if cp $WINE_CONFIGFILE ${WINE_CONFIGFILE}.old
104 then :
105 else
106 echo "Error while creating backup file. Fix it and run Configure again"
107 exit 1
111 case `awk 'BEGIN {s=0} {if ($3=="msdos") s++} END {print s}' /etc/fstab` in
112 0) CF_C=/c;;
113 1) CF_C=`awk '{if ($3=="msdos") print $2}' /etc/fstab`;;
114 *) CF_C=`awk '{if ($3=="msdos") {print $2;exit}}' /etc/fstab`;;
115 esac
117 prompt "Which directory do you want to use as A:" CF_A /a
118 prompt "Which directory do you want to use as C:" CF_C $CF_C
119 prompt "Where is the Windows directory" CF_Windows 'c:\windows'
120 prompt "Where is the System directory" CF_System 'c:\windows\system'
121 prompt "Where should Windows apps store temp files" CF_Temp 'c:\temp'
122 prompt "Which path should be used to find executables and DLL's" CF_Path 'c:\windows;c:\windows\system'
123 prompt "Where is sysres.dll" CF_SystemResources `pwd`/sysres.dll
124 prompt "Where is COM1" CF_Com1 '/dev/cua0'
125 prompt "Where is COM2" CF_Com2 '/dev/cua1'
126 prompt "Where is LPT1" CF_Lpt1 '/dev/lp0'
127 prompt "Log messages to which file (CON = stdout)" CF_File 'CON'
129 echo
130 sed -n -e 's/^ *\"\(WM_[A-Z0-9]*\)\".*/\1/p' < misc/spy.c | \
131 sort | pr -ta4w83 | sed '1 i\
132 Here is the list of messages:\
134 ' | $PAGER
136 prompt "Exclude which messages from the log" CF_Exclude 'WM_SIZE;WM_TIMER'
138 echo
139 echo "The config file $WINE_CONFIGFILE now looks like this:"
140 tee $WINE_CONFIGFILE << EOF
141 [drives]
142 A=$CF_A
143 C=$CF_C
145 [wine]
146 Windows=$CF_Windows
147 System=$CF_System
148 Temp=$CF_Temp
149 Path=$CF_Path
150 SystemResources=$CF_SystemResources
152 [serialports]
153 Com1=$CF_Com1
154 Com2=$CF_Com2
156 [parallelports]
157 Lpt1=$CF_Lpt1
159 [spy]
160 File=$CF_File
161 Exclude=$CF_Exclude
164 echo
165 echo -n "Do you want to edit it using $EDITOR (Y/N) [N]? "
166 read input
167 if [ "$input" = 'y' -o "$input" = 'Y' ]
168 then
169 $EDITOR $WINE_CONFIGFILE
171 else
172 if [ ! -r $WINE_CONFIGFILE ]
173 then
174 echo 'Ok, remember to make it yourself later.'
178 NEWBUILD=''
179 if [ "`(domainname)`" = 'amscons.com' ]
180 then
181 echo
182 echo -n 'New build program (Y/N) [N]? '
183 read input
184 if [ "$input" = 'y' -o "$input" = 'Y' ]
185 then
186 NEWBUILD='#define NewBuild -DNEWBUILD'
187 ALLDEFINES="$ALLDEFINES -DNEWBUILD"
191 NEWLINUXLDT=''
192 if grep -s seg_not_present /usr/include/linux/ldt.h 2> /dev/null
193 then
194 ALLDEFINES="$ALLDEFINES -DNEW_LDT_STRUCT"
197 cat > autoconf.h << EOF
198 /* autoconf.h generated automatically. Run Configure. */
199 $WINELIB
200 $SHORTNAMES
201 $XPM
202 $NEWBUILD
203 $WINE_INI_GLOBAL
204 $ENDIAN
205 $PROCEMUDIR
206 #define AutoDefines $ALLDEFINES
209 xmkmf -a
211 if [ 0 -lt `find . -name "*.rej" -print | wc -l` ]
212 then
213 cat << EOF
215 WARNING: You have some files named "*.rej". Rejected patch files?
216 Maybe you tried to upgrade Wine by diff-files, and that patch failed.
217 If something doesn't work, this might be the reason. See "man patch".
219 List of "*.rej" files:
222 find . -name "*.rej" -print
223 echo