Compiling UOX3 on POSIX systems - Updated Feb 16, 2006

Want to discuss changes to the UOX3 source code? Got a code-snippet you'd like to post? Anything related to coding/programming goes here!
Post Reply
Fish
UOX3 Newbie
Posts: 14
Joined: Sun Feb 20, 2005 8:42 pm
Has thanked: 0
Been thanked: 0

Compiling UOX3 on POSIX systems - Updated Feb 16, 2006

Post by Fish »

Here is a guide to help users compiling UOX3 on POSIX systems.

I successfully compiled the current CVS version of UOX3 under Mac OS X 10.4 with GCC 4.0.0. It probably works under others systems like FreeBSD, OpenBSD, NetBSD, GNU/Linux, Solaris...

You have to know that if we successed to compile UOX3 on POSIX systems, no one have successed to run it correctly.
Currently, UOX3 crashes at startup because of console and mul file support problems.

1 - Download UOX3, missing configure.in and JavaScript

Code: Select all

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openuo login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openuo co -P projects/uox3/source

cd projects

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/uox3 login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/uox3 co -P uox3/source/configure.in

cd uox3/source

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot login
cvs -z3 -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -P mozilla/js/src
2 - Correct some errors in the code

In uoxlinux.h, replace:

Code: Select all

#include <malloc>
By:

Code: Select all

#include <stdlib>
In Makefile.in, replace:

Code: Select all

uox3_LDADD = @UOX3_LIBS@
By:

Code: Select all

uox3_LDADD = js32.a
In cConsole.cpp, replace:

Code: Select all

CConsole& CConsole::operator<<( const size_t &outPut )
{
	if( CanPrint( currentMode, currentLevel ) )
	{
		StartOfLineCheck();
		std::cout << static_cast<UI32>(outPut);
	}
	return (*this);
}
By:

Code: Select all

//CConsole& CConsole::operator<<( const size_t &outPut )
//{
//	if( CanPrint( currentMode, currentLevel ) )
//	{
//		StartOfLineCheck();
//		std::cout << static_cast<UI32>(outPut);
//	}
//	return (*this);
//}
In cConsole.h, replace:

Code: Select all

CConsole& operator<<( const size_t &outPut );
By:

Code: Select all

//CConsole& operator<<const>name.c_str(), playerName, strlen( origLevel->name.c_str() ) ) )
By:

Code: Select all

#if UOX_PLATFORM == PLATFORM_WIN32
	if( !_strnicmp( origLevel->name.c_str(), playerName, strlen( origLevel->name.c_str() ) ) )
#else
	if( !strnicmp( origLevel->name.c_str(), playerName, strlen( origLevel->name.c_str() ) ) )
#endif
3 - Prepare the installation with autotools

Code: Select all

touch README
touch NEWS
touch AUTHORS
aclocal
automake --add-missing --copy
autoconf
automake
4 - Compile JavaScript

Code: Select all

cd mozilla/js/src
gcc -o jscpucfg jscpucfg.c ; ./jscpucfg >  jsautocfg.h
gcc -g -c -DXP_UNIX *.c ; ar -r js32.a *.o
cp js32.a ../../../
cd ../../../
5 - Configure and make

Code: Select all

./configure
make
Post Reply