blob: 481fd68a4f34afcbdcc09c35770e611d146a53dd [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From 71a10c176c34da898c0169371b3c1b032d2f88b1 Mon Sep 17 00:00:00 2001
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08002From: Changqing Li <changqing.li@windriver.com>
Brad Bishop26bdd442019-08-16 17:08:17 -04003Date: Wed, 19 Jun 2019 17:53:34 +0800
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08004Subject: [PATCH] tdb: Add configure options for packages
Patrick Williamsddad1a12017-02-23 20:36:32 -06005
6Add configure options for the following packages:
7 - acl
8 - attr
9 - libaio
10 - libbsd
11 - libcap
12 - valgrind
13
14Upstream-Status: Inappropriate [oe deterministic build specific]
15
16Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050017
Brad Bishop26bdd442019-08-16 17:08:17 -040018Update to 1.4.0
Brad Bishopd7bf8c12018-02-25 22:55:05 -050019
Brad Bishop19323692019-04-05 15:28:33 -040020Signed-off-by: Changqing Li <changqing.li@windriver.com>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021---
Brad Bishop26bdd442019-08-16 17:08:17 -040022 lib/replace/wscript | 94 ++++++++++++++++++++++++++++++++++++++++-------------
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080023 wscript | 6 ++++
Brad Bishop26bdd442019-08-16 17:08:17 -040024 2 files changed, 78 insertions(+), 22 deletions(-)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025
Patrick Williamsddad1a12017-02-23 20:36:32 -060026diff --git a/lib/replace/wscript b/lib/replace/wscript
Brad Bishop26bdd442019-08-16 17:08:17 -040027index 1d01e1e..2336dc3 100644
Patrick Williamsddad1a12017-02-23 20:36:32 -060028--- a/lib/replace/wscript
29+++ b/lib/replace/wscript
Brad Bishop19323692019-04-05 15:28:33 -040030@@ -25,6 +25,41 @@ def options(opt):
Patrick Williamsddad1a12017-02-23 20:36:32 -060031 opt.PRIVATE_EXTENSION_DEFAULT('')
32 opt.RECURSE('buildtools/wafsamba')
33
34+ opt.add_option('--with-acl',
35+ help=("Enable use of acl"),
36+ action="store_true", dest='enable_acl')
37+ opt.add_option('--without-acl',
38+ help=("Disable use of acl"),
39+ action="store_false", dest='enable_acl', default=False)
40+
41+ opt.add_option('--with-attr',
42+ help=("Enable use of attr"),
43+ action="store_true", dest='enable_attr')
44+ opt.add_option('--without-attr',
45+ help=("Disable use of attr"),
46+ action="store_false", dest='enable_attr', default=False)
47+
48+ opt.add_option('--with-libaio',
49+ help=("Enable use of libaio"),
50+ action="store_true", dest='enable_libaio')
51+ opt.add_option('--without-libaio',
52+ help=("Disable use of libaio"),
53+ action="store_false", dest='enable_libaio', default=False)
54+
55+ opt.add_option('--with-libbsd',
56+ help=("Enable use of libbsd"),
57+ action="store_true", dest='enable_libbsd')
58+ opt.add_option('--without-libbsd',
59+ help=("Disable use of libbsd"),
60+ action="store_false", dest='enable_libbsd', default=False)
61+
62+ opt.add_option('--with-libcap',
63+ help=("Enable use of libcap"),
64+ action="store_true", dest='enable_libcap')
65+ opt.add_option('--without-libcap',
66+ help=("Disable use of libcap"),
67+ action="store_false", dest='enable_libcap', default=False)
68+
69 @Utils.run_once
70 def configure(conf):
71 conf.RECURSE('buildtools/wafsamba')
Brad Bishop19323692019-04-05 15:28:33 -040072@@ -34,12 +69,25 @@ def configure(conf):
Patrick Williamsddad1a12017-02-23 20:36:32 -060073 conf.DEFINE('HAVE_LIBREPLACE', 1)
74 conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
75
76- conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
77- conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
78+ conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080079+ conf.CHECK_HEADERS('attr/xattr.h compat.h ctype.h dustat.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -060080 conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
81- conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
82- conf.CHECK_HEADERS('shadow.h sys/acl.h')
83- conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
84+ conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
85+ conf.CHECK_HEADERS('shadow.h')
86+ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
87+
88+ if Options.options.enable_acl:
89+ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
90+
91+ if Options.options.enable_attr:
92+ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
93+
94+ if Options.options.enable_libaio:
95+ conf.CHECK_HEADERS('libaio.h')
96+
97+ if Options.options.enable_libcap:
98+ conf.CHECK_HEADERS('sys/capability.h')
99+
100 conf.CHECK_HEADERS('port.h')
Brad Bishop26bdd442019-08-16 17:08:17 -0400101 conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600102 conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
Brad Bishop26bdd442019-08-16 17:08:17 -0400103@@ -110,9 +158,10 @@ def configure(conf):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800104 conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
105 conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600106
Brad Bishop19323692019-04-05 15:28:33 -0400107- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
108- conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
Brad Bishop26bdd442019-08-16 17:08:17 -0400109- conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600110+ if Options.options.enable_valgrind:
Brad Bishop19323692019-04-05 15:28:33 -0400111+ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
112+ conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600113+
Patrick Williamsddad1a12017-02-23 20:36:32 -0600114 conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
115 conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
Brad Bishop26bdd442019-08-16 17:08:17 -0400116 conf.CHECK_HEADERS('syscall.h sys/syscall.h inttypes.h')
117@@ -380,20 +429,21 @@ def configure(conf):
Patrick Williamsddad1a12017-02-23 20:36:32 -0600118
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800119 strlcpy_in_bsd = False
Brad Bishop26bdd442019-08-16 17:08:17 -0400120
Patrick Williamsddad1a12017-02-23 20:36:32 -0600121- # libbsd on some platforms provides strlcpy and strlcat
122- if not conf.CHECK_FUNCS('strlcpy strlcat'):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800123- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
124- checklibc=True):
125- strlcpy_in_bsd = True
Patrick Williamsddad1a12017-02-23 20:36:32 -0600126- 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')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800130- if not conf.CHECK_FUNCS('setproctitle_init'):
131- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600132-
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'):
Brad Bishop19323692019-04-05 15:28:33 -0400138+ if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
139+ checklibc=True):
140+ strlcpy_in_bsd = True
Patrick Williamsddad1a12017-02-23 20:36:32 -0600141+ 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')
Brad Bishop19323692019-04-05 15:28:33 -0400145+ if not conf.CHECK_FUNCS('setproctitle_init'):
146+ conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600147+
148+ if not conf.CHECK_FUNCS('closefrom'):
149+ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
150
151 conf.CHECK_CODE('''
152 struct ucred cred;
153diff --git a/wscript b/wscript
Brad Bishop26bdd442019-08-16 17:08:17 -0400154index 5598d02..8d47244 100644
Patrick Williamsddad1a12017-02-23 20:36:32 -0600155--- a/wscript
156+++ b/wscript
Brad Bishop19323692019-04-05 15:28:33 -0400157@@ -69,6 +69,12 @@ def options(opt):
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500158 action="store_true", dest='disable_tdb_mutex_locking',
159 default=False)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800160
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500161+ 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)
Patrick Williamsddad1a12017-02-23 20:36:32 -0600167
168 def configure(conf):
169 conf.env.disable_tdb_mutex_locking = getattr(Options.options,
170--
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001712.7.4
Patrick Williamsddad1a12017-02-23 20:36:32 -0600172