Compiling MegaZeux: Difference between revisions

From MZXWiki
Jump to navigation Jump to search
(Reformat page)
Line 1: Line 1:
[[Category:Instructions]] [[Category:MegaZeux]]
[[Category:Instructions]] [[Category:MegaZeux]]
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.
Compiling any MegaZeux 2.80 or later 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==
==General Commands==
  ./config.sh
  ./config.sh
This will give you help about how to configure MegaZeux.
This will give you help about how to configure MegaZeux.


  ./config.sh --platform unix
  ./config.sh --platform unix
To configure the sources. On OS X, the platform is "darwin", and on win32 the platform is "win32".
To configure the sources. On OS X, the platform is "darwin", and on Windows the platform is either "win64" or "win32".


  make
  make
Line 13: Line 13:


  make install
  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.
This will install MegaZeux to the system. This should not be used with the "unix-devel" platform or any other option intended to run straight out of the source directory.


Please see debian/README for more information.
Please see debian/README for more information.




===Windows with MSYS2===
==Windows==
Download and install '''msys2''' (these instructions are for '''msys2-x86_64-20161025.exe''' specifically)
For compiling MegaZeux with Windows, the generally supported POSIX platform is [https://www.msys2.org/ '''MSYS2''']. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install '''MSYS2''' before continuing.
   
   
Run '''mingw64.exe''' in the ''msys2'' directory. You will be in the "{MSYS DIRECTORY}\home\{your username}\" directory.  (This will display in the mingw64 shell as either "~" or "/home/{your username}")  
Run '''mingw64.exe''' in the ''msys2'' directory. You will be in the "{MSYS DIRECTORY}\home\{your username}\" directory.  (This will display in the mingw64 shell as either "~" or "/home/{your username}")  
Line 52: Line 52:
  yes Y | pacman -S mingw-w64-x86_64-imagemagick
  yes Y | pacman -S mingw-w64-x86_64-imagemagick


===Ubuntu/Debian===
===Troubleshooting===
- ''"The program can't start because ___.dll is missing."''
 
If you are not running MegaZeux from '''mingw64.exe''', add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'') to your Windows PATH variable.
 
- ''"The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll." (and similar errors)''
 
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.
 
 
==Ubuntu/Debian==


  sudo apt-get install gcc g++
  sudo apt-get install gcc g++
We need compilers!
Download compilers to build MegaZeux. MegaZeux will also build with clang.


  supo apt-get install libpng-dev libogg-dev libvorbis-dev libsdl1.2-dev libsdl2-dev  
  supo apt-get install libpng-dev libogg-dev libvorbis-dev libsdl1.2-dev libsdl2-dev  
Download our dependencies.
Download the dependencies required to build MegaZeux.
 
sudo apt-get install git
git clone https://github.com/AliceLR/megazeux.git
Alternatively, download and extract the latest .tar.xz or .tar.bz2 source archive to the desired location.


The above instructions should work now.
See the "general commands" section above for more information.


===Mac OS X with MacPorts (testing only)===


==Mac OS X==
===With MacPorts (testing only)===
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.
You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.
Install the toolchain we'll use in MacPorts.
sudo port install gcc7 binutils


Compile/install dependencies.
Compile/install dependencies.
  sudo port install zlib libpng libogg libvorbis libsdl libsdl2
  sudo port install zlib libpng libogg libvorbis libsdl


Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.
Navigate to the extracted source directory.  If you're building MZX 2.90 and under, please download [https://github.com/AliceLR/megazeux/blob/master/arch/darwin/Makefile.in this updated Makefile.in] and put it in arch/darwin/, otherwise MegaZeux will fail to compile.
Line 81: Line 93:
  --enable-release    ---------- Removes debug symbols.  This will make the package smaller if you intend on installing MZX in app form.
  --enable-release    ---------- Removes debug symbols.  This will make the package smaller if you intend on installing MZX in app form.


Run make, overriding the default compiler flags:
Build MegaZeux as usual:
  make -j8 -s CC=gcc CXX=g++
  make -j8


==Packaging==
===Packaging===
===Mac OS X===
Make sure there is not a "MegaZeux" volume mounted before continuing.
Make sure there is not a "MegaZeux" volume mounted before continuing.


Line 92: Line 103:
  make archive
  make archive
