Release 941030
[wine/multimedia.git] / Configure
blob9dc4e9ec5049351e525fc2ba75f86d2e5d48431a
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 # echo
45 # echo -n 'bochs directory [/usr/src/bochs]? '
46 # read input
47 # if [ "$input" = '' ]
48 # then
49 # ALLDEFINES="$ALLDEFINES -DPROC_EMU_DIR=/usr/src/bochs"
50 # else
51 # ALLDEFINES="$ALLDEFINES -DPROC_EMU_DIR="$input
52 # fi
53 # fi
57 echo
58 echo -n 'Short filenames (Y/N) [N]? '
59 read input
60 if [ "$input" = 'y' -o "$input" = 'Y' ]
61 then
62 SHORTNAMES='#define ShortNames -DSHORTNAMES'
63 ALLDEFINES="$ALLDEFINES -DSHORTNAMES"
64 else
65 SHORTNAMES=''
68 prompt "Global configfile name" WINE_CONFIGFILE /usr/local/etc/wine.conf
70 WINE_INI_GLOBAL='#define WINE_INI_GLOBAL "'$WINE_CONFIGFILE'"'
72 if [ -r $WINE_CONFIGFILE ]
73 then
74 DEFAULT_ANS=N
75 else
76 DEFAULT_ANS=Y
79 echo
80 echo -n "Do you want to make a config file now (Y/N) [$DEFAULT_ANS]? "
81 read input
82 if [ "$input" = '' ]
83 then
84 input="$DEFAULT_ANS"
86 if [ "$input" = 'y' -o "$input" = 'Y' ]
87 then
88 if [ -r $WINE_CONFIGFILE ]
89 then
90 echo "Backing up the old file to ${WINE_CONFIGFILE}.old."
91 if cp $WINE_CONFIGFILE ${WINE_CONFIGFILE}.old
92 then :
93 else
94 echo "Error while creating backup file. Fix it and run Configure again"
95 exit 1
99 case `awk 'BEGIN {s=0} {if ($3=="msdos") s++} END {print s}' /etc/fstab` in
100 0) CF_C=/c;;
101 1) CF_C=`awk '{if ($3=="msdos") print $2}' /etc/fstab`;;
102 *) CF_C=`awk '{if ($3=="msdos") {print $2;exit}}' /etc/fstab`;;
103 esac
105 prompt "Which directory do you want to use as A:" CF_A /a
106 prompt "Which directory do you want to use as C:" CF_C $CF_C
107 prompt "Where is the Windows directory" CF_Windows 'c:\windows'
108 prompt "Where is the System directory" CF_System 'c:\windows\system'
109 prompt "Where should Windows apps store temp files" CF_Temp 'c:\temp'
110 prompt "Which path should be used to find executables and DLL's" CF_Path 'c:\windows;c:\windows\system'
111 prompt "Where is sysres.dll" CF_SystemResources `pwd`/sysres.dll
112 prompt "Where is COM1" CF_Com1 '/dev/cua0'
113 prompt "Where is COM2" CF_Com2 '/dev/cua1'
114 prompt "Where is LPT1" CF_Lpt1 '/dev/lp0'
115 prompt "Log messages to which file (CON = stdout)" CF_File 'CON'
117 echo
118 sed -n -e 's/^ *\"\(WM_[A-Z0-9]*\)\".*/\1/p' < misc/spy.c | \
119 sort | pr -ta4w83 | sed '1 i\
120 Here is the list of messages:\
122 ' | $PAGER
124 prompt "Exclude which messages from the log" CF_Exclude 'WM_SIZE;WM_TIMER'
126 echo
127 echo "The config file $WINE_CONFIGFILE now looks like this:"
128 tee $WINE_CONFIGFILE << EOF
129 [drives]
130 A=$CF_A
131 C=$CF_C
133 [wine]
134 Windows=$CF_Windows
135 System=$CF_System
136 Temp=$CF_Temp
137 Path=$CF_Path
138 SystemResources=$CF_SystemResources
140 [serialports]
141 Com1=$CF_Com1
142 Com2=$CF_Com2
144 [parallelports]
145 Lpt1=$CF_Lpt1
147 [spy]
148 File=$CF_File
149 Exclude=$CF_Exclude
152 echo
153 echo -n "Do you want to edit it using $EDITOR (Y/N) [N]? "
154 read input
155 if [ "$input" = 'y' -o "$input" = 'Y' ]
156 then
157 $EDITOR $WINE_CONFIGFILE
159 else
160 if [ ! -r $WINE_CONFIGFILE ]
161 then
162 echo 'Ok, remember to make it yourself later.'
166 NEWBUILD=''
167 if [ "`(domainname)`" = 'amscons.com' ]
168 then
169 echo
170 echo -n 'New build program (Y/N) [N]? '
171 read input
172 if [ "$input" = 'y' -o "$input" = 'Y' ]
173 then
174 NEWBUILD='#define NewBuild -DNEWBUILD'
175 ALLDEFINES="$ALLDEFINES -DNEWBUILD"
179 NEWLINUXLDT=''
180 if grep -s seg_not_present /usr/include/linux/ldt.h 2> /dev/null
181 then
182 NEWLINUXLDT='#define NEW_LDT_STRUCT'
185 cat > autoconf.h << EOF
186 /* autoconf.h generated automatically. Run Configure. */
187 $WINELIB
188 $SHORTNAMES
189 $NEWBUILD
190 $WINE_INI_GLOBAL
191 $NEWLINUXLDT
192 $ENDIAN
193 $PROCEMUDIR
194 #define AutoDefines $ALLDEFINES
197 xmkmf -a
199 if [ 0 -lt `find . -name "*.rej" -print | wc -l` ]
200 then
201 cat << EOF
203 WARNING: You have some files named "*.rej". Rejected patch files?
204 Maybe you tried to upgrade Wine by diff-files, and that patch failed.
205 If something doesn't work, this might be the reason. See "man patch".
207 List of "*.rej" files:
210 find . -name "*.rej" -print
211 echo