Im posting this with the idea that it will be useful for future reference on the compilation of wine for other arm architechure devices. If you are compiling on iDevice you will need atleast 2G of hardrive in /var partition. Wine itself wont take up 2G, but when compiling Make creates files it needs on the fly which will take up a lot of space. Also time, Probably about 4 hours of compiling. Im still compiling

so Im not %100 sure this will be useful. Although its pretty much in the bag at this point as far as i'm concerned.
First thing you will need to do is download Wine. This has only been tested with Wine-1.3.9.
http://distfiles.macports.org/wine/wine-1.3.9.tar.bz2Once you download the latest Wine. You will need to edit some files. First being the Make.vars.in file in the /Wine-1.3.9 directory. Change the lines CC, LIBEXT, and DLLEXT from
CC = @CC@
LIBEXT = @LIBEXT@
DLLEXE = @DLLEXE@to this:
CC = gcc
LIBEXT = so
DLLEXE = .soThen, navigate to /Wine-1.3.9/libs/wine And find the port.c file. It that file is a register that xcode doesnt understand. So we need to edit a couple lines near the end of the file after #elif defined(__arm__) && defined(__GNUC__)
You two lines your going to edit are
"push {r4,LR}\n\t"
"pop {r4,PC}"to
"STMFD sp!, {r4,LR}\n\t"
"LDMFD r0!,{r4,PC}"The next file, (in the same directory) is called loader.c
You need to find the wine_init function. Were going to use the #ifdef #undef trick to undefine this function. A litte harde to explain so here are screen shots of the file before and after.


Once we have done all this, We can compile the first part of Wine. The most important part being the tools. First set the CPP to 'gcc -E'
export CPP='gcc -E' Use these configure flags:
./configure --build=arm --without-freetype --without-pthread --disable-win16 the --without-freetype and --without-pthread are optional if you have those installed or fell like compiling them yourself first. Also, im not sure if you want to use the --enable-shared flag or not.
Now run
make depend && make toolsAfter that, we need to go back into the file system and change the way winegcc behaves. Navigate to the /Wine-1.3.9/dlls and open the Makedll.rules file and edit the WINEGCC line. After the -shared flag add -Wl,-read_only_relocs,suppress. So it looks like this

If you dont see the Makedll.rules file. Run make untill you get errors. Then edit the Makedll.rules file
Then we can run make again. Giving it the -k flag will tell it to keep going incase we get an error.
make -kThis last make process is too create the .dll's and programs like calc, notepad, wow, things like that. Not important. Infact, the libwine file is already created. You can download another wine source code, and when running configure, give it the --with-wine-tools=/wine-1.3.9 (where ever your precompiled wine-1.3.9 tools are stored)
Then go watch a movie or maybe even do this before you go to bed. Ive been compiling for 4 hours now and still havent even gotten through all the DLLS yet. Im pretty sure I got it though. Im sure I will be adding to this.....
Ill be back laterz.