blob: e6e10238f1cfd0da2f7cca4b1e9b9298209f4998 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From 13bbc851d9fd7396f087758e614abba60eeb2aad Mon Sep 17 00:00:00 2001
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08002From: Changqing Li <changqing.li@windriver.com>
Brad Bishop19323692019-04-05 15:28:33 -04003Date: Wed, 23 Jan 2019 10:14:05 +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
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>
Brad Bishop19323692019-04-05 15:28:33 -040024
25Update for libtdb_1.3.17
26Signed-off-by: Changqing Li <changqing.li@windriver.com>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027---
Brad Bishop19323692019-04-05 15:28:33 -040028 lib/replace/wscript | 95 ++++++++++++++++++++++++++++++++++++++++-------------
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080029 wscript | 6 ++++
Brad Bishop19323692019-04-05 15:28:33 -040030 2 files changed, 79 insertions(+), 22 deletions(-)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080031
Patrick Williamsddad1a12017-02-23 20:36:32 -060032diff --git a/lib/replace/wscript b/lib/replace/wscript
Brad Bishop19323692019-04-05 15:28:33 -040033index 6cbae93..7aeaf46 100644
Patrick Williamsddad1a12017-02-23 20:36:32 -060034--- a/lib/replace/wscript
35+++ b/lib/replace/wscript
Brad Bishop19323692019-04-05 15:28:33 -040036@@ -25,6 +25,41 @@ def options(opt):
Patrick Williamsddad1a12017-02-23 20:36:32 -060037 opt.PRIVATE_EXTENSION_DEFAULT('')
38 opt.RECURSE('buildtools/wafsamba')
39
40+ opt.add_option('--with-acl',
41+ help=("Enable use of acl"),
42+ action="store_true", dest='enable_acl')
43+ opt.add_option('--without-acl',
44+ help=("Disable use of acl"),
45+ action="store_false", dest='enable_acl', default=False)
46+
47+ opt.add_option('--with-attr',
48+ help=("Enable use of attr"),
49+ action="store_true", dest='enable_attr')
50+ opt.add_option('--without-attr',
51+ help=("Disable use of attr"),
52+ action="store_false", dest='enable_attr', default=False)
53+
54+ opt.add_option('--with-libaio',
55+ help=("Enable use of libaio"),
56+ action="store_true", dest='enable_libaio')
57+ opt.add_option('--without-libaio',
58+ help=("Disable use of libaio"),
59+ action="store_false", dest='enable_libaio', default=False)
60+
61+ opt.add_option('--with-libbsd',
62+ help=("Enable use of libbsd"),
63+ action="store_true", dest='enable_libbsd')
64+ opt.add_option('--without-libbsd',
65+ help=("Disable use of libbsd"),
66+ action="store_false", dest='enable_libbsd', default=False)
67+
68+ opt.add_option('--with-libcap',
69+ help=("Enable use of libcap"),
70+ action="store_true", dest='enable_libcap')
71+ opt.add_option('--without-libcap',
72+ help=("Disable use of libcap"),
73+ action="store_false", dest='enable_libcap', default=False)
74+
75 @Utils.run_once
76 def configure(conf):
77 conf.RECURSE('buildtools/wafsamba')
Brad Bishop19323692019-04-05 15:28:33 -040078@@ -34,12 +69,25 @@ def configure(conf):
Patrick Williamsddad1a12017-02-23 20:36:32 -060079 conf.DEFINE('HAVE_LIBREPLACE', 1)
80 conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
81
82- conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
83- conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
84+ conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080085+ conf.CHECK_HEADERS('attr/xattr.h compat.h ctype.h dustat.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -060086 conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
87- conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
88- conf.CHECK_HEADERS('shadow.h sys/acl.h')
89- conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
90+ conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
91+ conf.CHECK_HEADERS('shadow.h')
92+ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
93+
94+ if Options.options.enable_acl:
95+ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
96+
97+ if Options.options.enable_attr:
98+ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
99+
100+ if Options.options.enable_libaio:
101+ conf.CHECK_HEADERS('libaio.h')
102+
103+ if Options.options.enable_libcap:
104+ conf.CHECK_HEADERS('sys/capability.h')
105+
106 conf.CHECK_HEADERS('port.h')
107 conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
108 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 Bishop19323692019-04-05 15:28:33 -0400109@@ -110,8 +158,10 @@ def configure(conf):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800110 conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
111 conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600112
Brad Bishop19323692019-04-05 15:28:33 -0400113- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
114- conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600115+ if Options.options.enable_valgrind:
Brad Bishop19323692019-04-05 15:28:33 -0400116+ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
117+ conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600118+
119 conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
120 conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
121 conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
Brad Bishop19323692019-04-05 15:28:33 -0400122@@ -379,21 +429,22 @@ def configure(conf):
123 conf.CHECK_FUNCS('prctl dirname basename')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600124
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800125 strlcpy_in_bsd = False
Brad Bishop19323692019-04-05 15:28:33 -0400126-
Patrick Williamsddad1a12017-02-23 20:36:32 -0600127- # libbsd on some platforms provides strlcpy and strlcat
128- if not conf.CHECK_FUNCS('strlcpy strlcat'):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800129- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
130- checklibc=True):
131- strlcpy_in_bsd = True
Patrick Williamsddad1a12017-02-23 20:36:32 -0600132- if not conf.CHECK_FUNCS('getpeereid'):
133- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
134- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
135- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800136- if not conf.CHECK_FUNCS('setproctitle_init'):
137- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600138-
139- if not conf.CHECK_FUNCS('closefrom'):
140- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
Brad Bishop19323692019-04-05 15:28:33 -0400141+
Patrick Williamsddad1a12017-02-23 20:36:32 -0600142+ if Options.options.enable_libbsd:
143+ # libbsd on some platforms provides strlcpy and strlcat
144+ if not conf.CHECK_FUNCS('strlcpy strlcat'):
Brad Bishop19323692019-04-05 15:28:33 -0400145+ if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
146+ checklibc=True):
147+ strlcpy_in_bsd = True
Patrick Williamsddad1a12017-02-23 20:36:32 -0600148+ if not conf.CHECK_FUNCS('getpeereid'):
149+ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
150+ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
151+ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
Brad Bishop19323692019-04-05 15:28:33 -0400152+ if not conf.CHECK_FUNCS('setproctitle_init'):
153+ conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
Patrick Williamsddad1a12017-02-23 20:36:32 -0600154+
155+ if not conf.CHECK_FUNCS('closefrom'):
156+ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
157
158 conf.CHECK_CODE('''
159 struct ucred cred;
160diff --git a/wscript b/wscript
Brad Bishop19323692019-04-05 15:28:33 -0400161index bc5ee26..9ac10b6 100644
Patrick Williamsddad1a12017-02-23 20:36:32 -0600162--- a/wscript
163+++ b/wscript
Brad Bishop19323692019-04-05 15:28:33 -0400164@@ -69,6 +69,12 @@ def options(opt):
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500165 action="store_true", dest='disable_tdb_mutex_locking',
166 default=False)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800167
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500168+ opt.add_option('--with-valgrind',
169+ help=("enable use of valgrind"),
170+ action="store_true", dest='enable_valgrind')
171+ opt.add_option('--without-valgrind',
172+ help=("disable use of valgrind"),
173+ action="store_false", dest='enable_valgrind', default=False)
Patrick Williamsddad1a12017-02-23 20:36:32 -0600174
175 def configure(conf):
176 conf.env.disable_tdb_mutex_locking = getattr(Options.options,
177--
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001782.7.4
Patrick Williamsddad1a12017-02-23 20:36:32 -0600179