[AD] dynamically loaded modules for Unix

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


http://www.alphalink.com.au/~tjaden/dev/unixmodules.tar.gz (~10k)

I didn't want to annoy people using mobile phones :-)


Some things:

- `configure' checks for the dlopen interface, and uses it if
possible.  Otherwise, it continues to do the same as it does now
(well, it's supposed to).

- The list of modules to load is read in from a text file called
/usr/local/lib/allegro/modules.lst or /usr/lib/allegro/modules.lst.
Modules have filenames like "alleg-MODULE-3.9.37.so".  Currently the
SVGAlib, ALSA MIDI, ALSA DIGI and ESD DIGI drivers will be built as
modules if possible (they depend on other libraries).  I'll try and
tackle X some other time (or maybe just XDGA2).

- Modules have two special symbols: `_module_init' and
`_module_shutdown'.  `_module_init' is passed the system driver id,
so it can decide if it wants to register drivers, etc.

- I had to change how the digi and midi driver lists worked.
Previously they had dummy drivers at the end of them, but since the
just-added driver list functions add new entries at the _end_ of the
list (I thought that was probably best), the dummy drivers would be
selected instead of more important drivers.  So I took out the dummy
drivers from the lists, and compensated in code.

- The code to build the shared objects is gcc specific.


More things:

- Please test compiling under non-Unix platforms.  I might have
broken something.

- Please try under non-Linux Unices.  I'm pretty sure I've broken
something, but I can't put my finger on it.

- The Windows port can probably use the new driver list functions
instead of malloc'ing stuff itself.  That will make `drvlist.c'
look less silly in `src' instead of `src/misc'.

- Maybe the Windows port can do a similar thing for the DirectInput
5 joystick driver?


Comments?  If not, I'll commit it as is.

-- 
tjaden@xxxxxxxxxx - http://www.alphalink.com.au/~tjaden/
SCHWIGGLE, n.  The amusing rotation of one's bottom while sharpening a
pencil.  -- Rich Hall, "Sniglets"



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/