blob: 365b92da25329c66f6d60e40dd745ed214dc2a76 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 6de1affddde4003a956523c330ecf24e22e094ac Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 19 Jul 2018 16:20:32 +0800
4Subject: [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
18Update for libtdb_1.3.14.
19
20Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
Patrick Williamsddad1a12017-02-23 20:36:32 -060021
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022Update for libtdb_1.3.16
23Signed-off-by: Changqing Li <changqing.li@windriver.com>
24---
25 lib/replace/wscript | 89 +++++++++++++++++++++++++++++++++++++++++------------
26 wscript | 6 ++++
27 2 files changed, 75 insertions(+), 20 deletions(-)
28
Patrick Williamsddad1a12017-02-23 20:36:32 -060029diff --git a/lib/replace/wscript b/lib/replace/wscript
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080030index fd00a42..2df83cd 100644
Patrick Williamsddad1a12017-02-23 20:36:32 -060031--- a/lib/replace/wscript
32+++ b/lib/replace/wscript
33@@ -23,6 +23,41 @@ def set_options(opt):
34 opt.PRIVATE_EXTENSION_DEFAULT('')
35 opt.RECURSE('buildtools/wafsamba')
36
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)
71+
72 @Utils.run_once
73 def configure(conf):
74 conf.RECURSE('buildtools/wafsamba')
75@@ -32,12 +67,25 @@ def configure(conf):
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')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080082+ conf.CHECK_HEADERS('attr/xattr.h compat.h ctype.h dustat.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -060083 conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
84- conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
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')
87+ conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
88+ conf.CHECK_HEADERS('shadow.h')
89+ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
90+
91+ if Options.options.enable_acl:
92+ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
93+
94+ if Options.options.enable_attr:
95+ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
96+
97+ if Options.options.enable_libaio:
98+ conf.CHECK_HEADERS('libaio.h')
99+
100+ if Options.options.enable_libcap:
101+ conf.CHECK_HEADERS('sys/capability.h')
102+
103 conf.CHECK_HEADERS('port.h')
104 conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
105 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 Bishop1a4b7ee2018-12-16 17:11:34 -0800106@@ -108,7 +156,9 @@ def configure(conf):
107 conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
108 conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600109
110- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
111+ if Options.options.enable_valgrind:
112+ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
113+
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')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800117@@ -342,20 +392,19 @@ def configure(conf):
Patrick Williamsddad1a12017-02-23 20:36:32 -0600118
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800119 strlcpy_in_bsd = False
Patrick Williamsddad1a12017-02-23 20:36:32 -0600120
121- # 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'):
138+ conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
139+ checklibc=True)
140+ if not conf.CHECK_FUNCS('getpeereid'):
141+ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
142+ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
143+ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
144+
145+ if not conf.CHECK_FUNCS('closefrom'):
146+ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800147+
Patrick Williamsddad1a12017-02-23 20:36:32 -0600148
149 conf.CHECK_CODE('''
150 struct ucred cred;
151diff --git a/wscript b/wscript
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800152index 6505648..6608481 100644
Patrick Williamsddad1a12017-02-23 20:36:32 -0600153--- a/wscript
154+++ b/wscript
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800155@@ -63,6 +63,12 @@ def set_options(opt):
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500156 action="store_true", dest='disable_tdb_mutex_locking',
157 default=False)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800158
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500159+ opt.add_option('--with-valgrind',
160+ help=("enable use of valgrind"),
161+ action="store_true", dest='enable_valgrind')
162+ opt.add_option('--without-valgrind',
163+ help=("disable use of valgrind"),
164+ action="store_false", dest='enable_valgrind', default=False)
Patrick Williamsddad1a12017-02-23 20:36:32 -0600165
166 def configure(conf):
167 conf.env.disable_tdb_mutex_locking = getattr(Options.options,
168--
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001692.7.4
Patrick Williamsddad1a12017-02-23 20:36:32 -0600170