[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Tue, Jun 11, 2002 at 12:34:16AM +1000, Peter Wang wrote:
> PS. Reading libtool's documentation and some course notes, it seems Unix
> shared library mechanisms vary a lot. I'm specifically worried about
> the above block. Symlinking might not be the normal way things are done
> on a particular Unix. Dunno if it's worth fixing or using libtool.
Actually I think the links are meant to be created by ldconfig,
I don't know whether that didn't work or something, it's too
long ago. :)
FWIW, I looked into libtool before doing the shared library
stuff, but it seemed really hacky and horrible. It's based
around writing standard gcc calls to compile code and make
libraries, and prefixing all the calls with the libtool command
(so the command basically executes its command line). However
libtool then parses all the gcc switches and decides what to do
on the actual platform to get the same effect as the gcc
switches. Yuck! What if it doesn't recognise a gcc switch? So
we should restrict ourselves to the stuff it supports... but
then, it's a really ugly way to get the effect.
Maybe I'm just scared of magic, but I'd much rather have
separate libtool commands to compile, link, make libraries, and
so on, with their own options to control what is going on.
If you do want to try it, I think it shouldn't be too hard to
convert Allegro to use libtool, if you drop the unportable
command line switches (though maybe they do work on gcc, in
which case the current configure machinery can handle it
already). I don't think I'd go anywhere near using libtool to
generate executables; it generates the executable in a
subdirectory and a shell script in the current directory which
you're meant to use to invoke it... The idea is to support
linking against shared libraries that aren't installed yet and
aren't in the LD_LIBRARY_PATH.
The other thing libtool does is it automatically generates both
static and shared libraries (if both are available on the target
platform). This is kind of nice, it's very transparent, but it
makes some of Allegro's configuration redundant. But then if
you don't use libtool to link your executables and don't install
the libraries, you do need to know which it generated (you need
the path to the library).
I find that I'm less dismissing of libtool now than I was at the
time, but it's still not very elegant. Hmm, I wonder if it
supports DLLs though? ;)
George