Article View: comp.unix.programmer
Article #3803Re: Shared Library Questions
From: Aaron Crane
Date: Thu, 03 Sep 1998 00:00
Date: Thu, 03 Sep 1998 00:00
71 lines
3603 bytes
3603 bytes
[Added gnu.utils.help and set followups there.]
In article <6sm2vj$fm7$1@bone.globalone.no>,
art@kether.broomstick.com (Arthur Hagen) writes:
> libtool is a script frontend that will set up a makefile that calls
> cc/ld.
Libtool does not set up makefiles. It is a script that encodes knowledge of
how to build libraries for a wide variety of platforms. It can typically be
called thus:
$ libtool cc -g -O -c foo.c
$ libtool cc -g -O -c bar.c
$ libtool cc -g -O -o libfoo.la foo.lo bar.lo -rpath /usr/local/lib -lm
This example is taken almost verbatim from the libtool manual, and it works
fine everywhere Libtool does.
> And for IRIX 6.x and n32/o32, more often than not it will make
> wrong assumptions and make a bad mess out of things.
That's as may be; I have no experience with IRIX. I can say that Libtool
enabled me to write a shared library on one platform (Linux on i386) and
build it with no code changes on several others (FreeBSD on i386, Solaris on
SPARC, and Digital Unix on Alpha).
> All ltconfig/libtool generated makefiles
Again, Libtool does not generate makefiles. It is intended to be something
you can easily bolt on to your existing makefiles -- just change your
pattern rules to include libtool.
> I have seen so far has not managed to pass LDFLAGS, nor handle that n32
> libraries does NOT go in /usr/local/lib on my system.
So change the -rpath option to libtool.
> In addition, using ld for linking is very often a bad idea, unless you
> KNOW what other libraries your dso will be dependant on.
How can a library maintainer *not* know (at build time) what dependencies
that library will have?
> And the libtool setup sure doesn't know.
It does know how to be told.
> Using cc as a frontend for ld will make the linking of your DSO add needed
> libraries.
If Libtool does bad things on IRIX, why not report the problems to the
maintainer? If IRIX needs to use cc for linking shared libraries, then that
should be encoded into Libtool's knowledge of library building. I'm sure
that the maintainer would be happy to work with an IRIX user to improve how
Libtool behaves on that platform.
> So my advice is to avoid libtool, which seems to mostly be a crappy
> tool for and by linux/gnu users who doesn't want to RTFM and set up
> things themselves.
On the contrary, it's for library maintainers who don't want to RTFM on
*every* platform that someone could possibly use to build their library. I
don't have the time or the inclination to learn how to build shared
libraries on the various 4.4BSD-derived platforms, Linux, Digital Unix,
SunOS 4, Solaris, HP/UX, IRIX and AIX; I *do* have the time to learn
Libtool.
Regards.
--
Aaron Crane <aaron.crane@pobox.com> <URL:http://pobox.com/~aaronc/>
Technical Details
Message-ID:
<djsoi944on.fsf@corsair.rmsq.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35ec2492.6983021@news.alt.net> <djemtva7pc.fsf@corsair.rmsq.com> <6sm2vj$fm7$1@bone.globalone.no>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 100159,a6e0720ef5878b84 X-Google-Attributes: gid100159,public X-Google-Thread: 109f73,c9eef090ac628f99,start X-Google-Attributes: gid109f73,public X-Google-Thread: fc89c,a6e0720ef5878b84 X-Google-Attributes: gidfc89c,public From: aaron.crane@pobox.com (Aaron Crane) Subject: Re: Shared Library Questions Date: 1998/09/03 Message-ID: <djsoi944on.fsf@corsair.rmsq.com> X-Deja-AN: 387503065 References: <35ec2492.6983021@news.alt.net> <djemtva7pc.fsf@corsair.rmsq.com> <6sm2vj$fm7$1@bone.globalone.no> Mail-Copies-To: never Followup-To: gnu.utils.help Organization: The Spanish Inquisition. Well, you didn't expect that, did you? Newsgroups: comp.unix.programmer,comp.sys.sgi.misc,gnu.utils.help