Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 1 | From 8a82056ba2f70137714f225d82993aa4b11042da Mon Sep 17 00:00:00 2001 |
| 2 | From: Wang Mingyu <wangmy@cn.fujitsu.com> |
| 3 | Date: Fri, 25 Dec 2020 14:14:08 +0900 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 4 | Subject: [PATCH] talloc: Add configure options for packages |
| 5 | |
| 6 | Add configure options for the following packages: |
| 7 | - acl |
| 8 | - attr |
| 9 | - libaio |
| 10 | - libbsd |
| 11 | - libcap |
| 12 | - valgrind |
| 13 | |
| 14 | Upstream-Status: Inappropriate [oe deterministic build specific] |
| 15 | |
| 16 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
| 17 | |
| 18 | Modified to apply to version 2.1.10. |
| 19 | |
| 20 | Signed-off-by: Joe Slater <joe.slater@windriver.com> |
| 21 | |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 22 | Modified tp apply to version 2.2.0 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 23 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 24 | --- |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 25 | lib/replace/wscript | 89 +++++++++++++++++++++++++++++++++++---------- |
| 26 | wscript | 7 +++- |
| 27 | 2 files changed, 75 insertions(+), 21 deletions(-) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 28 | |
| 29 | diff --git a/lib/replace/wscript b/lib/replace/wscript |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 30 | index a2bc604..2e2e7bf 100644 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 31 | --- a/lib/replace/wscript |
| 32 | +++ b/lib/replace/wscript |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 33 | @@ -25,6 +25,41 @@ def options(opt): |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 34 | opt.PRIVATE_EXTENSION_DEFAULT('') |
| 35 | opt.RECURSE('buildtools/wafsamba') |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 36 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 37 | + opt.add_option('--with-acl', |
| 38 | + help=("Enable use of acl"), |
| 39 | + action="store_true", dest='enable_acl') |
| 40 | + opt.add_option('--without-acl', |
| 41 | + help=("Disable use of acl"), |
| 42 | + action="store_false", dest='enable_acl', default=False) |
| 43 | + |
| 44 | + opt.add_option('--with-attr', |
| 45 | + help=("Enable use of attr"), |
| 46 | + action="store_true", dest='enable_attr') |
| 47 | + opt.add_option('--without-attr', |
| 48 | + help=("Disable use of attr"), |
| 49 | + action="store_false", dest='enable_attr', default=False) |
| 50 | + |
| 51 | + opt.add_option('--with-libaio', |
| 52 | + help=("Enable use of libaio"), |
| 53 | + action="store_true", dest='enable_libaio') |
| 54 | + opt.add_option('--without-libaio', |
| 55 | + help=("Disable use of libaio"), |
| 56 | + action="store_false", dest='enable_libaio', default=False) |
| 57 | + |
| 58 | + opt.add_option('--with-libbsd', |
| 59 | + help=("Enable use of libbsd"), |
| 60 | + action="store_true", dest='enable_libbsd') |
| 61 | + opt.add_option('--without-libbsd', |
| 62 | + help=("Disable use of libbsd"), |
| 63 | + action="store_false", dest='enable_libbsd', default=False) |
| 64 | + |
| 65 | + opt.add_option('--with-libcap', |
| 66 | + help=("Enable use of libcap"), |
| 67 | + action="store_true", dest='enable_libcap') |
| 68 | + opt.add_option('--without-libcap', |
| 69 | + help=("Disable use of libcap"), |
| 70 | + action="store_false", dest='enable_libcap', default=False) |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 71 | + |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 72 | @Utils.run_once |
| 73 | def configure(conf): |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 74 | conf.RECURSE('buildtools/wafsamba') |
| 75 | @@ -34,12 +69,25 @@ def configure(conf): |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 76 | conf.DEFINE('HAVE_LIBREPLACE', 1) |
| 77 | conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1) |
| 78 | |
| 79 | - conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h') |
| 80 | - conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h') |
| 81 | + conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h') |
| 82 | + conf.CHECK_HEADERS('attr/xattr.h compat.h ctype.h dustat.h') |
| 83 | conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h') |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 84 | conf.CHECK_HEADERS('locale.h ndir.h pwd.h') |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 85 | - conf.CHECK_HEADERS('shadow.h sys/acl.h') |
| 86 | - conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h') |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 87 | + conf.CHECK_HEADERS('shadow.h') |
| 88 | + conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h') |
| 89 | + |
| 90 | + if Options.options.enable_acl: |
| 91 | + conf.CHECK_HEADERS('acl/libacl.h sys/acl.h') |
| 92 | + |
| 93 | + if Options.options.enable_attr: |
| 94 | + conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h') |
| 95 | + |
| 96 | + if Options.options.enable_libaio: |
| 97 | + conf.CHECK_HEADERS('libaio.h') |
| 98 | + |
| 99 | + if Options.options.enable_libcap: |
| 100 | + conf.CHECK_HEADERS('sys/capability.h') |
| 101 | + |
| 102 | conf.CHECK_HEADERS('port.h') |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 103 | conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h') |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 104 | conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h') |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 105 | @@ -121,8 +169,9 @@ def configure(conf): |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 106 | conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h') |
| 107 | conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h') |
| 108 | |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 109 | - conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h') |
| 110 | - conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h') |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 111 | + if Options.options.enable_valgrind: |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 112 | + conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h') |
| 113 | + conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h') |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 114 | conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h') |
| 115 | conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h') |
| 116 | conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h') |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 117 | @@ -418,20 +467,20 @@ def configure(conf): |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 118 | |
| 119 | strlcpy_in_bsd = False |
| 120 | |
| 121 | - # libbsd on some platforms provides strlcpy and strlcat |
| 122 | - if not conf.CHECK_FUNCS('strlcpy strlcat'): |
| 123 | - if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', |
| 124 | - checklibc=True): |
| 125 | - strlcpy_in_bsd = True |
| 126 | - if not conf.CHECK_FUNCS('getpeereid'): |
| 127 | - conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 128 | - if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): |
| 129 | - conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 130 | - if not conf.CHECK_FUNCS('setproctitle_init'): |
| 131 | - conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 132 | - |
| 133 | - if not conf.CHECK_FUNCS('closefrom'): |
| 134 | - conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') |
| 135 | + if Options.options.enable_libbsd: |
| 136 | + # libbsd on some platforms provides strlcpy and strlcat |
| 137 | + if not conf.CHECK_FUNCS('strlcpy strlcat'): |
| 138 | + if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', |
| 139 | + checklibc=True): |
| 140 | + strlcpy_in_bsd = True |
| 141 | + if not conf.CHECK_FUNCS('getpeereid'): |
| 142 | + conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 143 | + if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): |
| 144 | + conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 145 | + if not conf.CHECK_FUNCS('setproctitle_init'): |
| 146 | + conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 147 | + if not conf.CHECK_FUNCS('closefrom'): |
| 148 | + conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') |
| 149 | |
| 150 | conf.CHECK_CODE(''' |
| 151 | struct ucred cred; |
| 152 | diff --git a/wscript b/wscript |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 153 | index b955d21..4ac6e1e 100644 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 154 | --- a/wscript |
| 155 | +++ b/wscript |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 156 | @@ -31,7 +31,12 @@ def options(opt): |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 157 | opt.add_option('--enable-talloc-compat1', |
| 158 | help=("Build talloc 1.x.x compat library [False]"), |
| 159 | action="store_true", dest='TALLOC_COMPAT1', default=False) |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 160 | - |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 161 | + opt.add_option('--with-valgrind', |
| 162 | + help=("enable use of valgrind"), |
| 163 | + action="store_true", dest='enable_valgrind') |
| 164 | + opt.add_option('--without-valgrind', |
| 165 | + help=("disable use of valgrind"), |
| 166 | + action="store_false", dest='enable_valgrind', default=False) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 167 | |
| 168 | def configure(conf): |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 169 | conf.RECURSE('lib/replace') |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 170 | -- |
Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 171 | 2.25.1 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 172 | |