// This file is in AsciiDoc format. It is converted to README.html.

Compilation instructions
------------------------


Required tools
~~~~~~~~~~~~~~

For all builds you will need:

C/C++ compiler and Make utility::
On Windows download http://www.mingw.org/[MinGW]
and install binutils, core compiler, g++ compiler, w32api and MinGW Make.

Perl::
On Windows install either http://www.activestate.com/activeperl/[ActivePerl]
or http://cygwin.com/[Cygwin]'s Perl.

xasm and MADS::
If you are compiling latest source code from CVS, install
http://xasm.atari.org/[xasm] and http://mads.atari8.info/[MADS].

Make sure these tools are on your `PATH`.


Getting officially released source code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to compile an official release of ASAP, download source distribution
(`asap-*.tar.gz`) and uncompress it to a directory of your choice.

On Unix-like systems:
--------------------------------------------------------------------------------
tar zxf asap-*.tar.gz
--------------------------------------------------------------------------------

On Windows you may use http://7-zip.org/[7-Zip].


Getting latest source code
~~~~~~~~~~~~~~~~~~~~~~~~~~

Alternatively you may get the latest version from the CVS repository.
To do this using a command-line CVS client:
--------------------------------------------------------------------------------
cvs -z9 -d:pserver:anonymous@asap.cvs.sourceforge.net:/cvsroot/asap co -P asap
--------------------------------------------------------------------------------

This will fetch the latest code to a new directory called `asap`.


Building ASAP2WAV and libasap on Unix-like systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From your shell prompt navigate to the directory which contains `asap.c`.

To compile and install, run the following commands:
--------------------------------------------------------------------------------
make
make install
--------------------------------------------------------------------------------

The second command must be run with super-user priviledges.
It installs the command-line converter and the C library under the directory
specified as `PREFIX` in the `Makefile`
(`/usr/local`, feel free to edit `Makefile`).


Using ASAP2WAV
~~~~~~~~~~~~~~

Run the program from command line to see the syntax.
Unless you specify the `-o`/`--output` option, the output filename will be
constructed from the input filename with the extension changed to `wav`.


Using libasap
~~~~~~~~~~~~~

The library is documented in the `asap.h` header file.
Be warned there might be breaking changes in the future versions of the library.


Building the XMMS plugin on Unix-like systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You need full XMMS installation.
If you have just the XMMS binary package installed, you additionally need
`xmms-devel`. I have tested only the 1.2.10 version of XMMS.
XMMS itself depends on Gtk+ and Glib, so you need them too.

To compile, run the following command:
--------------------------------------------------------------------------------
make asap-xmms
--------------------------------------------------------------------------------

If the compilation finished successfully, you can install the plugin
in your home directory:
--------------------------------------------------------------------------------
make install-xmms-user
--------------------------------------------------------------------------------

or, if you are root, for all users:
--------------------------------------------------------------------------------
make install-xmms
--------------------------------------------------------------------------------

If you have another XMMS plugin that supports 8-bit Atari music,
remove it in order to avoid conflicts.


Building the MOC plugin on Unix-like systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You need source code of MOC. The plugin is compatible with MOC 2.4.x
and MOC 2.5.0 alpha.

Edit `Makefile`. Pay attention to `MOC_INCLUDE` and `MOC_PLUGIN_DIR`.

Then use the following commands:
--------------------------------------------------------------------------------
make asap-moc
make install-moc
--------------------------------------------------------------------------------


Building the XBMC plugin on Linux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You need source code of the Linux port of XBMC. Make sure it includes
support for ASAP.

Edit `Makefile`.
`XBMC_DLL_LOADER_EXPORTS` must point to the directory in XBMC sources
which contains `wrapper.def` and `wrapper.o`.

Then run:
--------------------------------------------------------------------------------
make asap-xbmc
--------------------------------------------------------------------------------

You will get `xbmc_asap-i486-linux.so`.


