diff options
-rw-r--r-- | meta-networking/recipes-connectivity/samba/samba/0001-Add-options-to-configure-the-use-of-libbsd.patch | 103 | ||||
-rw-r--r-- | meta-networking/recipes-connectivity/samba/samba_4.10.13.bb | 4 |
2 files changed, 106 insertions, 1 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 @@ | |||
1 | From 1e8d31c138395122df4cc2a3e0edd6cd3fad736c Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Kjellerstedt <pkj@axis.com> | ||
3 | Date: Tue, 28 Apr 2020 02:05:33 +0200 | ||
4 | Subject: [PATCH] Add options to configure the use of libbsd | ||
5 | |||
6 | Upstream-Status: Inappropriate [oe deterministic build specific] | ||
7 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> | ||
8 | --- | ||
9 | buildtools/wafsamba/wscript | 7 +++++++ | ||
10 | lib/crypto/wscript_configure | 2 +- | ||
11 | lib/replace/wscript | 29 +++++++++++++++-------------- | ||
12 | lib/texpect/wscript | 7 ++++++- | ||
13 | 4 files changed, 29 insertions(+), 16 deletions(-) | ||
14 | |||
15 | diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript | ||
16 | index 7b8fb01..a8e4b0a 100644 | ||
17 | --- a/buildtools/wafsamba/wscript | ||
18 | +++ b/buildtools/wafsamba/wscript | ||
19 | @@ -88,6 +88,13 @@ def options(opt): | ||
20 | help=("Disable use of gettext"), | ||
21 | action="store_true", dest='disable_gettext', default=False) | ||
22 | |||
23 | + opt.add_option('--with-libbsd', | ||
24 | + help=("Enable use of libbsd"), | ||
25 | + action="store_true", dest='enable_libbsd') | ||
26 | + opt.add_option('--without-libbsd', | ||
27 | + help=("Disable use of libbsd"), | ||
28 | + action="store_false", dest='enable_libbsd', default=False) | ||
29 | + | ||
30 | gr = opt.option_group('developer options') | ||
31 | |||
32 | gr.add_option('-C', | ||
33 | diff --git a/lib/crypto/wscript_configure b/lib/crypto/wscript_configure | ||
34 | index 09dfe04..e871718 100644 | ||
35 | --- a/lib/crypto/wscript_configure | ||
36 | +++ b/lib/crypto/wscript_configure | ||
37 | @@ -2,7 +2,7 @@ | ||
38 | from waflib import Options | ||
39 | from waflib import Errors, Logs | ||
40 | |||
41 | -if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h', | ||
42 | +if not Options.options.enable_libbsd or not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h', | ||
43 | checklibc=True): | ||
44 | conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h', | ||
45 | checklibc=True) | ||
46 | diff --git a/lib/replace/wscript b/lib/replace/wscript | ||
47 | index 0020d2a..cd9228f 100644 | ||
48 | --- a/lib/replace/wscript | ||
49 | +++ b/lib/replace/wscript | ||
50 | @@ -407,20 +407,21 @@ def configure(conf): | ||
51 | |||
52 | strlcpy_in_bsd = False | ||
53 | |||
54 | - # libbsd on some platforms provides strlcpy and strlcat | ||
55 | - if not conf.CHECK_FUNCS('strlcpy strlcat'): | ||
56 | - if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', | ||
57 | - checklibc=True): | ||
58 | - strlcpy_in_bsd = True | ||
59 | - if not conf.CHECK_FUNCS('getpeereid'): | ||
60 | - conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
61 | - if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): | ||
62 | - conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
63 | - if not conf.CHECK_FUNCS('setproctitle_init'): | ||
64 | - conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
65 | - | ||
66 | - if not conf.CHECK_FUNCS('closefrom'): | ||
67 | - conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') | ||
68 | + if Options.options.enable_libbsd: | ||
69 | + # libbsd on some platforms provides strlcpy and strlcat | ||
70 | + if not conf.CHECK_FUNCS('strlcpy strlcat'): | ||
71 | + if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', | ||
72 | + checklibc=True): | ||
73 | + strlcpy_in_bsd = True | ||
74 | + if not conf.CHECK_FUNCS('getpeereid'): | ||
75 | + conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
76 | + if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): | ||
77 | + conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
78 | + if not conf.CHECK_FUNCS('setproctitle_init'): | ||
79 | + conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') | ||
80 | + | ||
81 | + if not conf.CHECK_FUNCS('closefrom'): | ||
82 | + conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') | ||
83 | |||
84 | conf.CHECK_CODE(''' | ||
85 | struct ucred cred; | ||
86 | diff --git a/lib/texpect/wscript b/lib/texpect/wscript | ||
87 | index e14c048..a91de59 100644 | ||
88 | --- a/lib/texpect/wscript | ||
89 | +++ b/lib/texpect/wscript | ||
90 | @@ -1,7 +1,12 @@ | ||
91 | #!/usr/bin/env python | ||
92 | +from waflib import Options | ||
93 | |||
94 | def configure(conf): | ||
95 | - conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h bsd/libutil.h libutil.h') | ||
96 | + hdrs = 'pty.h util.h' | ||
97 | + if Options.options.enable_libbsd: | ||
98 | + hdrs += ' bsd/libutil.h' | ||
99 | + hdrs += ' libutil.h' | ||
100 | + conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers=hdrs) | ||
101 | |||
102 | def build(bld): | ||
103 | bld.SAMBA_BINARY('texpect', 'texpect.c', deps='popt util replace', install=False) | ||
diff --git a/meta-networking/recipes-connectivity/samba/samba_4.10.13.bb b/meta-networking/recipes-connectivity/samba/samba_4.10.13.bb index 71d8fa2f87..5f227c892d 100644 --- a/meta-networking/recipes-connectivity/samba/samba_4.10.13.bb +++ b/meta-networking/recipes-connectivity/samba/samba_4.10.13.bb | |||
@@ -26,6 +26,7 @@ SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \ | |||
26 | file://0001-waf-add-support-of-cross_compile.patch \ | 26 | file://0001-waf-add-support-of-cross_compile.patch \ |
27 | file://0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch \ | 27 | file://0001-lib-replace-wscript-Avoid-generating-nested-main-fun.patch \ |
28 | file://0002-util_sec.c-Move-__thread-variable-to-global-scope.patch \ | 28 | file://0002-util_sec.c-Move-__thread-variable-to-global-scope.patch \ |
29 | file://0001-Add-options-to-configure-the-use-of-libbsd.patch \ | ||
29 | " | 30 | " |
30 | SRC_URI_append_libc-musl = " \ | 31 | SRC_URI_append_libc-musl = " \ |
31 | file://samba-pam.patch \ | 32 | file://samba-pam.patch \ |
@@ -43,7 +44,7 @@ inherit systemd waf-samba cpan-base perlnative update-rc.d | |||
43 | # remove default added RDEPENDS on perl | 44 | # remove default added RDEPENDS on perl |
44 | RDEPENDS_${PN}_remove = "perl" | 45 | RDEPENDS_${PN}_remove = "perl" |
45 | 46 | ||
46 | DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libbsd libaio libpam libtasn1 jansson" | 47 | DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libaio libpam libtasn1 jansson" |
47 | 48 | ||
48 | inherit features_check | 49 | inherit features_check |
49 | REQUIRED_DISTRO_FEATURES = "pam" | 50 | REQUIRED_DISTRO_FEATURES = "pam" |
@@ -91,6 +92,7 @@ PACKAGECONFIG[archive] = "--with-libarchive, --without-libarchive, libarchive" | |||
91 | PACKAGECONFIG[libunwind] = ", , libunwind" | 92 | PACKAGECONFIG[libunwind] = ", , libunwind" |
92 | PACKAGECONFIG[gpgme] = ",--without-gpgme,," | 93 | PACKAGECONFIG[gpgme] = ",--without-gpgme,," |
93 | PACKAGECONFIG[lmdb] = ",--without-ldb-lmdb,lmdb," | 94 | PACKAGECONFIG[lmdb] = ",--without-ldb-lmdb,lmdb," |
95 | PACKAGECONFIG[libbsd] = "--with-libbsd, --without-libbsd, libbsd" | ||
94 | 96 | ||
95 | # Building the AD (Active Directory) DC (Domain Controller) requires GnuTLS, | 97 | # Building the AD (Active Directory) DC (Domain Controller) requires GnuTLS, |
96 | # And ad-dc doesn't work with mitkrb5 for versions prior to 4.7.0 according to: | 98 | # And ad-dc doesn't work with mitkrb5 for versions prior to 4.7.0 according to: |