diff options
author | Matthieu Patou <mat@matws.net> | 2010-12-10 01:42:32 +0300 |
---|---|---|
committer | Matthieu Patou <mat@matws.net> | 2010-12-10 02:07:18 +0300 |
commit | 87337383572324e3d1d00ed710614ebe217aa2b2 (patch) | |
tree | d562cd37228a12f9065f3bc73e1e80979fd57b19 /buildtools | |
parent | 672c48b763ce3d53dc93cce1c73f3f1ced1147e8 (diff) | |
download | samba-87337383572324e3d1d00ed710614ebe217aa2b2.tar.gz samba-87337383572324e3d1d00ed710614ebe217aa2b2.tar.bz2 samba-87337383572324e3d1d00ed710614ebe217aa2b2.zip |
build: introduce SAMBA_CHECK_PYTHON_HEADERS
This function is a wrapper around waf's check_python_header.
It avoids searching more than once for the headers bringing a small
speed improvement and a better lisibility of the logs.
But it's mainly to avoid a nasty bug when python libraries are in path
pointed by python_LIBPL (ie. /usr/local/lib/python2.6/config/) instead
of python_LIBDIR (ie. /usr/local/lib).
On the first call waf will correctly find that in order to link with
python libs it needs to add -L$python_LIBPL.
But on the next calls of check_python_headers, waf will use both the
current library path value (ie. -L/usr/local/lib/python2.6/config) and
-L$python_LIBDIR (ie. /usr/local/lib/) which will make him beleive that
python libraries are in $python_LIBDIR which at the end will make the
final link test fails in check_python_headers as it will not use the
good directory.
So by avoiding calling check_python_headers more than once we avoid
making waf fooling itself.
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/wafsamba/samba_python.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py index ad09981462..a663b1910d 100644 --- a/buildtools/wafsamba/samba_python.py +++ b/buildtools/wafsamba/samba_python.py @@ -4,6 +4,15 @@ import Build from samba_utils import * from samba_autoconf import * +from Configure import conf +@conf +def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True): + if conf.env["python_headers_checked"] == []: + conf.check_python_headers(mandatory) + conf.env["python_headers_checked"] = "yes" + else: + conf.msg("python headers", "using cache") + def SAMBA_PYTHON(bld, name, source='', |