Re: Gnumeric & Python



Yes, you are right.  (I didn't look close enough).  There is also a
BASEMODELIBS variable, and the LIBS variable seems to be used.  Some code
that should work is:

  py_makefile=`python -c 'import sys ; print sys.exec_prefix + "/lib/python" + sys.version[:3] + "/config/Makefile"'`

  py_local_mod_libs="`sed -n 's/^LOCALMODLIBS=\(.*\)/\1/p' $py_makefile`"
  py_base_mod_libs="`sed -n 's/^BASEMODLIBS=\(.*\)/\1/p' $py_makefile`"
  py_other_libs="`sed -n 's/^LIBS=\(.*\)/\1/p' $py_makefile`"

  PY_EXTRA_LIBS="$py_local_mod_libs $py_base_mod_libs $py_other_libs"
  AC_SUBST(PY_EXTRA_LIBS)

This is (hopefully) the correct code to detect what extra libraries to
link in.

James Henstridge.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Mon, 12 Oct 1998, Michael Hudson wrote:

> It has to be a deal more complicated than that I'm afraid.
> 1) My python is installed under /usr/local
> 2) The variable you actually want is LOCALMODLIBS
> 3) You need to hack the contents of the variable because it contains (on
> my system at least) -L$(exec_prefix)/lib which bash chokes on.
> 
> I thought I had a patch which sorted this out, but I realised in time that
> it didn't work, so I saved myself the embarassment of posting dud code to
> the list.
> 
> Michael Hudson
> Jesus College
> Cambridge
> mwh21@cam.ac.uk
> 
> On Sat, 10 Oct 1998, Tom Dyas wrote:
> 
> > On Sat, 10 Oct 1998, James Henstridge wrote:
> > 
> > > IIRC, python should record some of this information in
> > > $(exec_prefix)/lib/python$(version)/config/Makefile.  Specifically, the
> > > definition of LIBS.
> > > 
> > > I use the information in this file for the autoconf scripts for pygtk and
> > > pygnome.  In gnumeric's config script, you could try adding something like
> > > this:
> > > 
> > > eval `sed -n '/^LIBS=/ s/LIBS=[ 	]*\(.*\)/PY_XTRA_LIBS="\1"/p' \
> > >   /usr/lib/python1.5/config/Makefile`
> > > AC_SUBST(PY_EXTRA_LIBS)
> > > 
> > > Hopefully this will be helpful to someone.
> > 
> > I'll add this to configure.in. Thanks.
> > 
> > Tom
> > 
> > 
> > 
> > -- 
> >          To unsubscribe: mail gnome-list-request@gnome.org with 
> >                        "unsubscribe" as the Subject.
> > 
> > 
> 
> 



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