Thursday, February 08, 2007

Compile WINE on Mac OS X Tiger

The WINE is more practical than ever on Mac OS after the Apple Inc. shifted to Intel platform.

There was Darwine (maybe I should say IS, but I haven't seen any update from Darwine for over half a year now). Darwine is meant for PowerPC Macs - because the lack of binary compatibility, Darwine needs a PC emulator to run Windows applications on PowerPC Macs. (It still better than running a virtual Windows - you don't need the Windows license to run WINE or Darwine.

Things are much less complex now, thanks to the moving to the Intel CPUs. At the core, a Mac is binary wise compatible with a PC running Windows. All you need to run (most) Windows applications on a Mac OS is WINE.

However, there are not many doc out there telling people how to build WINE on a Mac.
I guess it is TOO easy for the hard-core WINE "drinkers" and there is no need for a step by step doc for building it. However, a lot of Mac user are not as CMDLUI (Command line User Interface) as Linux users, and I figure it may be helpful if we have a (brief) doc helping users to build WINE on Mac OS X.


Let me try to make it easier for you here (Everything is done on Mac OS X 10.4 Tiger).

1) you will need X11. Remember that WINE is written for Linux originally, and it use the de facto GUI standard - X11. While Mac OS X comes with X11 (Mac is based on Darwin - a variance of FreeBSD), it is not the default Apple GUI (which is AQUA). You can check if you have X11 by open the Finder, under Applications, Utilities, you an app called X11 sitting there. If you don't see it there, you need to install it by pop in the Mac OS X installation DVD, run the Optional Packages, and select X11 in it.

2)You will need Xcode with X11 SDK. These are the tools you use to compile and build WINE. It is freely available to Mac Users (it is GCC 3.3 and 4.0 at the core). One thing to note though, you need Xcode 2.4.1 or up. The Xcode came on the DVD will give you Syntax error ( unknow structure x86_DEBUG_STATE32) while compiling mach.c.

A good thing about Xcode is it is so easy to use, it nearly make you forget you are "developing" something. Don't be scared if you never wrote any program, it is really simpler than Microsoft Office.

3)You need Freetype 2.05 or up. You can either use a package (Macport/DarwinPort or fint), or you can download the source and build your own. I prefer download and build my own (probably because of my Linux background).

4)You will need Fontforge. Again you can chose to install a package or build it from source. Again, I prefer build from source.

5) You will need to change the PATH before you start ./configure of WINE, or it will not be able to find X11 and freetype. export PATH=/usr/X11/bin:$PATH.

6) now some basic things that Linux guys will laugh at me for writing about it. you now download wine, extract it to a directory, go into that dir and run "./configure"

7) make sure ./configure shows you no error, at the end it tells you now run "make depend && make". do so.

8) if everything returns clean, you should install wine to /usr/local/ by running make install.

9) now you can test your wine by running ./wine notepad.exe (you need to copy the notepad.exe from a real Windows machine).

10) optional but suggested: add "/usr/local/bin" to your PATH.

Upgrading to SAP ECC 6.0 with error in RSUVSAVE phase.

YOu may see error check log failure "PSUVSAVE\.SID".
The message inidicates the filename is not right (the "\" before the ".") make you think the upgrade assistant (SAPup actually) is looking for a file with "\" in its name.

That's misleading. It is just a Unix escape character that was not removed in the error message.

This actually because the DIR_PUT was not set right (check your DEFAULT.PFL) the upgrade always check for the log files in /usr/sap/put/log dir, but most of the case the default DIR_PUT is the transport dir.

Also, you NEED to bounce your SAP instance for this change. While the UA will go on right after you change the DEFAULT.PFL without recycle the instance, it will give you error like this one later.

So, check your profile as early as you can, and bounce your instance if you need to.

Perl ERROR: Can't call method "mail" on an undefined value at smtp.pl line 10.

As confusing at it sounds, this means your smtp object has not been sucessfully constructed. I know the error message reads more like a problem with the "mail" method, but it is actually because the SMTP obj was not initialized.


Try this:
#!/usr/bin/perl -w
use Net::SMTP;
$smtp_test = Net::SMTP->new('smtp.mail.com',
Timeout => 30,
Debug => 1,)|| print "ERROR creating SMTP obj: $! \n";
print "SMTP obj created.";

If you see "ERROR createing SMTP obj" then you know the SMTP object is not created correctly.


Some times, this is because the SMTP package was not installed right, some times, it may because the SMTP protocal is blocked, sometimes it means something else is wrong.