This article is from the WINE WINdows Emulator FAQ, by Dave Gardner email@example.com with numerous contributions by others.
To compile Wine, you must have one of:
Linux version 0.99.13 or above
FreeBSD-current or FreeBSD 1.1 or later
OpenBSD/i386 2.1 or later
Solaris x86 2.5 or later
You also need to have libXpm installed on your system. The sources for
it are probably available on the ftp site where you got Wine. They can
also be found on ftp.x.org and all of its mirror sites.
On x86 systems, gcc >= 2.7.0 is required. You will probably need flex too.
To build Wine, first do a "./configure" and then a "make depend; make" from
the Wine directory. This will build the library "libwine.a", which can be
used to compile and link Windows source code under Unix, and the program
"wine", which will load and run Windows executables. If you have an ELF
compiler, you can use "./configure --enable-dll" to build a shared library
Additionally, you may want to set the TMPDIR environment variable, as in:
TMPDIR=/tmp (if you are root)
Wine requires that you have a file called "/usr/local/etc/wine.conf" (you
can supply a different filename when configuring wine) or a file called
".winerc" in your home directory. The format of this file is explained in
the Wine man page. The file "wine.ini" contains a config file example.
More explicit directions can be found in the README file that will be
located in the base Wine directory after you ungzip and untar the