Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 1 | From 515f2455b4b69f5fcd2c61a532663280785db737 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 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> |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 8 | |
| 9 | Rebase to 4.14.4 |
| 10 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 11 | --- |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 12 | buildtools/wafsamba/wscript | 7 +++++++ |
| 13 | lib/replace/wscript | 29 +++++++++++++++-------------- |
| 14 | lib/texpect/wscript | 8 +++++++- |
| 15 | 3 files changed, 29 insertions(+), 15 deletions(-) |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 16 | |
| 17 | diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 18 | index 8729b08..1c55428 100644 |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 19 | --- a/buildtools/wafsamba/wscript |
| 20 | +++ b/buildtools/wafsamba/wscript |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 21 | @@ -145,6 +145,13 @@ Currently the only tested value is 'smbtorture,smbd/smbd' for Samba'''), |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 22 | help=("Disable use of gettext"), |
| 23 | action="store_true", dest='disable_gettext', default=False) |
| 24 | |
| 25 | + opt.add_option('--with-libbsd', |
| 26 | + help=("Enable use of libbsd"), |
| 27 | + action="store_true", dest='enable_libbsd') |
| 28 | + opt.add_option('--without-libbsd', |
| 29 | + help=("Disable use of libbsd"), |
| 30 | + action="store_false", dest='enable_libbsd', default=False) |
| 31 | + |
| 32 | gr = opt.option_group('developer options') |
| 33 | |
| 34 | gr.add_option('-C', |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 35 | diff --git a/lib/replace/wscript b/lib/replace/wscript |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 36 | index 9ef9bd9..d47de4f 100644 |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 37 | --- a/lib/replace/wscript |
| 38 | +++ b/lib/replace/wscript |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 39 | @@ -439,20 +439,21 @@ def configure(conf): |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 40 | |
| 41 | strlcpy_in_bsd = False |
| 42 | |
| 43 | - # libbsd on some platforms provides strlcpy and strlcat |
| 44 | - if not conf.CHECK_FUNCS('strlcpy strlcat'): |
| 45 | - if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', |
| 46 | - checklibc=True): |
| 47 | - strlcpy_in_bsd = True |
| 48 | - if not conf.CHECK_FUNCS('getpeereid'): |
| 49 | - conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 50 | - if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): |
| 51 | - conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 52 | - if not conf.CHECK_FUNCS('setproctitle_init'): |
| 53 | - conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 54 | - |
| 55 | - if not conf.CHECK_FUNCS('closefrom'): |
| 56 | - conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') |
| 57 | + if Options.options.enable_libbsd: |
| 58 | + # libbsd on some platforms provides strlcpy and strlcat |
| 59 | + if not conf.CHECK_FUNCS('strlcpy strlcat'): |
| 60 | + if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', |
| 61 | + checklibc=True): |
| 62 | + strlcpy_in_bsd = True |
| 63 | + if not conf.CHECK_FUNCS('getpeereid'): |
| 64 | + conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 65 | + if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): |
| 66 | + conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 67 | + if not conf.CHECK_FUNCS('setproctitle_init'): |
| 68 | + conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 69 | + |
| 70 | + if not conf.CHECK_FUNCS('closefrom'): |
| 71 | + conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') |
| 72 | |
| 73 | conf.CHECK_CODE(''' |
| 74 | struct ucred cred; |
| 75 | diff --git a/lib/texpect/wscript b/lib/texpect/wscript |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 76 | index 44f92a8..79e8d09 100644 |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 77 | --- a/lib/texpect/wscript |
| 78 | +++ b/lib/texpect/wscript |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 79 | @@ -1,7 +1,13 @@ |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 80 | #!/usr/bin/env python |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 81 | |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 82 | +from waflib import Options |
| 83 | + |
Andrew Geissler | e231d58 | 2020-05-05 08:53:09 -0500 | [diff] [blame] | 84 | def configure(conf): |
| 85 | - conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers='pty.h util.h bsd/libutil.h libutil.h') |
| 86 | + hdrs = 'pty.h util.h' |
| 87 | + if Options.options.enable_libbsd: |
| 88 | + hdrs += ' bsd/libutil.h' |
| 89 | + hdrs += ' libutil.h' |
| 90 | + conf.CHECK_FUNCS_IN('openpty', 'util', checklibc=True, headers=hdrs) |
| 91 | |
| 92 | def build(bld): |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 93 | bld.SAMBA_BINARY('texpect', |
| 94 | -- |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 95 | 2.25.1 |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 96 | |