[Patch] Fix the build with bundled talloc on FreeBSD (bug #12724)

Stefan Metzmacher metze at samba.org
Tue Apr 4 09:44:47 UTC 2017


here's a patch that fixes

The problem is that LINKFLAGS_PYEMBED contains
-L/usr/local/lib, so that we link against
/usr/local/lib/libtalloc.so instead of bin/shared/private/libtalloc.so
and pytalloc_GenericObject* is missing.

When linking we use LINKFLAGS first followed by LIBPATH.
LIBPATH contains the relative (to the source/build directory) -L values
first before the absolute -L values for external libraries.

The key is that LINKFLAGS never contains -L, this must go via LIBPATH.

Please review and push:-)

-------------- next part --------------
From de0f93acef2dd7434b282d1a54f0553cccbd052a Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Tue, 28 Mar 2017 15:28:21 +0200
Subject: [PATCH] wafsamba: move -L/some/path from LINKFLAGS_PYEMBED to

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 at samba.org>
 buildtools/wafsamba/samba_python.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py
index 40b42fc..f97439c 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -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
     return self.CONFIG_SET('HAVE_PYTHON_H')

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170404/714ac882/signature.sig>

More information about the samba-technical mailing list