I've felt nostalgic, so here's a quick and dirty how-to to compile tome 2.3.16 under windows:
From now on, I'll assume MinGW has been installed to the C drive root (meaning there is a c:\MinGW directory with bin, home, lib, etc.. directories)
Install MinGW (C compiler, C++ compiler, basic system, dev kit)
http://sourceforge.net/projects/mingw/f ... e/download
Grab SmartGit: (install/extract somewhere and run)
http://www.syntevo.com/smartgithg/
Clone tome 2.x.x repo
In smartgit: clone repository: git://gitorious.org/tome2/tome2.git
to -say- C:\MinGW\home\tome2
Get CMake (extract to C:\MinGW\home)
http://www.cmake.org/files/v2.8/cmake-2 ... 32-x86.zip
Get Jansson (extract to C:\MinGW\home)
http://www.digip.org/jansson/releases/j ... 2.4.tar.gz
Get pkg-config-lite sources (extract to C:\MinGW\home)
http://sourceforge.net/projects/pkgconfiglite/
http://sourceforge.net/projects/pkgconf ... z/download
From now on I'll omit the version numbers, so instead of jansson-2.4, I'll just write jansson.
Commands to be entered are in
bold
Start the mingw shell (commands to be entered are
bold)
cd /mingw/home
cd jansson
configure
make
make install
copy C:\mingw\home\jansson\.libs\libjansson.a to C:\mingw\lib (use total commander or windows explorer or whatever)
cd..
cd pkg-config-lite
configure
make
make install
cd..
cd tome2
../cmake/bin/cmake.exe -G "MinGW Makefiles"
Open src/config.h
scroll down till you see the "where to put the user's files"-section
And edit it to this: (basically you'll tell tome to store your files in the current directory for windows builds, this could be changed to the user home directory, but hey, this is a quick&dirty fix

)
Code: Select all
#if defined(MACH_O_CARBON)
#define PRIVATE_USER_PATH "~/Library/Application Support/ToME"
#define PRIVATE_USER_PATH_DATA
#define PRIVATE_USER_PATH_MODULES
#elif defined(WIN32)
#define PRIVATE_USER_PATH "."
#else
#define PRIVATE_USER_PATH "~/.tome"
#endif
Open src/modules.c
add the following snippet right after the line saying: #include "angband.h"
(quick&dirty again, as this should come from main-win.c, but hey...)
Code: Select all
#include <sys/stat.h>
bool_ private_check_user_directory(cptr dirpath)
{
struct stat stat_buf;
int ret;
ret = stat(dirpath, &stat_buf);
if (ret == 0)
{
if ((stat_buf.st_mode & S_IFMT) == S_IFDIR) return (TRUE);
return (FALSE);
}
else
{
ret = mkdir(dirpath);
if (ret == -1) return (FALSE);
return (TRUE);
}
}
mingw32-make
cp src/tome.exe .
mkdir 2.3
mkdir 2.3/save
tome.exe
To run tome, you'll need what's in the tome2 folder,
except:
the .git folder
the CMakeFiles folder
the src folder
you can delete everything else (mingw, jansson, cmake, etc...)
Enjoy!