[Distutils] handling complex link/library specifications

andrew.macintyre@aba.gov.au andrew.macintyre@aba.gov.au
Thu, 25 May 2000 15:38:59 AES


scratch the <ever hopeful>...</ever hopeful> bit, I've found an incantation
(library directory) that allows the 'extra_link_args' option to do all I need
to do.

Many thanks!

-------------------------------------------------------------
Andrew MacIntyre                \ andrew.macintyre@aba.gov.au
Planning & Licensing Branch      \ Tel: +61 2 6256 2812
Australian Broadcasting Authority \ Fax: +61 2 6253 3277
---------- Original Text ----------

From: Andrew MacIntyre <andrew.macintyre@aba.gov.au>, on 25/05/00 14:08:

'extra_link_args' looks just what I'm after, especially for the "-R<path>"
option.  Platform portability isn't important to me (yet!) with this particular

 project.

The static/dynamic bits appear to have wrinkles at the compiler/linker level:-
when used with "cc" as the linker it works, but it doesn't work with "ld" :-( 
At least things work without those toggles, albeit with administrative
side-effects.

<ever hopeful>
There wouldn't be a convenient way to override the linker command ("ld -G" on
Solaris, from the Python Makefile) would there?
</ever hopeful>

I have to say that Distutils, from my experience with it so far, has been easy
to work with.
Apart from my questions here, all my problems with this project have been with
the commercial library I'm wrapping.  Many thanks for the fine work!

-------------------------------------------------------------
Andrew MacIntyre                \ andrew.macintyre@aba.gov.au
Planning & Licensing Branch      \ Tel: +61 2 6256 2812
Australian Broadcasting Authority \ Fax: +61 2 6253 3277
---------- Original Text ----------

From: Greg Ward <gward@python.net>, on 25/05/00 12:33:

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?

_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://www.python.org/mailman/listinfo/distutils-sig


_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://www.python.org/mailman/listinfo/distutils-sig