 	/====================================\
 	|                                    |
	|  A quick guide to compile MobiNet  |
	|                                    |
	\====================================/

================
1 ) REQUIREMENTS
================
 
To compile MobiNet, you need the following to be already installed on your
computer:

- Qt 3 development package
	see TrollTech' website: <http://www.trolltech.com/download/>

- SDL and SDL_net development package
	see <http://www.libsdl.org/download-1.2.php>
        and <http://www.libsdl.org/projects/SDL_net/>
	ALTERNATIVELY, use the four appropriate RPM in the lib/ directory.

- libQGLViewer
	see <http://artis.imag.fr/Software/QGLViewer/>
	ALTERNATIVELY, use the appropriate RPM in the lib/ directory
	(use the gcc2 or gcc3 version depending of your compiler.
         With gcc, you can check the version by typing "gcc -v").

- libxml2 development package
	see <http://xmlsoft.org/downloads.html>
        ALTERNATIVELY, use the two appropriate RPM in the lib/ directory.

- libjpeg development package
	see <http://freshmeat.net/projects/libjpeg/>

- libantlr ( >= 2.7.2 )
	see <http://www.antlr.org/download>
	ALTERNATIVELY, use the tar.gz in the lib/ directory.

- If you want to add functionalities to the MobiNet language you will need the
  whole ANTLR distribution, including the development stuff.
         See <http://www.antlr.org>
         NB: the antlr.tar.gz provided in lib/ contains everything.

===============
2 ) COMPILATION
===============

Once you have installed the libraries above,

- edit the file 'mobile.pri' (with an "i" at the end) to indicate
  the paths were these libs are installed.

- then type:
    qmake
    make

===================
3 ) RUNNING MobiNet
===================

For a simple stand-alone session, type:
  ./mobinet

For a collaborative session using several computers (local or distant):
- Launch the server on your favorite machine with:
    ./mobinet

- *then* launch the clients on the other computers with:
    ./mobinet [-help] [-nosave] -client <host> [<port>]

  replace <host> by the IP address or the name of the machine on which
  the MobiNet server runs.
  <port> is 6333 by default. You must change it for clients that would
  run on the same machine than the server, or if a firewall doesn't like it.

  -nosave disable the 'save' buttons (useful when clients are
   run by students on your own account :^) )

======================================
4 ) HOW TO MODIFY THE MobiNet LANGUAGE
======================================

- To add functionalities to the language used in MobiNet, you must edit

src/calc.g

You ALSO NEED to have Java installed on your computer.
The CLASSPATH environment variable must contained

	/...path.../...to.../antlr.jar

Once you are happy with your new src/calc.g, type:

cd mobinet/
rm src/Makefile
qmake HANDLE_GRAMMAR=1  # do this only once.
make
make

From now on, 'make' will automatically handle modifications to calc.g,
using ANTLR to regenerate files Calc*.*

- If you want 'make' to forget about calc.g modifications
(e.g. if you finally discovered that you don't have Java :^) ),
simply type:

cd mobinet/
rm src/Makefile
qmake                   # do this only once.

- If you want to debug (at the expense of performances), use
qmake HANDLE_GRAMMAR=1 DEBUG=1

Before compiling the final version, don't forget to do a make clean
in order to apply optimization on all files !
You might also strip the resulting executable to save space.

Please check the README and LICENCE files before considering
distributing your modified version.
