Tuesday, January 03, 2006

Compiling MPlayer on SUSE 10

For those of you brave enough to have installed SUSE 10 you are no doubt getting increased productivity thanks to better apps, a well-thought out interface and nearly seamless integration with 3rd party software. I say nearly because in attempting to compile MPlayer for SUSE 10, I came upon the problem of having GCC 4.0 installed by default. Being as it is such a new compiler, most dev teams haven't had the time to fully test and integrate with it. Remember the 2.96 debacle? I just hope the SUSE team's enthusiasm for cutting-edge software will not cause their product to get slammed like RH7 was.

So the first order of business is downloading everything you'll need. Go to the MPlayer homepage and grab the source tarball and a skin tarball. I chose proton although I'm thinking of going back to the classic Blue theme. If you'd like to play Windows media files then download the 'all codecs' package as well. In addition, you will need to download an older version of GCC. I chose 3.4.5 as that was the last stable version in the 3.x tree.

Once you get yourself a previous version of GCC downloaded and untar'd, create a directory titled gcc-3.4.5 in your /opt directory. Assuming you are in the newly untar'd directory, configure your build of GCC with the following command:
shell> ./configure --prefix=/opt/gcc-3.4.5

If everything goes well, you should get no errors. Follow up with the requisite make and make install commands. To test your new version of GCC out, cd to /opt/gcc-3.4.5/bin and type ./gcc. The help screen for version 3.4.5 should thus be displayed.

Now that we have our previous version of GCC up and running, it is time to compile MPlayer. Untar each of the downloaded files. Copy all the files in the directory which contains the Windows codecs into /usr/local/lib/codecs if you will be using them. Change back to the MPlayer untar'd directory and type the following command:
shell> ./configure --enable-gui --cc=/opt/gcc-3.4.5/bin/gcc

This tells the compiler to enable the GUI and to use the older version of GCC that we installed. Again, follow up this command with the requisite make and make install to complete the installation of MPlayer. As well, be sure to copy the contents of the downloaded skin directory into the installed mplayer/Skin directory, by default located at /usr/local/share/mplayer/Skin/. Type gmplayer at the shell to bring up the graphical version of MPlayer.

No comments: