Release 950901
[wine/multimedia.git] / Configure
blob7e7f4a0a592666cf167918aa13857f9818c68474
1 #! /bin/sh
3 # Configure script for wine
5 : ${EDITOR:=vi}
6 : ${PAGER:=more}
8 WINELIB=''
9 LANGUAGE=not_matching
10 ALLDEFINES=''
12 # Ask question 'str' and set 'var' to reply (defaulting to 'def' on CR)
13 prompt ()
15 str="$1"
16 var="$2"
17 def="$3"
19 eval $var='$def'
20 echo
21 echo -n "$str [$def]? "
22 input=`head -1` # When using read, user must double all backslashes
23 if [ -n "$input" ]
24 then
25 eval $var='$input'
29 echo
30 echo Read the RELEASE-NOTES for an explanation of the various flags
31 echo
33 echo -n 'Build Wine as emulator or library (E/L) [E]? '
34 read input
35 if [ "$input" = 'l' -o "$input" = 'L' ]
36 then
37 WINELIB='#define WINELIB -DWINELIB'
38 ALLDEFINES="$ALLDEFINES -DWINELIB"
41 LANGS=`echo En rc/sysres_*.rc | sed -e 's/rc\/sysres_//g' -e 's/\.rc//g' -e 's/ /\//g;'`
42 while expr "$LANGS" : ".*$LANGUAGE" = 0 > /dev/null
44 prompt "Language ($LANGS)" LANGUAGE En
45 if expr "$LANGS" : ".*$LANGUAGE" = 0 > /dev/null
46 then
47 echo "\"$LANGUAGE\" is not a supported language."
49 done
50 ALLDEFINES="$ALLDEFINES -ALANG\($LANGUAGE\)"
52 prompt "Inter-process communication" CONFIG_IPC N
53 if [ CONFIG_IPC = 'Y' -o $CONFIG_IPC = 'y' ]
54 then
55 ALLDEFINES="$ALLDEFINES -DCONFIG_IPC"
58 prompt "Malloc debugging" MALLOC_DEBUGGING N
59 if [ MALLOC_DEBUGGING = 'Y' -o $MALLOC_DEBUGGING = 'y' ]
60 then
61 MALLOC_DEBUGGING="#define MALLOC_DEBUGGING"
62 ALLDEFINES="$ALLDEFINES -DMALLOC_DEBUGGING"
63 else
64 MALLOC_DEBUGGING=''
67 prompt "Global configfile name" WINE_CONFIGFILE /usr/local/etc/wine.conf
69 if [ -r $WINE_CONFIGFILE ]
70 then
71 DEFAULT_ANS=N
72 else
73 DEFAULT_ANS=Y
76 echo
77 echo -n "Do you want to make a config file now (Y/N) [$DEFAULT_ANS]? "
78 read input
79 if [ "$input" = '' ]
80 then
81 input="$DEFAULT_ANS"
83 if [ "$input" = 'y' -o "$input" = 'Y' ]
84 then
85 if [ -r $WINE_CONFIGFILE ]
86 then
87 echo "Backing up the old file to ${WINE_CONFIGFILE}.old."
88 if cp $WINE_CONFIGFILE ${WINE_CONFIGFILE}.old
89 then :
90 else
91 echo "Error while creating backup file. Fix it and run Configure again"
92 exit 1
96 CF_A=`mount | awk '/^\/dev\/fd/ {print $3;exit} END {print "/a"}'`
97 prompt "Which directory do you want to use as A:" CF_A $CF_A
98 CF_C=`awk '{if ($3=="msdos") {print $2;exit}} END {print "/c"}' /etc/fstab`
99 prompt "Which directory do you want to use as C:" CF_C $CF_C
100 prompt "Where is the Windows directory" CF_Windows 'c:\windows'
101 prompt "Where is the System directory" CF_System 'c:\windows\system'
102 if [ -r "$CF_C/autoexec.bat" ]
103 then
104 CF_Temp=`tr A-Z a-z < "$CF_C/autoexec.batX" | sed -n 's/^ *set *temp= *\(c:.*[a-z]\).*/\1/p'`
106 if [ -z "$CF_Temp" ]
107 then
108 CF_Temp='c:\temp'
110 prompt "Where should Windows apps store temp files" CF_Temp $CF_Temp
111 prompt "Which path should be used to find progs/DLL's" CF_Path "$CF_Windows;$CF_System"
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'
116 echo
117 sed -n -e 's/^ *\"\(WM_[A-Z0-9]*\)\".*/\1/p' < misc/spy.c | \
118 sort | pr -ta4w83 | sed '1 i\
119 Here is the list of messages:\
121 ' | $PAGER
123 prompt "Exclude which messages from the log" CF_Exclude 'WM_SIZE;WM_TIMER'
125 cat > $WINE_CONFIGFILE << EOF
126 [drives]
127 A=$CF_A
128 C=$CF_C
130 [wine]
131 Windows=$CF_Windows
132 System=$CF_System
133 Temp=$CF_Temp
134 Path=$CF_Path
135 SystemResources=$CF_SystemResources
137 [fonts]
138 system=*-helvetica
139 mssansserif=*-helvetica
140 msserif=*-times
141 fixedsys=*-fixed
142 arial=*-helvetica
143 helv=*-helvetica
144 roman=*-times
145 default=*-*
147 [serialports]
148 Com1=$CF_Com1
149 Com2=$CF_Com2
151 [parallelports]
152 Lpt1=$CF_Lpt1
154 [spy]
155 Exclude=$CF_Exclude
158 echo
159 sed '1 i\
160 The config file '"$WINE_CONFIGFILE"' now looks like this:\
162 ' < $WINE_CONFIGFILE | $PAGER
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 cat > autoconf.h << EOF
179 /* autoconf.h generated automatically. Run Configure. */
180 $WINELIB
181 $MALLOC_DEBUGGING
182 #define WINE_INI_GLOBAL "$WINE_CONFIGFILE"
183 #define AutoDefines $ALLDEFINES
186 echo
187 echo "Creating Makefiles. This may take a while."
188 if xmkmf -a
189 then :
190 else cat << EOF
192 WARNING: The exit status of the command 'xmkmf -a' indicates an error.
193 Maybe the Wine directory is incomplete, or Imake (see 'man xmkmf imake')
194 is incorrectly configured? In the latter case, it might be easiest to
195 reinstall X11 to get a new copy of Imake.
199 if [ 0 -lt `find . -name "*.rej" -print | wc -l` ]
200 then
201 cat << EOF
203 WARNING: You have some files named '*.rej', which usually indicates
204 rejected patch files. Maybe you tried to upgrade Wine with 'patch',
205 and that some of the patches failed? If something doesn't work, this
206 might be the reason. See 'man patch' (especially the '-p' option).
208 List of "*.rej" files:
211 find . -name "*.rej" -print
214 if [ -f ./Makefile ]
215 then
216 echo
217 echo "Configure finished. Do 'make' to compile Wine."
218 else
219 echo
220 echo "*** There was a problem with 'imake': the main Makefile has not be created."