blob: 93a85e8545e3f099ba59fd985b1258102b0cb626 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From d3b1d23e01e323b9610843ab6bef096512f6c244 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Wed, 19 Jun 2019 17:53:34 +0800
4Subject: [PATCH] tdb: Add configure options for packages
5
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>
17
18Update to 1.4.0
19
20Signed-off-by: Changqing Li <changqing.li@windriver.com>
21---
22 lib/replace/wscript | 92 ++++++++++++++++++++++++++++++++++-----------
23 wscript | 6 +++
24 2 files changed, 77 insertions(+), 21 deletions(-)
25
26diff --git a/lib/replace/wscript b/lib/replace/wscript
27index 827d74f..70cde6f 100644
28--- a/lib/replace/wscript
29+++ b/lib/replace/wscript
30@@ -25,6 +25,41 @@ def options(opt):
31 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')
72@@ -35,12 +70,25 @@ def configure(conf):
73 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')
79+ conf.CHECK_HEADERS('attr/xattr.h compat.h ctype.h dustat.h')
80 conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
81 conf.CHECK_HEADERS('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('shadow.h')
85+ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
86+
87+ if Options.options.enable_acl:
88+ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
89+
90+ if Options.options.enable_attr:
91+ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
92+
93+ if Options.options.enable_libaio:
94+ conf.CHECK_HEADERS('libaio.h')
95+
96+ if Options.options.enable_libcap:
97+ conf.CHECK_HEADERS('sys/capability.h')
98+
99 conf.CHECK_HEADERS('port.h')
100 conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h')
101 conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
102@@ -110,9 +158,10 @@ def configure(conf):
103 conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
104 conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
105
106- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
107- conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
108- conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
109+ if Options.options.enable_valgrind:
110+ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
111+ conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
112+
113 conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
114 conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
115 conf.CHECK_HEADERS('syscall.h sys/syscall.h inttypes.h')
116@@ -431,20 +480,21 @@ def configure(conf):
117
118 strlcpy_in_bsd = False
119
120- # libbsd on some platforms provides strlcpy and strlcat
121- if not conf.CHECK_FUNCS('strlcpy strlcat'):
122- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
123- checklibc=True):
124- strlcpy_in_bsd = True
125- if not conf.CHECK_FUNCS('getpeereid'):
126- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
127- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
128- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
129- if not conf.CHECK_FUNCS('setproctitle_init'):
130- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
131-
132- if not conf.CHECK_FUNCS('closefrom'):
133- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
134+ if Options.options.enable_libbsd:
135+ # libbsd on some platforms provides strlcpy and strlcat
136+ if not conf.CHECK_FUNCS('strlcpy strlcat'):
137+ if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
138+ checklibc=True):
139+ strlcpy_in_bsd = 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+ if not conf.CHECK_FUNCS('setproctitle_init'):
145+ conf.CHECK_FUNCS_IN('setproctitle_init', '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
150 conf.CHECK_CODE('''
151 struct ucred cred;
152diff --git a/wscript b/wscript
153index 71ada31..10b16a7 100644
154--- a/wscript
155+++ b/wscript
156@@ -69,6 +69,12 @@ def options(opt):
157 action="store_true", dest='disable_tdb_mutex_locking',
158 default=False)
159
160+ opt.add_option('--with-valgrind',
161+ help=("enable use of valgrind"),
162+ action="store_true", dest='enable_valgrind')
163+ opt.add_option('--without-valgrind',
164+ help=("disable use of valgrind"),
165+ action="store_false", dest='enable_valgrind', default=False)
166
167 def configure(conf):
168 conf.env.disable_tdb_mutex_locking = getattr(Options.options,
169--
1702.25.1
171