| Installation / compilation instructions | |
| Installing the precompiled Win32 binary | |
| Prerequisities | Dependencies required by SamHaXe. |
| FreeType settings | Steps required using FreeType for font import. |
| ImageMagick settings | Steps required when using ImageMagick for image import. |
| DevIL settings | Steps required when using DevIL for image import. |
| Compiling from source | |
| Prerequisities | Dependencies required by SamHaXe. |
| Build configuration | Configuring build options, dependencies and installation paths. |
| Building SamHaXe | Compiling the source, building the documentation. |
| Prerequisities | Dependencies required by SamHaXe. |
| FreeType settings | Steps required using FreeType for font import. |
| ImageMagick settings | Steps required when using ImageMagick for image import. |
| DevIL settings | Steps required when using DevIL for image import. |
Dependencies required by SamHaXe. Please note that the following applies only to win32 binary versions. You don’t have to configure anything when using the win32 installer.
To use the precompiled Win32 binary you will need the following software installed on your system:
| FreeType 2 | http://sourceforge.net/projects/freetype/files/ |
| ImageMagick | http://www.imagemagick.org |
| ... or ... | (depending on your choice of binary) |
| DevIL | http://openil.sourceforge.net/download.php |
Steps required when using ImageMagick for image import.
Let’s assume that ImageMagick is installed under C:\Program Files\ImageMagick. Then the two additional paths have to be added to PATH environment variable:
| C:\Program Files\ImageMagick | Required for locating CORE_RL_XXXX_.dll files. |
| C:\Program Files\ImageMagick\modules | Required for sub-modules used by ImageMagick. |
Furthermore it looks like that windows binary releases of ImageMagick link to Visual C’s runtime libraries so you have to install those too. From ImageMagick’s website:
If you have any problems, install the Visual C++ 2008 Redistributable Package (x86) or Visual C++ 2008 Redistributable Package (x64). 64-bit Windows requires both packages (x86 & x64).
Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) - http://www.microsoft.com
Microsoft Visual C++ 2008 SP1 Redistributable Package (x64) - http://www.microsoft.com
| Prerequisities | Dependencies required by SamHaXe. |
| Build configuration | Configuring build options, dependencies and installation paths. |
| Building SamHaXe | Compiling the source, building the documentation. |
Dependencies required by SamHaXe.
To compile SamHaXe you will need several software packages installed on your system.
| HaXe compiler | http://haxe.org/download |
| Neko virtual with C dev package | http://nekovm.org/download |
| Some supported C/C++ sompiler suite | GCC, MinGW or VisualStudio |
| ImageMagick with C/C++ dev package | http://www.imagemagick.org |
| DevIL with C/C++ dev package | http://openil.sourceforge.net/download.php |
| FreeType 2 with C/C++ dev package | http://sourceforge.net/projects/freetype/files/ |
| Apache Ant 1.7 or better | http://ant.apache.org/bindownload.cgi |
| NaturalDocs | http://www.naturaldocs.org/download.html |
Configuring build options, dependencies and installation paths.
After installing the required software packages you should take a look at config.ant.sample file and create config.ant with the appropriate options for your system.
| haxe.path | (Default: HAXEPATH environment variable) Path to haXe executable. It’s important to set either this variable correctly or define HAXEPATH otherwise ant won’t find haXe compiler. |
| haxe.stdpath | (Default: haxe.path/std) Path to haXe standard library. |
| haxe.debug | (true / false) Enable/disable debugging. |
| cpp.compiler | (g++ / msvc) C++ compiler to use for compiling native modules. The C++ compiler has to be accessible from the command line so you should add it to PATH. |
| image.module | (imagemagick / devil) Specifies the native image loading module to use. The default is ImageMagick right now but DevIL is the preferred one because it’s much more easier to install and can create images without alpha channel which reduces the size of resulting asset library. |
| imagemagick.include.path | Path to ImageMagick’s header files. Required for compiling native image-imagemagick module. You can obtain this value under linux by issuing the command: “pkg-config --cflags-only-I Wand” This is the directory where Magick++.h is located. |
| imagemagick.library.path | Path to ImageMagick’s shared library files. This is the directory where CORE_RL_wand_.dll (MinGW), CORE_RL_wand_.lib (MSVC) or libMagickWand.so / libWand.so / MagickWand.dylib (gcc) is located. |
| imagemagick.library.name | Name of ImageMagick’s shared library without any prefix or suffix. Typical values are: CORE_RL_wand_ (MinGW and MSVC), MagickWand or Wand (gcc) |
| devil.include.path | Path to DevIL’s header files. This is the directory where the IL/ directory opens from. |
| devil.library.path | Path to DevIL’s library files. This is the directory where DevIL.dll, ILU.dll (MinGW and MSVC) / libIL.so, libILU.so (gcc) are located. |
| devil.base.library.name | Name of DevIL’s base shared library without any prefix or suffix. Typical values are: DevIL (MinGW and MSVC) or IL (gcc). |
| devil.util.library.name | Name of DevIL’s util shared library without any prefix or suffix. The typical value is: ILU. |
| neko.include.path | Path to neko’s include files. Required for all native modules (image and font). This is the directory where neko.h is located. |
| neko.library.path | Path to neko’s library files. This is the directory where neko.dll (MinGW), neko.lib (MSVC) or libneko.so / neko.dylib (gcc) is located. |
| freetype.include.path | Path to FreeType’s include directory. This is the directory where ft2build.h is located. |
| freetype.library.path | Path to FreeType’s shared library files. This is the directory where freetype6.dll (MinGW), freetype.lib (MSVC) or libfreetype.so / freetype.dylib (gcc) is located. |
| freetype.library.name | Name of FreeType’s shared library without any prefix or suffix. Typical values are: freetype6 (MinGW) or freetype (MSVC or GCC). |
| naturaldocs.path | (current working directory) Path to NaturalDocs’ installation directory. NaturalDocs will be executed in this directory. |
| naturaldocs.executable | (NaturalDocs) Full path to NaturalDocs’ executable. Under windows you should use some\path\NaturalDocs.bat here. |
| install.path | (/usr/local) Base installation path. |
| install.path.bin | (install.path/bin) Binaries installation path. |
| install.path.modules | (install.path/lib/samhaxe) Modules installation path. |
| install.path.doc | (install.path/doc/samhaxe) Documentation installation path. |
| install.path.config | (/etc) Configuration installation path. |
SamHaXe uses native modules (neko primitives in neko terms) to achieve tasks which require using external libraries not currently supported by neko. These modules are written in C++ so ant has to be able to invoke the appropriate C++ compiler. There are no options concerning the path to the compiler so make sure it’s accessible from the command line without problems. For example MSVC provides a batch file called “Microsoft Visual Studio Command Prompt” which is accessible from the start menu. Launching this command prompt appends MSVC to PATH environment variable.
FreeType requires some more configuration beyond specifying include and library paths. That is because the compiled native modules have to be able to locate FreeType’s DLL. This can be achieved with one more path added to the PATH environment variable. Let’s assume that FreeType is installed under C:\Program Files\FreeType2. Then the additional path is:
| C:\Program Files\FreeType2\bin | Required for locating freetype6.dll. |
ImageMagick requires some more configuration beyond specifying include and library paths. That is because the compiled native modules have to be able to locate ImageMagick’s DLLs. This can be achieved with two more paths added to the PATH environment variable. Let’s assume that ImageMagick is installed under C:\Program Files\ImageMagick. Then the two additional paths are:
| C:\Program Files\ImageMagick | Required for locating CORE_RL_XXXX_.dll files. |
| C:\Program Files\ImageMagick\modules | Required for sub-modules used by ImageMagick. |
Furthermore it looks like that windows binary releases of ImageMagick link to Visual C’s runtime libraries so you have to install those too. From ImageMagick’s website:
If you have any problems, install the Visual C++ 2008 Redistributable Package (x86) or Visual C++ 2008 Redistributable Package (x64). 64-bit Windows requires both packages (x86 & x64).
Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) - http://www.microsoft.com
Microsoft Visual C++ 2008 SP1 Redistributable Package (x64) - http://www.microsoft.com
DevIL requires some more configuration beyond specifying include and library paths. That is because the compiled native modules have to be able to locate DevIL’s DLLs. This can be achieved with one more path added to the PATH environment variable. Let’s assume that DevIL is installed under C:\Program Files\DevIL. Then the additional path is:
| C:\Program Files\DevIL\lib | Required for locating DevIL.dll and ILU.dll files. |
Compiling the source, building the documentation.
Every component of SamHaXe can be built with the corresponding ant target. You can build an ant target from the command line issuing the command from the project’s base directory:
prompt> ant target_name
| clean | Clean up previously built binaries, documentation, temporary files, etc. |
| demos | Build several assets and sample SWF applications. Assembled assets go to demos/bin/assets, compiled applications go to demos/bin/apps. |
| dist | Build a zip compressed binary distribution. |
| doc | Build documentation with NaturalDocs. |
| install | Install SamHaXe and documentation into the specified directories. |
| modules | Compile SamHaXe modules |
| native | Compile native modules. |
| samhaxe | Compile the entire source including modules, native modules and SamHaXe itself. This is the default target. |
| win32-installer | Build a NSIS (Nullsoft Scriptable Install System, http://nsis.sourceforge.net/) based win32 installer. Only available under windows and with DevIL image library. |
prompt> ant
This will compile native modules, modules, SamHaXe and place the binaries under the bin directory.
prompt> ant install