mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-02-17 15:10:02 +08:00
74 lines
3.3 KiB
Plaintext
74 lines
3.3 KiB
Plaintext
|
This file is intended to contain hints on how to port libtool to new
|
||
|
platforms. It is currently waiting for your contributions :-)
|
||
|
|
||
|
|
||
|
General Instructions
|
||
|
--------------------
|
||
|
|
||
|
In order to port libtool to a new platform, start by searching for
|
||
|
PORTME in ltconfig.in. Look for the string `Libtool was configured as
|
||
|
follows'; that's the beginning of the platform-dependent configuration
|
||
|
portion that will be inserted in the libtool script. Most of the
|
||
|
documentation about the variables you may have to set in your port is
|
||
|
there. Feel free (and compelled :-) to submit patches for this
|
||
|
(PORTING) file, so that it complements the documentation within the
|
||
|
script.
|
||
|
|
||
|
|
||
|
Inter-library Dependencies
|
||
|
--------------------------
|
||
|
|
||
|
libtool 1.2c has re-introduced the ability to do inter-library
|
||
|
dependency on some platforms, thanks to a patch by Toshio Kuratomi
|
||
|
<badger@prtr-13.ucsc.edu>. Here's a shortened version of the message
|
||
|
that contained his patch:
|
||
|
|
||
|
The basic architecture is this: in ltconfig.in, the person who writes
|
||
|
libtool makes sure $deplibs is included in $archive_cmds somewhere and
|
||
|
also sets the $check_shared_deplibs_method.
|
||
|
check_shared_deplibs_method can be any of five things:
|
||
|
test_compile
|
||
|
file_regex
|
||
|
file_magic [regex]
|
||
|
pass_all
|
||
|
none
|
||
|
|
||
|
I think that file_magic works the best: It looks in the library link
|
||
|
path for libraries that have the right libname. Then it runs file on
|
||
|
the library and checks for a match against [regex] using expr. I
|
||
|
currently have linux-elf looking for the string: "ELF 32-bit LSB
|
||
|
shared object" which seems to work well. (I don't know whether the
|
||
|
"32-bit" would have to change on linux-alpha though.... change to
|
||
|
'ELF [0-9]+-bit LSB shared object' might work. I don't know.)
|
||
|
|
||
|
file_regex will look for a filename in the link path. It doesn't take
|
||
|
an argument because I use the libname_spec and library_names_spec
|
||
|
variables to create the string to look for. I don't like it because
|
||
|
symlinks and random files can make it give false positives.
|
||
|
|
||
|
test_compile handles -L correctly, I hope. It also takes the names of
|
||
|
it's libraries from libname_spec instead of a hardcoded lib`expr
|
||
|
$a_deplib : '-l/(.*/)'`.so line.
|
||
|
|
||
|
pass_all will pass everything without any checking. I put it in
|
||
|
because osf3&4 appear to be treated that way right now... It might be
|
||
|
wise to perform checks here to see if the libraries exist on the
|
||
|
system, but I don't know how osf3&4 handle that, so I thought it would
|
||
|
be better just to do it the way the current code does.
|
||
|
|
||
|
none is the default for all systems unless overridden in ltconfig.in
|
||
|
(Currently, linux-elf is the only system that overrides.) It causes
|
||
|
deplibs to be reassigned deplibs="". That way archive_cmds can
|
||
|
contain deplibs on all platforms, but not have deplibs used unless
|
||
|
needed.
|
||
|
|
||
|
Okay:: Then in ltmain.in we have the real workhorse: a litle
|
||
|
initialization and postprocessing (to setup/release variables for use
|
||
|
with eval echo libname_spec etc.) and a case statement that decides
|
||
|
which method is being used. This is the real code... I wish I could
|
||
|
condense it a little more, but I don't think I can without function
|
||
|
calls. I've mostly optimized it (moved things out of loops, etc) but
|
||
|
there is probably some fat left. I thought I should stop while I was
|
||
|
ahead, work on whatever bugs you discover, etc before thinking about
|
||
|
more than obvious optimizations.
|