Problem with linking embedding C application

Olivier Deme odeme at airtel-atn.com
Mon Oct 1 09:05:44 EDT 2001


Thanks a lot.
Yes, a mess indeed. The Python team seriously needs to address these issues.

Olivier.

-------------------------------------------------------------------------
Olivier Deme
AIRTEL-ATN                                        ~
Phone:          +353-1-284 2821                 .   .
                +353-1-214 7910 (Direct)       /  v  \
Email:          olivier.deme at airtel-atn.com   /(     )\
Web:            www.airtel-atn.com              ^^-^^
-------------------------------------------------------------------------

On Mon, 1 Oct 2001, Mads Bondo Dydensborg wrote:

> On Mon, 1 Oct 2001, Olivier Deme wrote:
>
> > Thanks for the link to the demo application.
> > Indeed it seems that there a plenty of libraries to link with...
> >
> > Something also really annoying:
> > The libraries are located in an unusual place on my machine:
> > /usr/local/lib/python2.1/config/
> >
> > Plus, the fact that libpython*.a has its version number in the file name.
> > That means that if our customer has a different version of Python, they
> > won't be able to link our application!
> > Usually, this should be solved by adding a symbolink link in a common
> > directory. Sonething like:
> > /usr/lib/libpython.a -> /usr/local/lib/python2.1/config/libpython2.1.a
> >
> > But this is not done during installation of Python. How are we supposed to know
> > the version used by the people who are going to build our application?
>
> I have found that out - the pygtk code includes autoconf (are you using
> autoconf) code that calls python (douh). (This is just an expert, be sure
> to review the entire file - acinclude.m4 from the pygtk distribution).
>
>     changequote(<<, >>)dnl
>     prog="
> import sys, string
> minver = '$1'
> pyver = string.split(sys.version)[0]  # first word is version string
> # split strings by '.' and convert to numeric
> minver = map(string.atoi, string.split(minver, '.'))
> if hasattr(sys, 'version_info'):
>     pyver = sys.version_info[:3]
> else:
>     pyver = map(string.atoi, string.split(pyver, '.'))
> # we can now do comparisons on the two lists:
> if pyver >= minver:
>         sys.exit(0)
> else:
>         sys.exit(1)"
>     changequote([, ])dnl
>     if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
>
> The library can be found from constructions like the following
>
> py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
> PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
>
> There are standard places the library go, when you have the exec_prefix (I
> think).
>
> Linking is the great problem here (linker options). I found
> http://sources.redhat.com/ml/bug-autoconf/2001/msg00297.html
> (it is 4000 lines). Search for KDE_CHECK_PYTHON for how they test for some
> common linker requirements.
>
> It is a mess though.
>
> Mads
>
> --
> Mads Bondo Dydensborg.                               madsdyd at challenge.dk
> In a stinging rebuke, a federal judge Monday ruled Microsoft Corp. violated
> the nation's antitrust laws by using its monopoly power in personal computer
> operating systems to stifle competition.
>                         - CNN Financial News April 03, 2000: 7:53 p.m. ET
>





More information about the Python-list mailing list