Am Die, 2003-08-19 um 00.36 schrieb Dimitrie O. Paun:
Try doing winegcc in standard sh, I doubt you'll get any shorter/cleaner code. Not to mention a bit slower :)
You challenged me :-) really, shell coding is one of my favorites.
Have a look at the attached code, if you like. Actually, I found it easier to mimic winegcc than wineld. For C++ code, a link winec++ -> winecc needs to be created.
I have added a few enhancements, such as dealing with non-standard Wine installation directories, running from a Wine source tree, and more sophisticated debug output. Therefore, the code indeed isn't shorter than the C code. IMO it is more readable and to the point, though - but that's of course a matter of taste.
I found that paths in the original winegcc/winewrap are broken for my wine/linux installation, so the paths that I put in these scripts may be broken for MingW. They can be easily customized with environment variables, though; see bottom of winetools.sh.
All three files must be somewhere in the PATH. Everyone is invited to try this stuff out. I ran it with bash, ash, zsh, and pdksh here, so I guess it must be fairly portable.
Please send bug reports to my email address because I'am not reading wine-devel on a daily basis.
Martin