Index: [thread] [date] [subject] [author]
  From: becka@rz.uni-duesseldorf.de
  To  : Bryan Patrick Coleman <bpcolema@uncg.edu>
  Date: Tue, 6 Apr 1999 23:13:18 +0200 (MEST)

Re: svgalib-target useless?

Hi !

> >Usually you do not install the SVGAlib wrapper, if you have a working
> >SVGAlib. 
> >If you want a dual setup, it might be a good (untested) idea, to _not_
> >install the SVGAlib wrapper, and LD_PRELOAD it, if you want to use it.
> >The idea is to copy the libvga*.*.ggi to /somewhere and then use
> >LD_PRELOAD="/somewhere/libvga.so:/somewhere/libvgagl.so" ./svgalib_prog
> >if you want to use the wrapper.

> I find this a bit odd myself. Since one of the benifits of using the
> wrapper is to run svga apps under other enviroments but then you cant run
> it under svga any more? It also seems to keep any of the demos from
> running under svga.

Yes. The problem is more or less one of how dynamic linking works.

The point is, that even if we did an install (which is possible, though
a bit weird) that allows to go

svgalib_wrapper -> libggi -> svgalib-target -> original_svgalib

to get some kind of "smooth" transition, the problem with that setup is,
that the extra levels of indirection it adds are no good, not only
speed-wise, but also loss-of-functionality-wise.

IMHO the only good solution is LD_PRELOAD to select the "other" SVGAlib
on demand.

For those who want that (i.e. they have a working SVGAlib), I'd suggest
to

1) Leave the old SVGAlib installed.
2) Install the SVGAlib wrapper from GGI somewhere, where it doesn't
interfere, like /usr/local/lib/svgawrapper/lib*...
3) Make a small batch file "wrapvga" that just does:
--snip--
#!/bin/sh
LD_PRELOAD="/usr/local/lib/svgawrapper/libvga.so:
	/usr/local/lib/svgawrapper/libvgagl.so" exec $*
--snap--

Untested but should work...

Oh - just noticed ... IIRC LD_* is ignored for suid binaries ... got to run
them as root ... well, that's life ...

CU, Andy

P.S.: The "smooth" install I mentioned above can be done by installing the 
"real" SVGAlib as say libsvga* (instead of libvga) and then changing the
Makefile of the SVGAlib target to do -lsvga. Again untested but should work.

-- 
= Andreas Beck                    |  Email :  <andreas.beck@ggi-project.org> =

Index: [thread] [date] [subject] [author]