blob: df45d36e96121d7d1644c0247c4698a38e4bfc8f [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 319a2a1bb46ae35fa9d66878cb08285035f0bd5f Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Thu, 19 Jul 2018 15:41:31 +0800
4Subject: [PATCH] talloc: 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
18Modified to apply to version 2.1.10.
19
20Signed-off-by: Joe Slater <joe.slater@windriver.com>
21
22Modified tp apply to version 2.1.14
23Signed-off-by: Changqing Li <changqing.li@windriver.com>
24---
25 lib/replace/wscript | 90 +++++++++++++++++++++++++++++++++++++++++------------
26 wscript | 7 +++++
27 2 files changed, 77 insertions(+), 20 deletions(-)
28
29diff --git a/lib/replace/wscript b/lib/replace/wscript
30index fd00a42..a77c058 100644
31--- a/lib/replace/wscript
32+++ b/lib/replace/wscript
33@@ -22,6 +22,41 @@ def set_options(opt):
34 opt.BUILTIN_DEFAULT('NONE')
35 opt.PRIVATE_EXTENSION_DEFAULT('')
36 opt.RECURSE('buildtools/wafsamba')
37+
38+ opt.add_option('--with-acl',
39+ help=("Enable use of acl"),
40+ action="store_true", dest='enable_acl')
41+ opt.add_option('--without-acl',
42+ help=("Disable use of acl"),
43+ action="store_false", dest='enable_acl', default=False)
44+
45+ opt.add_option('--with-attr',
46+ help=("Enable use of attr"),
47+ action="store_true", dest='enable_attr')
48+ opt.add_option('--without-attr',
49+ help=("Disable use of attr"),
50+ action="store_false", dest='enable_attr', default=False)
51+
52+ opt.add_option('--with-libaio',
53+ help=("Enable use of libaio"),
54+ action="store_true", dest='enable_libaio')
55+ opt.add_option('--without-libaio',
56+ help=("Disable use of libaio"),
57+ action="store_false", dest='enable_libaio', default=False)
58+
59+ opt.add_option('--with-libbsd',
60+ help=("Enable use of libbsd"),
61+ action="store_true", dest='enable_libbsd')
62+ opt.add_option('--without-libbsd',
63+ help=("Disable use of libbsd"),
64+ action="store_false", dest='enable_libbsd', default=False)
65+
66+ opt.add_option('--with-libcap',
67+ help=("Enable use of libcap"),
68+ action="store_true", dest='enable_libcap')
69+ opt.add_option('--without-libcap',
70+ help=("Disable use of libcap"),
71+ action="store_false", dest='enable_libcap', default=False)
72
73 @Utils.run_once
74 def configure(conf):
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')
82+ conf.CHECK_HEADERS('attr/xattr.h compat.h ctype.h dustat.h')
83 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')
106@@ -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')
109
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')
117@@ -342,20 +392,20 @@ def configure(conf):
118
119 strlcpy_in_bsd = False
120
121- # libbsd on some platforms provides strlcpy and strlcat
122- if not conf.CHECK_FUNCS('strlcpy strlcat'):
123- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
124- checklibc=True):
125- strlcpy_in_bsd = True
126- 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')
130- if not conf.CHECK_FUNCS('setproctitle_init'):
131- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
132-
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+ if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
139+ checklibc=True):
140+ strlcpy_in_bsd = True
141+ 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')
145+ if not conf.CHECK_FUNCS('setproctitle_init'):
146+ conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
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 18f726e..fed8ab9 100644
154--- a/wscript
155+++ b/wscript
156@@ -32,6 +32,13 @@ def set_options(opt):
157 opt.add_option('--enable-talloc-compat1',
158 help=("Build talloc 1.x.x compat library [False]"),
159 action="store_true", dest='TALLOC_COMPAT1', default=False)
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
168
169 def configure(conf):
170--
1712.7.4
172