Re: [xml] Generating a correct xml2-config for use with --libs



THIS IS SOLARIS AND DYNAMIC LINKING SPECIFIC

Once again, you DON'T need to list library dependencies on Solaris, just because libxml2 is dependant on a library when you are doing dynamic linking.

So, it isn't a bad idea for the reason you gave. It may be a bad idea for other reasons.

Your description of "*the same* Makefiles on all platforms" is a fantasy anyway, since there is no way that this can be true for anything but the simplest of applications. In fact, by listing unrequired dependancines on Solaris to libraries that your application does not depend on, your makefile is (in some sense) incorrect.

Let me be clear, you should only link your application with -lsocket if your application needs access to a member of libsocket. Otherwise you are creating a completely unneccessary dependancy on a library that your application doesn't directly depend on.

You are approaching this problem the wrong way round. If your application doesn't use a library, it should explicitly link to it.

Gary

Aleksey Sanin wrote:

As one of Solaris users for LibXML I would strongly disagree with this idea. I would like to have *the same* Makefiles on all platforms and I do not see reasons
why I need to add -lsocket for Solaris manually.
If your application does not use threads or networking you may configure/compile LibXMLby yourself and use --without-http, --without-ftp, etc. flags to remove these dependencies. In case you use *shared* library compiled for general use you would probably want to use linker that can trace dependencies and ignore
libraries not actually used.

Aleksey


I'm also apologizing for generating so much noise over such a small thing.

I hadn't realised that it wasn't clear that I was referring only to dynamic linking. (Actually, I hadn't even considered that anyone would bother with static linking in this day and age.)

I'll consider making this a Solaris specific patch as Daniel suggests.

Gary








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]