
******************************************************************************
   WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING !
******************************************************************************

THIS CODE IS ALPHA AND IT PLAYS WITH HARDWARE RESOURCEN AT VERY LOW LEVEL. A
LOT OF FUNCTIONALITY HAS TO BE IMPROVED AND TESTED, THEREFORE, USING IT COULD
BE SOMETIMES DANGEROUS FOR YOUR SYSTEM. USE IT ON YOUR OWN RISK !!!

******************************************************************************
   WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING !
******************************************************************************



Installing full MLX environment:
================================

0) The most easy und required way to compile and maintain this stuff is to
   have one simple directory, where you put mesa, xc and mlx source trees.
   Set the WORKDIR_3D environment variable to that directory. For example,
   you can take some HD partition with enough space and create working
   directory /local/3d-local/ or take standard /usr/local/ directory as root
   for your graphic stuff. (export WORKDIR_3D='/local/3d-local/' or export
   WORKDIR_3D='/usr/local/')

1) You'll need a complete XFree 3.3.2 or 3.3.3 source tree. Untar it and make
   sure that the XFree root directory is called 'xc' or make a symbolic link;

2) copy your "host.def" to xc/config/cf (you can find one in mlx/misc dir);
   run "make World" in xc
   
3) You'll need a Mesa-3.0 source tree. Untar it in your $WORKDIR_3D and make
   sure that the Mesa root is called 'mesa'. Furthermore, you'll need the ACL
   Device Driver for Mesa-3.0. (also to be found in mlx/misc). Untar it in
   $WORKDIR_3D. You probably have to perform a 'chmod -R +w mesa' before you
   will be able to unter it without errors. Don't compile Mesa yet. The mlx
   source tree must also be called 'mlx' - rename it so or make symbolic link.

   Example:

   sim@Elvis:/local/3d-local > export WORKDIR_3D=/local/3d-local
   sim@Elvis:/local/3d-local > ls -ld mesa xc mlx
   lrwxrwxrwx   1 sim      suse            9 Aug 32 17:38 mesa -> Mesa-3.0/
   lrwxrwxrwx   1 sim      suse            4 Sep 31 23:47 xc -> xc-3
   lrwxrwxrwx   1 sim      suse            4 Sep 31 23:47 mlx->mlx.libc5


4) Switch to mlx directory and run "make World"

5) Switch to superuser; update the XF86Config with the one from the mlx/misc
   If you have crapy monitor, please check modelines section, or calculate
   your own modelines. IMPORTANT: the option "no_accel" is required !!!

6) Make symbolic link /usr/local/mlx --> $WORKDIR_3D/mlx, if you haven't
   already installed mlx there. This is needed because Mesa assumes that mlx
   is installed in /usr/local/ directory.

7) Go to mlx/kernel and load kernel module with ./ldm

8) Superuser is not required anymore, except if you wish to play with DGA

9) Export LD_LIBRARY_PATH=$WORKDIR_3D/mesa/lib:$WORKDIR_3D/mlx/lib

10) Run "make linux-386-acl" in mesa directory

11) Start X server (32, 16 and 15 bpp are supported)



Installing MLX environment without X source tree:
=================================================

0) If you don't want to bother with X source tree, you'll need MLX with
   precompiled X driver archives. They are stored in x/unshared directory.

1) Perform steps 0) and 3) from above section

2) Switch to mlx directory and run 'make mlx-all'. To delete whole MLX stuff,
   you can use 'make clean-all'

3) Folow steps 5) - 11) from above section.

4) The make targets 'World', 'CleanWorld' and 'x*' should not be used.



Makefile rules:
===============

For quick start after unpacking files, you should perform 'make World'. After
that, further compiling can be done with simple 'make' (in the most cases). To
remove everything generated, run 'make CleanWorld'

If you want to build static MLX library, update symbol MLX_LIBBUILD with target
token 'mlxlib-a' in Makefile. Default is 'mlxlib-so' (dynamic MLX library).


 Folowing targets affect only MLX library files:
 ***********************************************

 - Simple 'make' builds MLX object files, packs them into archives and links
   those archives into shared or static MLX library. The X driver archive (.a)
   files should be already created and stored in x/unshared

 - init:
 	Touches dependencies files for MLX sources.

 - mlx:
 	Builds MLX object files and packs them into archives. It doesn't
	build MLX library file.

 - dep:
 	Touches and creates dependencies for MLX sources. Without dependencies
	files, nothing works. Missing include files, needed for makedepend,
	are automaticly created.

 - clean:
 	Deletes MLX objects, archives and generated include files 

 - clean-all:
 	Like 'clean', but removes also MLX library files and dependencies

 - inc:
 	Builds missing include files which are generated by few scripts.

 - mlx-all:
 	Builds everything needed for MLX. The X driver archive (.a) files
	should be already created and stored in x/unshared. See Makefile for
	more info.


 Targets below affect only X driver files:
 *****************************************

 - xinit:
 	Bootstraps X driver Makefile and creates other Makefiles needed to
	compile X driver sources.

 - xdep:
 	Creates X driver source-links and dependencies.

 - xclean:
 	Deletes completely X driver source-links and objects.

 - xclean-all:
 	Like xclean, but also removes archives and x/unshared directory.
 
 - xdriver:
 	Builds X driver object files and packs them into archives which get
	stored into X/unshared.


 Global targets (MLX library and X driver files affected):
 *********************************************************

 - World:
 	Builds everything. See Makefile for more information.

 - CleanWorld:
 	Cleans everything.



ACL Mesa Device Driver:
=======================

The folowing environment variables could be used to config ACL DD:

- ACL_MESA_HW:
	sets the rendering hardware. Currently supported: 'PM2'

- ACL_MESA_VIDMODE:
	0/1 - enables switching to the best resolutions. This depends on
	modelines you have in your XF86Config.

- ACL_MESA_DGA:
	0/1 - enables usage of the DGA extension (superuser required) The
	mouse doesn't work properly when using it, but you can save your
	screen layout when playing with the MLX toy.

- ACL_MESA_QUAKE:
	0/1 - switches the Quake hack off/on. Quake and our library have
	some problems with alpha-blending, because PM2 doesn't support all 
	alpha-blending operations.

- ACL_MESA_FULL:
	0 - rendering into window (not implemented yet)
	1 - Screen Offset double buffering
	2 - Bit Blit double buffering
	3 - Color Depth double buffering (not implemented yet)

