[GRASS-dev] Re: [GRASS GIS] #38: configure.in: wxwidgets and python checks

Martin Landa landa.martin at gmail.com
Sun Feb 10 12:53:22 EST 2008


Hi,

2008/2/10, Glynn Clements <glynn at gclements.plus.com>:
> > > > FWIW, on my system (Debian/stable) there is no python-config in sight.
> > > >
> > > > $ locate python-config
> > > > $ apt-file search bin/python-config
> > > > $
> > > >
> > > > nothin.
> > > >  (apt-file searches all packages in the entire Debian(/stable) archive)
> > > >  renamed?
> > >
> > > python-config is part of *python-dev* package (only Debian
> > > testing/unstable, it is not included in Etch). I don't know about
> > > Mac/Windows Python distribution.
>
> And if you don't have python-dev, you won't be able to build python
> extensions for more fundamental reasons than the lack of
> python-config.
>
> > on Etch
> >
> > python2.4-dev: usr/bin/python2.4-config
> > python2.5-dev: usr/bin/python2.5-config
>
> [Does it create symlinks? Anything created by a post-install script
> won't be visible from apt-search.]

It is true for Debian testing/unstable not for Etch(stable). There is
no python-config.

> In any case, that's why we need to allow e.g.
> --with-python=python2.4-config
>
> > I will upgrade configure to check also for python${PYVERSION}-config.
>
> Where are you going to get ${PYVERSION} from before you've located the
> python-config program? If there is more than one version installed,
> invoking "python" won't necessarily use the right version.

Python version is determined from small python script(s).

1656	 	# find out python version
1657	 	AC_MSG_CHECKING(Python version)
1658	 	PYVERSION=`$PYTHON_BIN -c ['import sys; print sys.version[:3]'`]
1659	 	PYMAJVERSION=`$PYTHON_BIN -c ['import sys; print sys.version[:1]'`]
1660	 	PYMINVERSION=`$PYTHON_BIN -c ['import sys; print sys.version[2:3]'`]
1661	 	AC_MSG_RESULT($PYVERSION)
1662	 	AC_SUBST(PYVERSION)

I didn't change this part of configure script.

The problem with python-config is that there is *no* version switch.

Usage: /usr/bin/python-config
[--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--help]

So how to determine python version using python-config?

You can currently run with --with-python=/usr/bin/python2.5 to force
using version 2.5.

> Resist the temptation to turn configure into an expert system. The
> general policy is that any deviation from the obvious default has to
> be explicitly specified by the user.
>
> E.g. any headers which aren't in the system include path require the
> corresponding --with-includes= switch, regardless of how common a
> particular setting is.

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *


More information about the grass-dev mailing list