blob: 272921e568a8250e399c0d12c57fd2e325fd5212 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 24911f36bcb00412e5dc4cd11fda139e09d58798 Mon Sep 17 00:00:00 2001
2From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
3Date: Tue, 1 Aug 2017 03:12:09 +0900
4Subject: [PATCH] From 10ac5e5fdda44adcc2a159b6f9a2d51a51361057 Mon Sep 17
5 00:00:00 2001 From: Jackie Huang <jackie.huang@windriver.com> Date: Wed, 21
6 Sep 2016 10:46:19 +0800 Subject: [PATCH] tdb: Add configure options for
7 packages
Patrick Williamsddad1a12017-02-23 20:36:32 -06008
9Add configure options for the following packages:
10 - acl
11 - attr
12 - libaio
13 - libbsd
14 - libcap
15 - valgrind
16
17Upstream-Status: Inappropriate [oe deterministic build specific]
18
19Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020
21Update for libtdb_1.3.14.
22
23Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
Patrick Williamsddad1a12017-02-23 20:36:32 -060024---
25 lib/replace/system/wscript_configure | 6 ++-
26 lib/replace/wscript | 85 ++++++++++++++++++++++++++++--------
27 wscript | 7 ++-
28 3 files changed, 79 insertions(+), 19 deletions(-)
29
30diff --git a/lib/replace/system/wscript_configure b/lib/replace/system/wscript_configure
31index 2035474..10f9ae7 100644
32--- a/lib/replace/system/wscript_configure
33+++ b/lib/replace/system/wscript_configure
34@@ -1,6 +1,10 @@
35 #!/usr/bin/env python
36
37-conf.CHECK_HEADERS('sys/capability.h')
38+import Options
39+
40+if Options.options.enable_libcap:
41+ conf.CHECK_HEADERS('sys/capability.h')
42+
43 conf.CHECK_FUNCS('getpwnam_r getpwuid_r getpwent_r')
44
45 # solaris varients of getXXent_r
46diff --git a/lib/replace/wscript b/lib/replace/wscript
Brad Bishopd7bf8c12018-02-25 22:55:05 -050047index 7c50e1d..15df5c3 100644
Patrick Williamsddad1a12017-02-23 20:36:32 -060048--- a/lib/replace/wscript
49+++ b/lib/replace/wscript
50@@ -23,6 +23,41 @@ def set_options(opt):
51 opt.PRIVATE_EXTENSION_DEFAULT('')
52 opt.RECURSE('buildtools/wafsamba')
53
54+ opt.add_option('--with-acl',
55+ help=("Enable use of acl"),
56+ action="store_true", dest='enable_acl')
57+ opt.add_option('--without-acl',
58+ help=("Disable use of acl"),
59+ action="store_false", dest='enable_acl', default=False)
60+
61+ opt.add_option('--with-attr',
62+ help=("Enable use of attr"),
63+ action="store_true", dest='enable_attr')
64+ opt.add_option('--without-attr',
65+ help=("Disable use of attr"),
66+ action="store_false", dest='enable_attr', default=False)
67+
68+ opt.add_option('--with-libaio',
69+ help=("Enable use of libaio"),
70+ action="store_true", dest='enable_libaio')
71+ opt.add_option('--without-libaio',
72+ help=("Disable use of libaio"),
73+ action="store_false", dest='enable_libaio', default=False)
74+
75+ opt.add_option('--with-libbsd',
76+ help=("Enable use of libbsd"),
77+ action="store_true", dest='enable_libbsd')
78+ opt.add_option('--without-libbsd',
79+ help=("Disable use of libbsd"),
80+ action="store_false", dest='enable_libbsd', default=False)
81+
82+ opt.add_option('--with-libcap',
83+ help=("Enable use of libcap"),
84+ action="store_true", dest='enable_libcap')
85+ opt.add_option('--without-libcap',
86+ help=("Disable use of libcap"),
87+ action="store_false", dest='enable_libcap', default=False)
88+
89 @Utils.run_once
90 def configure(conf):
91 conf.RECURSE('buildtools/wafsamba')
92@@ -32,12 +67,25 @@ def configure(conf):
93 conf.DEFINE('HAVE_LIBREPLACE', 1)
94 conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
95
96- conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
97- conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
98+ conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h')
99+ conf.CHECK_HEADERS('compat.h ctype.h dustat.h')
100 conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
101- conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
102- conf.CHECK_HEADERS('shadow.h sys/acl.h')
103- conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
104+ conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
105+ conf.CHECK_HEADERS('shadow.h')
106+ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
107+
108+ if Options.options.enable_acl:
109+ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
110+
111+ if Options.options.enable_attr:
112+ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
113+
114+ if Options.options.enable_libaio:
115+ conf.CHECK_HEADERS('libaio.h')
116+
117+ if Options.options.enable_libcap:
118+ conf.CHECK_HEADERS('sys/capability.h')
119+
120 conf.CHECK_HEADERS('port.h')
121 conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
122 conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
123@@ -73,7 +121,9 @@ def configure(conf):
124
125 conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H')
126
127- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
128+ if Options.options.enable_valgrind:
129+ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
130+
131 conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
132 conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
133 conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500134@@ -251,17 +301,18 @@ def configure(conf):
Patrick Williamsddad1a12017-02-23 20:36:32 -0600135
136 conf.CHECK_FUNCS('prctl dirname basename')
137
138- # libbsd on some platforms provides strlcpy and strlcat
139- if not conf.CHECK_FUNCS('strlcpy strlcat'):
140- conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
141- checklibc=True)
142- if not conf.CHECK_FUNCS('getpeereid'):
143- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
144- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
145- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
146-
147- if not conf.CHECK_FUNCS('closefrom'):
148- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
149+ if Options.options.enable_libbsd:
150+ # libbsd on some platforms provides strlcpy and strlcat
151+ if not conf.CHECK_FUNCS('strlcpy strlcat'):
152+ conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
153+ checklibc=True)
154+ if not conf.CHECK_FUNCS('getpeereid'):
155+ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
156+ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
157+ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
158+
159+ if not conf.CHECK_FUNCS('closefrom'):
160+ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
161
162 conf.CHECK_CODE('''
163 struct ucred cred;
164diff --git a/wscript b/wscript
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500165index 1c9655a..8c20d3b 100644
Patrick Williamsddad1a12017-02-23 20:36:32 -0600166--- a/wscript
167+++ b/wscript
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500168@@ -62,7 +62,12 @@ def set_options(opt):
169 help=("Disable the use of pthread robust mutexes"),
170 action="store_true", dest='disable_tdb_mutex_locking',
171 default=False)
Patrick Williamsddad1a12017-02-23 20:36:32 -0600172-
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500173+ opt.add_option('--with-valgrind',
174+ help=("enable use of valgrind"),
175+ action="store_true", dest='enable_valgrind')
176+ opt.add_option('--without-valgrind',
177+ help=("disable use of valgrind"),
178+ action="store_false", dest='enable_valgrind', default=False)
Patrick Williamsddad1a12017-02-23 20:36:32 -0600179
180 def configure(conf):
181 conf.env.disable_tdb_mutex_locking = getattr(Options.options,
182--
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001832.7.4
Patrick Williamsddad1a12017-02-23 20:36:32 -0600184