Compiling Angband
=================

Last updated on 4th July 2001 by Robert Ruehlmann


----------------------------------------------------------------------
Quick and dirty compilation instructions
----------------------------------------------------------------------

For many platforms (including Windows and DOS), a "pre-compiled" archive
is available, which contains everything you need to install and play
Angband.  For other platforms, including most UNIX systems, you must
compile the source code yourself.  Try the following non-trivial steps:

Step 1: Acquire.   Ftp to "clockwork.dementia.org/angband/Source"
                   Try "bin" and "mget angband*.tar.gz" and "y"
Step 2: Extract.   Try "gunzip *.gz" then "tar -xvf *.tar"
Step 3: Prepare.   Try "cd angband*/".
Step 4: Configure. Try "./configure". Edit "src/config.h" if you wish.
Step 5: Compile.   Try "make".
Step 6: Install.   Try "make install".
Step 7: Play...    Try "./angband".
                   Read the "online help" via the "?" command.

Of course, if you have a compiler, you can compile a (possibly customized)
executable on almost any system.  You will need the "source archive" (as
above), which contains the standard "src" and "lib" directories, and for
some platforms (including Windows), you will also need an
appropriate "extra archive", which contains some extra platform specific
files, and instructions about how to use them.  Some "extra archives" may
be found at the ftp site and "/angband/Windows/ext-win.zip"), but be sure
that you get a version of the "extra archive" designed for your Angband version.

About configure:
    ./configure --help
shows which options to use.  Other settings can be tuned like this:
    env CC='cc' CPPFLAGS='-DUSE_HARDCODE' ./configure
You can set CC (compiler), CPPFLAGS (preprocessor flags),
CFLAGS (compiler flags), LDFLAGS (linker flags), and LIBS (libraries).
Configure may modify all but CC.

An alternative to configure is to edit src/h-config.h and a makefile,
probably src/Makefile.std, and run "cd src; make -f Makefile.std".


----------------------------------------------------------------------
DOS + DJGPP
----------------------------------------------------------------------
(written by Robert Ruehlmann < rr9@angband.org >)

- Install DJGPP:
	You can get the freely available DJGPP C Compiler from
	< http://www.delorie.com/djgpp/ >.  On the DJGPP-page go to the
	Zip-Picker < http://www.delorie.com/djgpp/zip-picker.html >.
	This page helps you decide which ZIP files you need to download
	and will even try to find a ftp-site near you.
	If you want to have graphics and sound then you also need the
	Allegro-library < http://www.talula.demon.co.uk/allegro/ >.
	Get all files and follow the installation instructions.
- Install the Angband source:
	Get the source code archive and the untgz tool from:
	< ftp://clockwork.dementia.org/angband/Tool/untgz.exe >.
	Then extract the source with untgz.
- Install other required files:
	Get the "extra archive" from
	< ftp://clockwork.dementia.org/angband/DOS-386/ext-dos.zip >.
	Go to the angband directory and unzip the ext-dos archive into it.
	Then get the graphics archive from
	< ftp://clockwork.dementia.org/angband/Extra/angband-graf.zip >
	and unzip it into the lib/xtra/graf/ folder.
- Select the makefile:
	Go to the src-directory and rename 'Makefile.dos' (or 'Makefile.ibm'
	if you don't want graphics and sound and didn't download the Allegro
	library) to 'Makefile'.
- Compile Angband:
	Run "make install".  Angband should now be compiled and installed
	into the Angband folder.
- Run Angband:
	Go back to the Angband folder and run Angband.exe.

- Possible problems:
	- Make exits with a 'Fatal: Command arguments too long' error message:
	Such problems are usually caused by using the make.exe of another
	compiler (like Borland C++ or cygwin).  DJGPP uses some clever tricks
	to get around the limitations of the MS-DOS "126 characters are enough
	for anybody" commandline that require a specific make tool.  So make
	sure that DJGPP's make.exe is the first (or only) make.exe in your
	path.  See also the DJGPP FAQ entries 16.4, 16.5, and 16.6 for further
	details.


----------------------------------------------------------------------
Windows 95/98/NT/2000 + MS Visual C++ 5.0/6.0
----------------------------------------------------------------------
(written by Robert Ruehlmann < rr9@angband.org >)

- Install the Angband source:
	Get the source code and the untgz tool from:
	< ftp://clockwork.dementia.org/angband/Tool/untgz32.exe >.
	Then extract the source with "untgz32 angband-2.9.3.tar.gz".
