-----------------------NOTICE------------------------

IF YOU WANT TO PLAY MB THIS IS NOT THE CVS CHECKOUT YOU WANT.

Please checkout the Molecular Blue branch with the following cvs command:
cvs -d :pserver:anonymous:@cvs.sourceforge.net:/cvsroot/planeshift co -P -A -rMB planeshift


This is the development branch of Planeshift.
It may not compile at all.
It may not run with the map or art that is publicly available.
It WILL NOT run on the public server.

 After you have downloaded the proper revision with the above or a similar command,
read the docs/Compiling.txt retrieved from that revision for instructions.

 Thank you and have a nice day! :)

-----------------------NOTICE------------------------






























Here is the content divided in chapters:
# Visual C++
# Unix
# MySQL setup
# Other Platforms
# libCURL setup for the Updater client.


-------------------------------------------------------------------------------
(1) Visual C++        (last update: 6/17/02, Keith Fulton)

This document tells you on how to compile CVS version of Planeshift with Visual
C++ 6.0 under Windows

Here are requirements for compiling Planeshift:
* Newest CVS version of Crystal space. (http://crystal.sourceforge.net)
* Newest CVS version of Crystal Entity Layer. (http://cel.sourceforge.net)
* Visual C++ 6.0 or 7.0
* DirectX 3 and up SDK (http://www.microsoft.com/directx)
  NOTE:
  Make sure that Visual C++ can see the SDK of DirectX 3+. It will give
  out error messages if it's not properly configured. I suggest to copy all
  lib and h files of DirectX to the libraries and headers folders of Visual
  C++. There should already be DirectX version 5.0 in Visual C++ 6.0.
* Newest CVS version of Planeshift
* Windows library files. You can find them here:
  For MSVC 6:
    ftp://ftp.sunsite.dk/projects/crystal/support/win32/msvc_libs_0.97dev004.zip
    http://www.philipwyett.dsl.pipex.com/cs/msvc_libs_0.97dev004.zip
  For MSVC 7 (.NET):
    ftp://ftp.sunsite.dk/projects/crystal/support/win32/msvc7/msvc7_libs_0.97dev004.zip
    http://www.philipwyett.dsl.pipex.com/cs/msvc7_libs_0.97dev004.zip

  Extract all files to the CS root directory, and the unzip will take care
  of putting everything in the right place.

How to configure Planeshift:
* Make sure Planeshift, CEL and Crystal Space (CS) are children of the same directory.
  For example: Projects
                  |
                  -- CS
                  |
                  -- cel
                  |
                  -- Planeshift

* Build CS.  Use the csall.dsw file in the mk/visualc directory to launch your Msvc.
  Make "grpall" your active project and click the Build button.  It will take approximately
  30-45 mins to build everything for CS. Also, if you run into errors related to python,
  or ogg, or something like that, right-click that project in your workspace and select
  "Unload Project".  This will keep it from being built.  There are about 3 or 4 projects
  which may need to be unloaded.
* Build CEL.  Use the cel.dsw file in the main cel directory, highlight all the projects,
  right-click and select "Build".
* Edit your Autoexec.bat file, to include both your CS directory and your CEL directory
  in your path.  They should be fairly early in your path to prevent conflicting zlib.dll
  problems.  You will also need to set the environment variable CRYSTAL= to your
  full CS path.  Reboot after you do this.  You cannot run any CS or CEL demo apps until
  you have rebooted.
* Build Planeshift.  Use the psall.dsw file in mk/visualc, right click on the psall
  project and select "Build".
* If you want to run the program in debug modemake sure that the planeshift
  directory entry is in the project workspace. You can make sure by going to
  project->settings(alt-f7) then under debug tab, there should be Working
  Directory field. Enter the planeshift directory there and you should be good to go.
* Install MySQL database engine, and set up Planeshift database for the server to use.
  Mysql can be found at www.mysql.com.  You want the "latest stable release", not the
  4.0 beta.  While you are on that website, find, download and install a tool called
  "mysqlfront".  It is a very nice gui front end for Mysql.  Run mysqlfront, create a
  database called "planeshift", with a userid and password of "planeshift" and 
  "planeshift".  Then you will need to run the "create_all.sql" script to create and
  fill in all the required tables and data.

FAQ (just in case u got error messages)
Q: Visual C++ spew out errors when it was compiling the CS. What's wrong?
A: Often times the CVS version of CS is broken. So, if this happen, then just
   wait until they fix it. It shouldnt be long =).

Q: Errors about not able to find LPDIRECTDRAW stuff
A: That's DirectX problem. Make sure Visual C++ can see DirectX lib and h files.

Q: Where do I find zlib.h and what is it for?
A: You need to get the msvc_libs support package. See the section above 
   (Windows library files. You can find them here:).  The zlib stuff is the
   library and header files for zip compression. 

Q: I get fatal error C1083: Cannot open include file: 'Python.h': No such
   file or directory".  What should I do?

A: Currently Planeshift does not use python scripts, so at this point you can
   safely exclude compiling those files.  Right click on the "plgcspython" file
   group and choose unload from the menu.  This will exclude these files from the
   build. 

Q: There are other plugins that fail to build. What do I do?
A: There are also a couple of plugin's that might fail comilation.  You
   can also saftly remove "plgpgserver" which is a small GUI for text based
   games.  And "plgsprcal3d" is for a skeleton mesh system that will be used in
   PlaneShift eventually.

Q: I get a fatal error C2248: 'ptr' : cannot access private member declared in
   class 'csList<struct CmdSubscription *>::Iterator' what do I do?

A: This is a bug in the way that the MSVC 6.0 compiler engine handles
   templates.  You need to make the pointer public in the
   CS/include/csutil/list.h file. You do not need to rebuild CS for this. Just
   make sure you save that file and then compile PS again.


Q: Other errors
A: email me at keith@paqrat.com

-------------------------------------------------------------------------------
(2) Unix			(last change 04.01.2002)
	***Python***
	Python is optional yet, but will be used in the future. So it's a good
	idea to install python. (just look for a python and python-devel
	package in your distribution or go to www.python.org)

	***Cal3D***
	You will need to obtain cal3D for skeletal animations.
	Here is the directions according to its sourceforge page http://sourceforge.net/cvs/?group_id=26281
		cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/cal3d login

		Press Enter when prompted for a password then

		cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/cal3d co cal3d

		cd cal3d
			./configure
			make
			su (or make yourself root)
			make install

			*Note I had a problem with the sprcal3d plugin from crystal space,
			*not finding libcal3d after compile, thereby causing
			*a segfault, these instructions should be used in that case

			*You will then need to
			 edit /etc/ld.so.conf (you will have to be root to do this)
			*and add the following line to the TOP of the file
			/usr/local/lib

			(or if you used --prefix=/whereever then use that directory)
			*Then exit your editor and run

			ldconfig
			*Now quit playing root, it's dangerous :)
			exit

	***Crystal Space***
	go out and grab the latest CVS version of CS and build it.
	Instructions of how to do it can be found at crystal.linuxgames.com
	for me it is:
		export CVSROOT=":pserver:anonymous@cvs.crystal.sourceforge.net:/cvsroot/crystal"
		cvs -z3 co CS
		cd CS
                ./configure --enable-debug	
		make -k all


	You should have a compiled Crystal Space now if you want you can do 
	"make install" as root in order to install the CS libs, but it is also
	possible to use CS just out of the dir you build it. If you don't want
        to install Crystal Space then you should use the command:
        	./configure --prefix=/the/path/to/CS.

	For me I run configure like:
            $ ./configure --prefix=/home/andrew/development/CS --enable-debug

		
	You should now set the CRYSTAL environment variable to let CS
	applications, where they can find plugins and configuration files.
	for example (if you compiled CS in your home directory):
	    export CRYSTAL=$HOME/CS

	To make you life easier you should automate the setting of this
	variable. I recommend putting this command in your .bashrc file
	(in your home directory), so that it is called each time you log in.

	***JAM***
	CEL and Planeshift are using jam for building. Unfortunately the
	current version (2.4) still contains some bugs which are reported and
	should be fixed in jam 2.5. For now just grab the psjam release:
		http://planeshift.sourceforge.net/psjam-2.5rc2.tar.gz

	and compile and install it:
		tar -xzvf psjam-2.5rc2.tar.gz
		cd psjam-2.5rc2
		make
		su             # then type your root password
		jam install
		exit
		
	
        ***CEL***
	go out and grab the latest CVS version of CEL and build it.
	for me it is:
		export CVSROOT=":pserver:anonymous@cvs.cel.sourceforge.net:/cvsroot/cel"
		cvs -z3 co cel
		cd cel
		./configure
		jam

	cel needs some environment variables too (CS team is working at a
	solution, to avoid all these vars but at the moment you have to set
	all these) So for example (if you compile cel in your home directory):
		export CEL=$HOME/cel
	the cs-config script has to be told where to find the cel.cex file,
	this means yet another variable:
		export CSCONFPATH=$CEL

	I recommend again putting these 2 commands into your .bashrc file.

	***Planeshift Makefiles***
	Requirements:
	-A working autoconf/automake (I'm using latest versions of these 2
	    tools, if you hit problems try updating them to newer versions)
	-libtool
	-a pthread lib (I think every unix has one by default)
        -for the updater software you will need the libcurl development 
         packages. Can be found at: http://curl.haxx.se/libcurl/

	Instructions:
        So at first you have to generate the configure scripts.
	If you have everything, you can just run
	   	./autogen.sh	   	
	if this succeeds you can type
		./configure
	if this succeeds you can type		
	    	jam
	    
	(and finally pray that everything wents fine ;-)
	
FAQ:
Q: There isn't a configure script
A: You have to create one, see above

Q: There is a line telling me that it can't find the configuration file
   /this/psclient.cfg or /this/psserver.cfg. After that the client exits
   or crashes.
A: The working directory while starting the client has to be the top dir of 
   the Source files... so change to that dir and start the client from there,
   I've made the 2 scripts "psclient" and "psserver" that do this for you.

Q: I compiled CS and it's working, but the configure script tells me it can't
   find it.
A: You probably didn't set your CRYSTAL env var or you didn't build the
   cs-config script in CS. So do export CRYSTAL="your/path/to/CS" or 
   make csconfig in CS dir.

Q: There are autoconf/automake errors
A: Try to remove all automake/autoconf files with
	make -f mk/unix/Makefile.autoconf clean
   and regenerate them. If this doesn't help try upgrading them to newer
   versions, and finally there could be bugs in our scripts

Q: I've got other questions
A: Write a mail to acraig@paqrat.com perhaps I can help.

--------------------------------------------------------------------------------
(3) Other platforms

planeshift compiles and runs on cygwin and mingw too. Although I didn't find
time yet to describe all steps needed to do so. I'll just put some notes here:

Cygwin:
    * Compiling on cygwin should work like compiling on linux theoretically. However noone actively uses this port at the moment so it is possible that some things are broken. Please report problems to us!

Mingw:
    * you need a bash for mingw (grab the latest CS_mingw package, it should
      contain one)
    * makefiles are in mk/mingw, so type "make -f mk/mingw/mingw.mak"

FAQ:
Q: It doesn't work - I have more questions
A: Feel free to mail the "planeshift-engine@lists.sourceforge.net" list.

--------------------------------------------------------------------------------
(4) MySQL Setup

* Download latest stable release from www.mysql.org, currently it is 3.23
* Install it on default path
* Be sure to have the mysql/bin dir in your path setting
* From a shell run "mysqld --user=mysql", this starts the mysql server.
* From another shell, run "mysql"
* On mysql prompt type "create database planeshift;"
* Exit from mysql with "exit"
* Go to the planeshift dir, navigate to planeshift\src\server\database\mysql
  and run "mysql < create_all.sql". This wil populate your db
* From a shell, run "mysql --user=root" again
* On mysql prompt type "GRANT ALL PRIVILEGES ON *.* TO planeshift@localhost
  IDENTIFIED BY 'planeshift' WITH GRANT OPTION;". This will create the
  planeshift db user.

--------------------------------------------------------------------------------
(5) libCURL setup for the Updater client

* Download the latest stable release from http://curl.haxx.se/, minimum version is 7.7.2
  [Unix]: Automake will skip the updater build if it does not find a valid libCURL.
* Compile following instructions included in libCURL source
* [Unix]: Install libCURL in the default directory
  [Windows]: Add libCURL library and headers path to Visual C++ configuration
* Compile the Updater client
* [Windows]: You will need libcurl.dll and zlib.dll in the same directory as the
             updater executable or in a dll search path.
  [Common]: updater.xml must be in the same directory as the updater executable
            to be able to run it. See updater.txt for syntax of this file.

