wafsamba: move -L/some/path from LINKFLAGS_PYEMBED to LIBPATH_PYEMBED
authorStefan Metzmacher <metze@samba.org>
Tue, 28 Mar 2017 13:28:21 +0000 (15:28 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 4 Apr 2017 14:10:18 +0000 (16:10 +0200)
LINKFLAGS should not have path components.

This fixes the build on systems like FreeBSD where python
is located in /usr/local/lib.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12724

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Apr  4 16:10:18 CEST 2017 on sn-devel-144

buildtools/wafsamba/samba_python.py

index 40b42fcf79aac80f6d77ae8ef55fee2e758a9ce2..f97439c945b4e986bacef39387cf4168d419e158 100644 (file)
@@ -90,6 +90,12 @@ def _check_python_headers(conf, mandatory):
     conf.env['PYTHON_LIBNAME_SO_ABI_FLAG'] = (
         conf.env['PYTHON_SO_ABI_FLAG'].replace('_', '-'))
 
+    for lib in conf.env['LINKFLAGS_PYEMBED']:
+        if lib.startswith('-L'):
+            conf.env.append_unique('LIBPATH_PYEMBED', lib[2:]) # strip '-L'
+            conf.env['LINKFLAGS_PYEMBED'].remove(lib)
+
+    return
 
 def PYTHON_BUILD_IS_ENABLED(self):
     return self.CONFIG_SET('HAVE_PYTHON_H')