Winelib
Motto: The journey of a thousand miles starts with a single step.
Introduction
Theoretically, any Win32 app should be compilable out of the box under Wine. This, of course, is not the case. We have incompatible headers, and a bunch of other problems described in Winelib User's Guide. A good way to fix these is to try to compile applications for which we have the source under Winelib.
Why
But what do we hope to achieve? Well, the purpose of this project is four-fold:
- Document our experience on porting these applications to Winelib
- Improve Winelib based on the above such that the porting process becomes very simple
- Update the Winelib User's Guide to the latest porting process
- Fixing header & library problems in the process.
Where
There are many such apps around, and a lot of them are hosted at SourceForge. There are over 10,000 apps listed as running under Windows OS, and over 7,000 of them are listed as running under the Win32 environment. All of the above have publicly available source code, and most are decent candidates for this project.
Obviously, we cannot start porting all these applications. We have to pick a few important ones, and work with those.
How
Compiling apps under Winelib should theoretically involve only makefile changes. In practice, you will encounter header problems, and the likes -- for these it is much better (and faster) to submit a patch, rather than document them. So for the remainder of the section, let's assume the Wine headers are good enough for the application in question.
We are now faced with adapting the build process to Wine's needs. As things stand today, we have to make another assumption: you aim at compiling the application using the GNU toolchain (gmake, gcc, ld, etc.). In theory, it should be possible to accomplish this with other tools, but at this point this is a rather unexplored territory. That being said, we now distinguish two large application classes:
- Non-GNU tools build process
- For these, winemaker does a decent job of generating a build system. I will not cover this type of applications here, for the time being. Please refer to the winemaker documentation for more information.
- GNU tools based build process
- Fortunately, most OSS applications have a build system based around the MinGW tool chain. Sometimes they have alternative build systems for the Borland and/or Microsoft tools, but more often than not they have to support the MinGW tools out of necessity.
What
If you know of applications that should be listed here, please send your suggestions to Dimi. Currently, we have:- WinVi
- Ultimate++
- AbiWord
- WinAMP
- OpenOffice
- TeXnicCenter
- CDex
- CD-DA X-Tractor
- DXSDK's Examples
- Petzold's Examples
- GNU Winboard
- CoolPlayer
- Mozilla
- Visual MinGW
- PuTTY
- Dev-C++
- Gimp
- VirtualDub
Applications
Legend:- TODO: the project is waiting in the queue for someone to pick it up, and run with it
- IN PROGRESS: someone has started porting the application to Winelib
- WORKS: the application compiles, links, and runs as a Winelib application
- DONE: the Winelib platform has been included in the official application build system
- ABANDONED: the application has been deem unsuitable for porting using Winelib
WinVi
- worker: André Hentschel
- status: Some GUI-specific differences to the original
- updated: May 02, 2009
- homepage: www.winvi.de
Ultimate++
It seems to have a MinGW build system since Nov 2004.- worker: wanted
- status: wishlist
- updated: Jan 27, 2005
- homepage: upp.sourceforge.net
AbiWord
- worker: Dimitrie O. Paun
- status: builds & runs cleanly, patches integrated into their tree.
- updated: Apr 16, 2004
- homepage: abisource.com
|
make ABI_OPT_WINELIB=1 |
WinAMP
Suggested by Brian Vincent: Looks like Nullsoft has released the Winamp 3 code as open source.
- worker: Boaz Harrosh
- status: volunteer found
- updated: Feb 24, 2004
- homepage: www.wasabidev.org
OpenOffice
Suggested by Steven Edwards: I have just compleated a full install of OO 1.1 under WINE. No outsite packages are required to install and configure OpenOffice for Win32 under Wine. There are a few minor bugs with some of the strings in menus but I would rate it at 99%. If anyone is interested in a good hobby project a Winelib port of this would be nice to see.
- worker: none
- status: There is a MinGW porting effort, some instructions available already.
- updated: Apr 19, 2004
- homepage: www.openoffice.org
TeXnicCenter
Suggested by Matthias Jahn: It is a tex-shell like kde's "kile".
- worker: Matthias Jahn
- status: runs with Wine, now I try to port it with Winelib
- updated: Apr 20, 2003
- homepage: http://www.toolscenter.org
CDex
Suggested by Stuart Rowan: cdex is a great ripper tool used by many to make mp3s and oggs under windows. [...] If this could be ported to winelib that would be super then I can enjoy it on linux (finally).
- worker: wanted
- status: wishlist
- updated: Apr 14, 2003
- homepage: cdexos.sourceforge.net
CD-DA X-Tractor
- worker: wanted
- status: it has a MinGW build system...
- updated: Mar 30, 2003
- homepage: xtractor.sourceforge.net
DXSDK's Examples
Suggested by Robert Reif.
- worker: wanted
- status: it's a cool idea
- updated: Mar 26, 2003
- homepage: msdn.microsoft.com/library
Petzold's Examples
Suggested by John Kopplin.
- worker: Dimitrie O. Paun
- status: All but the examples from Chap21 build under Winelib
- updated: Mar 24, 2003
- homepage: www.computersciencelab.com/Petzold.htm
It took some work, but we've done it. The good news is that all (but 3) examples compile just fine. This has been accomplished while making absolutely no changes to the original source, and very few (and obvious) changes to the GNU Makefiles.
This is very good news, as it shows we can have a common build system between Wine and Windows. The only samples that don't work just yet are those from Chap21 which build DLLs, and DLL creation is yet not supported by winegcc. I hope this will change in the near future.
The problems that needed fixing were very simple, and quite obvious. They fall into 2 categories:
- The samples expect to link with the msvcrt, not the Unix libc, so we had to pass the -mno-cygwin flag to the compiler/linker. Under mingw this is the default behaviour. This change is actually beneficial for the Windows port as well, as it will allow the samples to be build using Cygwin's gcc also. As such, it should be considered a portability fix, rather than a Wine specific fix.
- The filenames used mixed case (not matching the actual name on disk), and some includes use backslash (\), instead of forward slash (/). This problem is typical and simple to address in a portable manner if you can modify the source. As we wanted to not touch the examples in any way, we had to find another way around it. Luckily, Unix accepts virtually any char in a filename (except / of course), as well as links. So we just created the appropriate symbolic links where necessary, or just renamed the file if it made more sense.
(place the Petzold CD in the CDROM drive)
|
mount /mnt/cdrom mkdir petzold cd petzold cp -r /mnt/cdrom/* . wget http://www.computersciencelab.com/Petzold.zip unzip -a Petzold.zip bash Wine/install.sh make |
GNU Winboard
Suggested by Erwin Wolff.
- worker: E. C. F. Wolff, Dimitrie O. Paun.
- status: Non-computer opponent playing only so far.
- updated: Aug 18, 2003
- homepage: www.tim-mann.org/xboard.html
CoolPlayer
Suggested by Henrik Uggla.
- worker: Vincent Béron.
- status: Trying to submit the changes to the official Git
- updated: Apr 22, 2003
- homepage: coolplayer.sourceforge.net
Mozilla
One of the largest free software projects that we can support with Winelib. Having this one compile, and run under Winelib would be a real tour de force.
- worker: Dimitrie O. Paun
- status: working on the MinGW port
- updated: Dec 31, 2002
- homepage: www.mozilla.org
Update: Mozilla currently requires MS tools to build on Win32. To be ported to Wine, Mozilla must first be ported over to MinGW. There is an ongoing effort to do so that is tracked in bug 134113.
Visual MinGW
Rational provided by Steven Edwards:
[...] WINE might gain more of a market share if there was an easy way for people that are writing Windows apps on Windows if they had an IDE for GCC that was cross-platform. [...] the idea is to run Visual-Mingw under WINElib and be able to just recompile your Win32 app that was built with Visual-Mingw and the w32api package plus reduce some of the redundancy Wine, Mingw and ReactOS have by finding areas where we are not in sync.
- worker: Dimitrie O. Paun
- status: compiles, links, and runs!
- updated: Nov 25, 2003
- homepage: visual-mingw.sourceforge.net
PuTTY
A most loved Windows tool.
- worker: Dimitrie O. Paun
- status: compiles, links, and runs! The patch sent to the maintainer was accepted into the tree.
- updated: Dec 31, 2002
- homepage: www.chiark.greenend.org.uk/~sgtatham/putty
Dev-C++
Andrew Lynch writes:Visual-Mingw sounds almost identical to DevEx found at http://sourceforge.net/projects/wingtk and http://www.bloodshed.net.
I am using their wGLADE tool for cygwin/GTK+ development presently and it works great under Win98.
- worker: Dimitrie O. Paun
- status: abandoned
- updated: Nov 27, 2002
- homepage: www.bloodshed.net/dev/devcpp.html
Update: This project cannot be ported using Winelib, as it is written in Pascal/Delphi. It should be possible to port it to Linux using Kylix relatively easily.
ATL & MFC
This is a very common request. And due to its widespread usage, a very important project as well.
- worker: Ronald MALLET
- status: MFC successfully compiles
- updated: Dec 17, 2002
- I had to uncomment PSH_WIZARD97 in /wine/prsht.h (fixed by Francois)
- The packing pragmas looks handled by gcc-3.2.1, so we may remove all modifications made by winemaker
- I had to force winnt.h to use nameless struct and unions (fixed by Dimi)
- I added #define EDEADLOCK EDEADLK in /wine/msvcrt/errno.h (fixed by Francois)
- I linked _alloca() to alloca() function (fixed by Alexandre)
- There was a conflict on HKEY type between afxres.h and wine/windef.h
- Some little others syntax issues like: __try __expect, asm {}, unsigned short(x), (LPCTSTR)CString
Gimp
This one's a very strange case. The Gimp is a native Linux application built around the GTK+ toolkit. It became a native Windows application by porting over the entire GTK+ toolkit, and other supporting libraries. It would thus be quite interesting to see how it can be ported back to Linux, via Winelib.
- worker: wanted
- status: todo
- updated: Nov 27, 2002
- homepage: www.gimp.org/~tml/gimp/win32
VirtualDub
Suggested by Nerijus Baliunas since it is often requested.
- worker: wanted
- status: todo
- updated: Nov 27, 2002
- homepage: www.virtualdub.org
Winelib Fixes
As explained in the introduction, the primary motivation for this effort is to discover, and fix Winelib shortcomings. These are the fixes that have been suggested and discussed thus far:- Configuration
- Submit patch to autoconf to recognize Wine as a platform. [TODO]
- worker: none
- status: not started
- updated: Nov 28, 2002
- Compilation
- Write a small wrapper that makes gcc on Linux behave like mingw. [DONE]
- worker: Dimitrie O. Paun
- status: patch submitted, and committed.
- updated: Dec 5, 2002
- Resources
- Make wrc compatible with windres at command line level. [DONE]
- worker: Dimitrie O. Paun
- status: working on this solution, patch submitted, and committed.
- updated: Dec 6, 2002
- Linking
- Write wrapper script that takes care of generating .spec files, etc. [DONE]
From Alexandre:
Yes, I think we want a wrapper like dllwrap to do all that. I'm not sure a script would be enough, we may want a full-fledged C program. The idea would be that you do something like:winewrap *.o *.res -o foo -lwhatever
and it builds the .spec.c, compiles it, links everything into foo.exe.so, and builds a foo executable (which may be a wrapper script or a real ELF binary). This also (mostly) solves the "Running" issues: you still have a .exe.so file, but you don't really need to worry about it. You simply run "foo" and everything works.- worker: Dimitrie O. Paun
- status: first cut submitted for review, patch committed.
- updated: Dec 16, 2002
- Running
- Arrange so that a regular Unix executable is generated. [DONE]
Improve the wineapploader so it can be used directly by the step above.
- worker: Dimitrie O. Paun
- status: patch committed.
- updated: Dec 16, 2002