A .dmg will appear in build/arch/darwin/.  Please refer to the documentation in arch/darwin/ for more details.
A .dmg will appear in build/arch/darwin/.  Please refer to the documentation in arch/darwin/ for more details.
==Troubleshooting==
===Windows===
- ''"The program can't start because ___.dll is missing."''
If you are not running MegaZeux from '''mingw64.exe''', add the folder containing your dependencies (generally ''C:\msys64\mingw64\bin'') to your Windows PATH variable.
- ''"The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll." (and similar errors)''
This can happen because the Windows PATH variable contains a directory older copy of ''zlib1.dll'' (or the DLL in question).  You can use '''where zlib1.dll''' in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.

Revision as of 02:52, 9 December 2018

Compiling any MegaZeux 2.80 or later 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.

General Commands

./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 Windows the platform is either "win64" or "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. This should not be used with the "unix-devel" platform or any other option intended to run straight out of the source directory.

Please see debian/README for more information.


Windows

For compiling MegaZeux with Windows, the generally supported POSIX platform is MSYS2. Other available options include MINGW32/msys, Cygwin, etc., but are typically more complicated than MSYS2. Download and install MSYS2 before continuing.

Run mingw64.exe in the msys2 directory. You will be in the "{MSYS DIRECTORY}\home\{your username}\" directory. (This will display in the mingw64 shell as either "~" or "/home/{your username}")

First, run this command. MSYS2 will need to restart when it is finished.

yes Y | pacman -Syu

After restarting MSYS2, run the following commands.

yes Y | pacman -S git
yes Y | pacman -S make
yes Y | pacman -S mingw-w64-x86_64-zlib
yes Y | pacman -S mingw-w64-x86_64-gcc
yes Y | pacman -S mingw-w64-x86_64-gdb
yes Y | pacman -S mingw-w64-x86_64-libpng
yes Y | pacman -S mingw-w64-x86_64-libogg
yes Y | pacman -S mingw-w64-x86_64-libvorbis
yes Y | pacman -S mingw-w64-x86_64-SDL2
git clone https://github.com/AliceLR/megazeux.git
cd megazeux
./config.sh --platform win64
make

MegaZeux should be built and ready to run! If you are not running MegaZeux from mingw64.exe, add the folder containing your dependencies (generally C:\msys64\mingw64\bin) to your Windows PATH variable.

The following optional packages may be of use. They are not required or are part of the packaging process for some architectures.

yes Y | pacman -S nano
yes Y | pacman -S p7zip
yes Y | pacman -S mingw-w64-x86_64-clang
yes Y | pacman -S mingw-w64-x86_64-imagemagick

Troubleshooting

- "The program can't start because ___.dll is missing."

If you are not running MegaZeux from mingw64.exe, add the folder containing your dependencies (generally C:\msys64\mingw64\bin) to your Windows PATH variable.

- "The procedure entry point inflateReset2 could not be located in the dynamic link library zlib1.dll." (and similar errors)

This can happen because the Windows PATH variable contains a directory older copy of zlib1.dll (or the DLL in question). You can use where zlib1.dll in Command Prompt to view the different PATH locations that contain the DLL, as well as the order in which Windows will try to load it.


Ubuntu/Debian

sudo apt-get install gcc g++

Download compilers to build MegaZeux. MegaZeux will also build with clang.

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

Download the dependencies required to build MegaZeux.

sudo apt-get install git
git clone https://github.com/AliceLR/megazeux.git

Alternatively, download and extract the latest .tar.xz or .tar.bz2 source archive to the desired location.

See the "general commands" section above for more information.


Mac OS X

With MacPorts (testing only)

You will need to install XCode and MacPorts before continuing. This method is suitable only for testing builds, and should not be used to produce releases.

Compile/install dependencies.

sudo port install zlib libpng libogg libvorbis libsdl

Navigate to the extracted source directory. If you're building MZX 2.90 and under, please download this updated Makefile.in and put it in arch/darwin/, otherwise MegaZeux will fail to compile.

Run ./config.sh. Consider the following flags:

--platform darwin   ---------- Mandatory.
--prefix /opt/local ---------- Mandatory.
--disable-libsdl2   ---------- MegaZeux may or may not build with the SDL 2 in MacPorts.
--disable-utils     ---------- This disables compilation of utilities such as downver and checkres.  This is optional.
--enable-release    ---------- Removes debug symbols.  This will make the package smaller if you intend on installing MZX in app form.

Build MegaZeux as usual:

make -j8

Packaging

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.