Building ASAP2WAV, WASAP, Winamp/GSPlayer/Apollo plugins, RMT DLL, asapscan and libasap on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From the command prompt navigate to the `win32` directory and run:
--------------------------------------------------------------------------------
mingw32-make mingw
--------------------------------------------------------------------------------

You should get `asap2wav.exe`, `wasap.exe`, `in_asap.dll`, `gspasap.dll`,
`ASAP_Apollo.dll`, `apokeysnd.dll`, `asapscan.exe` and `libasap.a`.


Building Windows Media Player plugin and asap.lib on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You additionally need
http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&displaylang=en[Windows SDK]
(install native C++ compiler, headers, libraries and samples).
Set `Path`, `INCLUDE` and `LIB` environment variables
to point to the right locations in the Windows SDK.
Make sure `DSHOW_BASECLASSES_DIR` is set correctly in `win32\Makefile`.

From the command prompt navigate to the `win32` directory and run:
--------------------------------------------------------------------------------
mingw32-make dsf asap.lib
--------------------------------------------------------------------------------

You will get `asap_dsf.dll` and `asap.lib`.


Building the foobar2000 plugin on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In addition to the common prerequisites and Windows SDK you need
foobar2000 0.9 SDK - extract it to a new directory called
`foobar2000_SDK` next to (not inside!) the ASAP directory.

From the command prompt navigate to the `win32` directory and run:
--------------------------------------------------------------------------------
mingw32-make foo
--------------------------------------------------------------------------------

This should produce `foo_asap.dll`.


Building the GSPlayer plugin for Windows CE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You need http://cegcc.sourceforge.net/[CeGCC].
From the command prompt navigate to the `gsplayer` directory and run:
--------------------------------------------------------------------------------
mingw32-make wince
--------------------------------------------------------------------------------

This should produce `gspasap.dll` for ARM processors.


Building Java ASAP2WAV, applet and midlet
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You need Java Development Kit (JDK), a C preprocessor (a component
of a C compiler) and a Make utility. To compile the midlet, you additionally
need Perl and a Wireless Toolkit (WTK) - I use Sony Ericsson SDK
for the Java ME Platform, although Sun's WTK should work too after adjusting
paths.

Edit the paths at the top of `java/Makefile` so they point to your installed
tools. From the command prompt navigate to the `java` directory and run:
--------------------------------------------------------------------------------
make
--------------------------------------------------------------------------------

This should produce `asap2wav.jar`, `asap_applet.jar`, `asap_midlet.jar`
and `asap_midlet.jad`.


Building C# ASAP2WAV on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You need .NET Framework, of course.

From the command prompt navigate to the `csharp` directory and run:
--------------------------------------------------------------------------------
mingw32-make
--------------------------------------------------------------------------------

This should produce `asap2wav.exe`.


Building the XBMC plugin on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You need Visual C+\+ Toolkit (was free download from Microsoft,
now search the internet for `VCToolkitSetup.exe`) or Microsoft Visual C++ 2003.

Navigate to the `win32` directory and run:
--------------------------------------------------------------------------------
mingw32-make xbmc
--------------------------------------------------------------------------------

This should produce `xbmc_asap.dll`, which you can use with XBox
or Windows version of XBMC. The XBMC must include support for ASAP.


Building JScript ASAP2WAV and JavaScript ASAP2WAV for web browsers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Navigate to the `javascript` directory and run:
--------------------------------------------------------------------------------
make
--------------------------------------------------------------------------------
(or `mingw32-make`).

The results are `asap2wav.js` and `asapweb.js`.


Building Flash player version of ASAP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You need http://www.adobe.com/products/flex/flexdownloads/[Flex SDK].
Add its `bin` directory to your `PATH`.

Navigate to the `flash` directory and run:
--------------------------------------------------------------------------------
make
--------------------------------------------------------------------------------
(or `mingw32-make`).

You should get `asap.swf`.