- Install other required files:
	Get the "extra archive" from
	< ftp://clockwork.dementia.org/angband/Windows/ext-win.zip >.
	Go to the angband directory and unzip the ext-win archive into it.
	Again make sure the directory structure is preserved (use the -d
	option in pkunzip).
	Then get the graphics archive from
	< ftp://clockwork.dementia.org/angband/Extra/angband-graf.zip >
	and unzip it into the lib/xtra/graf/ folder.
- Open the project-file:
	Go to the src-folder and open the file "Angband.dsw".  That opens
	Visual C++ already properly configured for compiling Angband.
- Compile Angband:
	Select "Build Angband.exe" in the Build menu.  Angband should now
	be compiled and the Angband.exe will be placed into the "angband-293"
	directory.
- Run Angband:
	Go back to the Angband-folder and run the Angband.exe.


----------------------------------------------------------------------
Windows 95/98/NT/2000 + Borland C++ 5.5 commandline tools
----------------------------------------------------------------------
(written by Robert Ruehlmann < rr9@angband.org >)

- Getting the free commandline tools:
	Download the Borland commandline tools from
	http://www.borland.com/bcppbuilder/freecompiler/
	and follow the installation instructions.
- Install the Angband source:
	Get the source code and  the untgz tool from:
	< ftp://clockwork.dementia.org/angband/Tool/untgz32.exe >.
	Then extract the source with "untgz32 angband-2.9.3.tar.gz".
- Install other required files:
	Get the "extra archive" from
	< ftp://clockwork.dementia.org/angband/Windows/ext-win.zip >.
	Go to the angband directory and unzip the ext-win archive into it.
	Again make sure the directory structure is preserved (use the -d
	option in pkunzip).
	Then get the graphics archive from
	< ftp://clockwork.dementia.org/angband/Extra/angband-graf.zip >
	and unzip it into the lib/xtra/graf/ folder.
- Compile Angband:
	Open a commandline window and go to the src-directory.  Run
	"make -f makefile.bcc install".  Angband should now be compiled
	and installed into the Angband folder.
- Run Angband:
	Go back to the Angband-folder and run the Angband.exe.

- Possible problems:
	- Make exits with a "Command line too long" error message:
	Try to add the -l option to the make command.  The make util
	should have the "use long command lines" option enabled by
	default, but some people reported that this is not always
	the case.


----------------------------------------------------------------------
Windows 95/98/NT/2000 + Cygwin
----------------------------------------------------------------------
(written by Robert Ruehlmann < rr9@angband.org >)

- Getting the free Cygwin compiler:
	You can find the free Cygwin compiler at:
	< http://sources.redhat.com/cygwin/ >.  It provides a shell
	interface very similiar to a normal Unix/Linux shell with many
	useful tools. Install it and start the shell.
- Install the Angband source code
	Extract the source code with "tar -xvzf angband-2.9.3.tar.gz".
- Install other required files:
	Get the "extra archive" from
	< ftp://clockwork.dementia.org/angband/Windows/ext-win.zip >.
	Go to the angband directory and unzip the ext-win archive into
	it.  Then get the graphics archive from
	< ftp://clockwork.dementia.org/angband/Extra/angband-graf.zip >
	and unzip it into the lib/xtra/graf/ folder.
- Compile Angband:
	Go to the src-directory.  Run "make -f makefile.cyg install".
	Angband should now be compiled and installed into the Angband folder.
- Run Angband:
	Go back to the Angband-folder and run the Angband.exe.



----------------------------------------------------------------------
GNU/Linux or Unix + GCC
----------------------------------------------------------------------
(written by Robert Ruehlmann < rr9@angband.org >)

- Install the Angband source:
	Extract the source code with "tar -xvzf angband-2.9.3.tar.gz".
- Install the graphics files:
	If you want to use graphics under X11 then get the archive from
	< ftp://clockwork.dementia.org/angband/Extra/angband-graf.zip >
	and unzip it into the lib/xtra/graf/ folder.
- Compile Angband:
	Run "./configure", "make", and "make install" in the Angband
	directory.
- Run Angband:
	Start Angband with "angband".

----------------------------------------------------------------------
OS X (versions 10.3.x and later)
----------------------------------------------------------------------
- Install the Angband source:
	Extract the source code with "tar -xvzf unangband-xxx.tar.gz"
- Compile angband
    run "make -f Makefile.osx" in the angband directory.
- Run angband
    Start UnAngband from the finder.


