handling complex link/library specifications

In the process of creating a Python module for a commercial package, I have built a Distutils package for it (using Distutils-0.8.2). Unfortunately, the commercial package I'm dealing with has a long list of libraries required to be linked, with several specified static and the rest dynamic. The recommended library spec (for Solaris, which is what I'm working with at the moment) looks something like this: -l<lib> ... -l<lib> -Bstatic -l<lib>... -l<lib> -Bdynamic -l<lib>...-l<lib> -R<path> My setup.py (built from the distutils template) has all the libraries listed in a 'libraries' record against the module, and things appear to link OK as is though I'm still chasing down a couple of things which might turn out to be related to the static/dynamic stuff above. I tried looking in the documentation, but the bits that might answer my question haven't been written yet :-( What would be the recommended way to deal with this, if Distutils in its current form can handle this situation? (BTW http://www.python.org/sigs/distutils-sig/doc/dist/source-dist.html has an HTML problem, at least with IE 3.02) ------------------------------------------------------------- Andrew MacIntyre \ andrew.macintyre@aba.gov.au Planning & Licensing Branch \ Tel: +61 2 6256 2812 Australian Broadcasting Authority \ Fax: +61 2 6253 3277

On Wed, May 24, 2000 at 02:28:36PM +0000, Andrew MacIntyre wrote:
Unfortunately, the commercial package I'm dealing with has a long list of libraries required to be linked, with several specified static and the rest dynamic.
The recommended library spec (for Solaris, which is what I'm working with at the moment) looks something like this:
-l<lib> ... -l<lib> -Bstatic -l<lib>... -l<lib> -Bdynamic -l<lib>...-l<lib> -R<path>
What would be the recommended way to deal with this, if Distutils in its current form can handle this situation?
The CVS version (I think you have to get it from SourceForge) should except the CFLAGS environment variable, I don't know if this will help you or not. -- Harry Henry Gebel, Senior Developer, Landon House SBS West Dover Hundred, Delaware

On 24 May 2000, Andrew MacIntyre said:
The recommended library spec (for Solaris, which is what I'm working with at the moment) looks something like this:
-l<lib> ... -l<lib> -Bstatic -l<lib>... -l<lib> -Bdynamic -l<lib>...-l<lib> -R<path>
Wow, same question twice in one day. Time to work on the docs again. You should be able to do this with an 'extra_link_args' entry in the "build info" dictionary that describes your extension. *rummage rummage rummage* Ahh, here's the example I sent to someone else not 'alf an 'our ago (I knew I should have cc'd the sig): ext_modules = [('_imaging', { 'sources': ['_imaging.c', 'decode.c', ... , 'path.c'] 'include_dirs': ['libImaging'], 'library_dirs': ['libImaging'], 'libraries': ['Imaging'], 'extra_link_args': ['-lX11', '-lXext', '-lXshm'], 'extra_compile_args': ['-Dfoo=bar', '-Ublah'] } )] 'extra_compile_args' is only in the current CVS code, but 'extra_link_args' has been around for a while. BTW, the requirement in the above example was to worm output from a configure script and from gtk-config into the compiler/linker commands. Obviously portability is thrown out the window, but in return you have a working setup script.
(BTW http://www.python.org/sigs/distutils-sig/doc/dist/source-dist.html has an HTML problem, at least with IE 3.02)
Hmm, based on my (indirect) experience with IE 3, I'd be more inclined to say *it's* the one with an HTML problem... *smirk* Greg -- Greg Ward - Unix geek gward@python.net http://starship.python.net/~gward/ I wonder if I ought to tell them about my PREVIOUS LIFE as a COMPLETE STRANGER?
participants (3)
-
andrew.macintyre@aba.gov.au
-
Greg Ward
-
Harry Henry Gebel