3 # Configure script for wine
14 # Ask question 'str' and set 'var' to reply (defaulting to 'def' on CR)
23 echo -n "$str [$def]? "
24 input
=`head -1` # When using read, user must double all backslashes
31 echo Read the RELEASE-NOTES
for an explanation of the various flags
34 echo -n 'Build Wine as emulator or library (E/L) [E]? '
36 if [ "$input" = 'l' -o "$input" = 'L' ]
38 WINELIB
='#define WINELIB -DWINELIB'
39 ALLDEFINES
="$ALLDEFINES -DWINELIB"
43 echo -n 'Short filenames (Y/N) [N]? '
45 if [ "$input" = 'y' -o "$input" = 'Y' ]
47 SHORTNAMES
='#define ShortNames -DSHORTNAMES'
48 ALLDEFINES
="$ALLDEFINES -DSHORTNAMES"
51 LANGS
=`echo En rc/sysres_*.rc | sed -e 's/rc\/sysres_//g' -e 's/\.rc//g' -e 's/ /\//g;'`
52 while expr "$LANGS" : ".*$LANGUAGE" = 0 > /dev
/null
54 prompt
"Language ($LANGS)" LANGUAGE En
55 if expr "$LANGS" : ".*$LANGUAGE" = 0 > /dev
/null
57 echo "\"$LANGUAGE\" is not a supported language."
60 ALLDEFINES
="$ALLDEFINES -ALANG\($LANGUAGE\)"
62 prompt
"Malloc debugging" MALLOC_DEBUGGING N
63 if [ MALLOC_DEBUGGING
= 'Y' -o $MALLOC_DEBUGGING = 'y' ]
65 MALLOC_DEBUGGING
="#define MALLOC_DEBUGGING"
66 ALLDEFINES
="$ALLDEFINES -DMALLOC_DEBUGGING"
71 if [ "`(domainname)`" = 'amscons.com' ]
74 echo -n 'New build program (Y/N) [N]? '
76 if [ "$input" = 'y' -o "$input" = 'Y' ]
78 NEWBUILD
='#define NewBuild -DNEWBUILD'
79 ALLDEFINES
="$ALLDEFINES -DNEWBUILD"
83 prompt
"Global configfile name" WINE_CONFIGFILE
/usr
/local
/etc
/wine.conf
85 if [ -r $WINE_CONFIGFILE ]
93 echo -n "Do you want to make a config file now (Y/N) [$DEFAULT_ANS]? "
99 if [ "$input" = 'y' -o "$input" = 'Y' ]
101 if [ -r $WINE_CONFIGFILE ]
103 echo "Backing up the old file to ${WINE_CONFIGFILE}.old."
104 if cp $WINE_CONFIGFILE ${WINE_CONFIGFILE}.old
107 echo "Error while creating backup file. Fix it and run Configure again"
112 CF_A
=`mount | awk '/^\/dev\/fd/ {print $3;exit} END {print "/a"}'`
113 prompt
"Which directory do you want to use as A:" CF_A
$CF_A
114 CF_C
=`awk '{if ($3=="msdos") {print $2;exit}} END {print "/c"}' /etc/fstab`
115 prompt
"Which directory do you want to use as C:" CF_C
$CF_C
116 prompt
"Where is the Windows directory" CF_Windows
'c:\windows'
117 prompt
"Where is the System directory" CF_System
'c:\windows\system'
118 if [ -r "$CF_C/autoexec.bat" ]
120 CF_Temp
=`tr A-Z a-z < "$CF_C/autoexec.batX" | sed -n 's/^ *set *temp= *\(c:.*[a-z]\).*/\1/p'`
126 prompt
"Where should Windows apps store temp files" CF_Temp
$CF_Temp
127 prompt
"Which path should be used to find progs/DLL's" CF_Path
"$CF_Windows;$CF_System"
128 prompt
"Where is sysres.dll" CF_SystemResources
`pwd`/sysres.dll
129 prompt
"Where is COM1" CF_Com1
'/dev/cua0'
130 prompt
"Where is COM2" CF_Com2
'/dev/cua1'
131 prompt
"Where is LPT1" CF_Lpt1
'/dev/lp0'
132 prompt
"Log messages to which file (CON = stdout)" CF_File
'CON'
135 sed -n -e 's/^ *\"\(WM_[A-Z0-9]*\)\".*/\1/p' < misc
/spy.c | \
136 sort |
pr -ta4w83 |
sed '1 i\
137 Here is the list of messages:\
141 prompt
"Exclude which messages from the log" CF_Exclude
'WM_SIZE;WM_TIMER'
143 cat > $WINE_CONFIGFILE << EOF
153 SystemResources=$CF_SystemResources
157 mssansserif=*-helvetica
179 The config file '"$WINE_CONFIGFILE"' now looks like this:\
181 ' < $WINE_CONFIGFILE |
$PAGER
184 echo -n "Do you want to edit it using $EDITOR (Y/N) [N]? "
186 if [ "$input" = 'y' -o "$input" = 'Y' ]
188 $EDITOR $WINE_CONFIGFILE
191 if [ ! -r $WINE_CONFIGFILE ]
193 echo 'Ok, remember to make it yourself later.'
197 cat > autoconf.h
<< EOF
198 /* autoconf.h generated automatically. Run Configure. */
203 #define WINE_INI_GLOBAL "$WINE_CONFIGFILE"
204 #define AutoDefines $ALLDEFINES
208 echo "Creating Makefiles. This may take a while."
213 WARNING: The exit status of the command 'xmkmf -a' indicates an error.
214 Maybe the Wine directory is incomplete, or Imake (see 'man xmkmf imake')
215 is incorrectly configured? In the latter case, it might be easiest to
216 reinstall X11 to get a new copy of Imake.
220 if [ 0 -lt `find . -name "*.rej" -print | wc -l` ]
224 WARNING: You have some files named '*.rej', which usually indicates
225 rejected patch files. Maybe you tried to upgrade Wine with 'patch',
226 and that some of the patches failed? If something doesn't work, this
227 might be the reason. See 'man patch' (especially the '-p' option).
229 List of "*.rej" files:
232 find .
-name "*.rej" -print
238 echo "Configure finished. Do 'make' to compile Wine."
241 echo "*** There was a problem with 'imake': the main Makefile has not be created."