Compiling MegaZeux

From MZXWiki
Revision as of 22:22, 6 June 2012 by Kuroneko (talk | contribs) (Added Mac OS X instructions.)
Jump to navigation Jump to search

Compiling any MegaZeux 2.8x source requires a POSIX compatible shell (bash, dash) to be installed. Download the source .tar.bz2 or .tar.xz and extract it to a new folder.

Building

supo apt-get install libsdl1.2-dev libogg-dev libvorbis-dev libpng-dev

Download our dependencies.

./config.sh

This will give you help about how to configure MegaZeux.

./config.sh --platform unix

To configure the sources. On OS X, the platform is "darwin", and on win32 the platform is "win32".

make

This will build MegaZeux from sources. If it fails, you probably don't have one of SDL, libvorbis, libogg, libpng, zlib or the corresponding dev packages installed.

make install

This will install MegaZeux to the system. Do not use for the "unix-devel" platform, which is intended to run straight out of the source directory.

Please see debian/README for more information.

Mac OS X

You will need to install XCode and optionally MacPorts before continuing. Determine the name of your compiler before continuing; typing 'i686-' or 'powerpc-' and pressing tab twice should be sufficient. Example output:

i686-apple-darwin10-g++-4.2.1 i686-apple-darwin10-gcc-4.2.1
sudo port install libsdl libogg libvorbis libpng

Compile/install dependencies. If you didn't install MacPorts, you're on your own for this step.

Navigate to the MegaZeux source directory and edit arch/darwin/Makefile.in. Verify the gcc and g++ commands for your flavor of Mac match the names you found previously. Next, scroll down to the line that starts like:

LIBPNG_LDFLAGS ?=

At the end of it will be libpng-config --libs if you're building <=2.84. Change --libs to --ldflags if this is the case. Save your changes and exit the editor.

Now, in the source directory, run ./config.sh. Consider the following flags:

--platform darwin   ---------- Mandatory.
--disable-x11       ---------- I've never tried it without this.  I don't know if it would work.
--disable-utils     ---------- This disables compilation of utilities such as downver and checkres.  User preference.
--enable-release    ---------- Removes debug symbols.  This will make the package smaller if you intend on installing MZX in app form.
--prefix /opt/local ---------- Only add if you're using MacPorts.
make

Hopefully nothing will go wrong! :)

Packaging

Mac OS X

Make sure there is not a "MegaZeux" volume mounted before continuing.

rm -r build/
make lipo
make archive

A .dmg will appear in build/arch/darwin/. Please refer to the documentation in arch/darwin/ for more details.