aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/samba/samba
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2020-04-29 12:51:39 +0200
committerKhem Raj <raj.khem@gmail.com>2020-04-29 08:03:06 -0700
commitd312635f74c8e892d2166e998f378e17db4cbb63 (patch)
tree972857941202e875ed37c6caae8a650a9a69d926 /meta-networking/recipes-connectivity/samba/samba
parent17fd382f3467e20308924499b7531ae8b789f056 (diff)
downloadmeta-openembedded-d312635f74c8e892d2166e998f378e17db4cbb63.tar.gz
samba: Remove the dependency on libbsd
It is unnecessary, and libbsd uses the "BSD-4-Clause" license, which can be problematic. To make it deterministic, a patch is introduced to allow libbsd support to be disabled. It resembles similar patches in, e.g., libldb, libtalloc, libtdb and libtevent. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-connectivity/samba/samba')
-rw-r--r--meta-networking/recipes-connectivity/samba/samba/0001-Add-options-to-configure-the-use-of-libbsd.patch103
1 files changed, 103 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/samba/samba/0001-Add-options-to-configure-the-use-of-libbsd.patch b/meta-networking/recipes-connectivity/samba/samba/0001-Add-options-to-configure-the-use-of-libbsd.patch
new file mode 100644
index 0000000000..80cdd3955f
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba/0001-Add-options-to-configure-the-use-of-libbsd.patch
@@ -0,0 +1,103 @@
+From 1e8d31c138395122df4cc2a3e0edd6cd3fad736c Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Tue, 28 Apr 2020 02:05:33 +0200
+Subject: [PATCH] Add options to configure the use of libbsd
+
+Upstream-Status: Inappropriate [oe deterministic build specific]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ buildtools/wafsamba/wscript | 7 +++++++
+ lib/crypto/wscript_configure | 2 +-
+ lib/replace/wscript | 29 +++++++++++++++--------------
+ lib/texpect/wscript | 7 ++++++-
+ 4 files changed, 29 insertions(+), 16 deletions(-)
+
+diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
+index 7b8fb01..a8e4b0a 100644
+--- a/buildtools/wafsamba/wscript
++++ b/buildtools/wafsamba/wscript
+@@ -88,6 +88,13 @@ def options(opt):
+ help=("Disable use of gettext"),
+ action="store_true", dest='disable_gettext', default=False)
+
++ opt.add_option('--with-libbsd',
++ help=("Enable use of libbsd"),
++ action="store_true", dest='enable_libbsd')
++ opt.add_option('--without-libbsd',
++ help=("Disable use of libbsd"),
++ action="store_false", dest='enable_libbsd', default=False)
++
+ gr = opt.option_group('developer options')
+
+ gr.add_option('-C',
+diff --git a/lib/crypto/wscript_configure b/lib/crypto/wscript_configure
+index 09dfe04..e871718 100644
+--- a/lib/crypto/wscript_configure
++++ b/lib/crypto/wscript_configure
+@@ -2,7 +2,7 @@
+ from waflib import Options
+ from waflib import Errors, Logs
+
+-if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
++if not Options.options.enable_libbsd or not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
+ checklibc=True):
+ conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
+ checklibc=True)
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 0020d2a..cd9228f 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -407,20 +407,21 @@ def configure(conf):
+
+ strlcpy_in_bsd = False
+
+- # libbsd on some platforms provides strlcpy and strlcat
+- if not conf.CHECK_FUNCS('strlcpy strlcat'):
+- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+- checklibc=True):
+- strlcpy_in_bsd = True
+- if not conf.CHECK_FUNCS('getpeereid'):
+- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS('setproctitle_init'):
+- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
+-
+- if not conf.CHECK_FUNCS('closefrom'):
+- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++ if Options.options.enable_libbsd:
++ # libbsd on some platforms provides strlcpy and strlcat
++ if not conf.CHECK_FUNCS('strlcpy strlcat'):
++ if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
++ checklibc=True):
++ strlcpy_in_bsd = True
++ if not conf.CHECK_FUNCS('getpeereid'):
++ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
++ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
++ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
++ if not conf.CHECK_FUNCS('setproctitle_init'):
++ conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
++
++ if not conf.CHECK_FUNCS('closefrom'):
++ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
+
+ conf.CHECK_CODE('''
+ struct ucred cred;
+diff --git a/lib/texpect/wscript b/lib/texpect/wscript
+index e14c048..a91de59 100644
+--- a/lib/texpect/wscript
++++ b/lib/texpect/wscript
+@@ -1,7 +1,12 @@
+ #!/usr/bin/env python
++from waflib import Options
+
+ def configure(conf):
+- conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h bsd/libutil.h libutil.h')
++ hdrs = 'pty.h util.h'
++ if Options.options.enable_libbsd:
++ hdrs += ' bsd/libutil.h'
++ hdrs += ' libutil.h'
++ conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers=hdrs)
+
+ def build(bld):
+ bld.SAMBA_BINARY('texpect', 'texpect.c', deps='popt util replace', install=False)