blob: 3847b013e866c1c271e4451badf6c941bb9e4c51 [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From c6d76c8ade57b996a8123b1c1a3a28ba4666e9c6 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 20 Jun 2019 10:57:06 +0800
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08004Subject: [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
Brad Bishop26bdd442019-08-16 17:08:17 -040022Modified tp apply to version 2.2.0
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080023Signed-off-by: Changqing Li <changqing.li@windriver.com>
24---
Brad Bishop26bdd442019-08-16 17:08:17 -040025 lib/replace/wscript | 91 ++++++++++++++++++++++++++++++++++++++++-------------
26 wscript | 7 ++++-
27 2 files changed, 76 insertions(+), 22 deletions(-)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080028
29diff --git a/lib/replace/wscript b/lib/replace/wscript
Brad Bishop26bdd442019-08-16 17:08:17 -040030index 1d01e1e..7bc7666 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080031--- a/lib/replace/wscript
32+++ b/lib/replace/wscript
Brad Bishop26bdd442019-08-16 17:08:17 -040033@@ -25,6 +25,41 @@ def options(opt):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034 opt.PRIVATE_EXTENSION_DEFAULT('')
35 opt.RECURSE('buildtools/wafsamba')
Brad Bishop26bdd442019-08-16 17:08:17 -040036
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037+ 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)
Brad Bishop26bdd442019-08-16 17:08:17 -040071+
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080072 @Utils.run_once
73 def configure(conf):
Brad Bishop26bdd442019-08-16 17:08:17 -040074 conf.RECURSE('buildtools/wafsamba')
75@@ -34,12 +69,25 @@ def configure(conf):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080076 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')
Brad Bishop26bdd442019-08-16 17:08:17 -0400104 conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800105 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 Bishop26bdd442019-08-16 17:08:17 -0400106@@ -110,8 +158,9 @@ def configure(conf):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800107 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
Brad Bishop26bdd442019-08-16 17:08:17 -0400110- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
111- conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800112+ if Options.options.enable_valgrind:
Brad Bishop26bdd442019-08-16 17:08:17 -0400113+ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
114+ conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800115 conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
116 conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
117 conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
Brad Bishop26bdd442019-08-16 17:08:17 -0400118@@ -380,20 +429,20 @@ def configure(conf):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800119
120 strlcpy_in_bsd = False
121
122- # libbsd on some platforms provides strlcpy and strlcat
123- if not conf.CHECK_FUNCS('strlcpy strlcat'):
124- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
125- checklibc=True):
126- strlcpy_in_bsd = True
127- if not conf.CHECK_FUNCS('getpeereid'):
128- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
129- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
130- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
131- if not conf.CHECK_FUNCS('setproctitle_init'):
132- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
133-
134- if not conf.CHECK_FUNCS('closefrom'):
135- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
136+ if Options.options.enable_libbsd:
137+ # libbsd on some platforms provides strlcpy and strlcat
138+ if not conf.CHECK_FUNCS('strlcpy strlcat'):
139+ if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
140+ checklibc=True):
141+ strlcpy_in_bsd = 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+ if not conf.CHECK_FUNCS('setproctitle_init'):
147+ conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
148+ if not conf.CHECK_FUNCS('closefrom'):
149+ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
150
151 conf.CHECK_CODE('''
152 struct ucred cred;
153diff --git a/wscript b/wscript
Brad Bishop26bdd442019-08-16 17:08:17 -0400154index e402069..9976f4c 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800155--- a/wscript
156+++ b/wscript
Brad Bishop26bdd442019-08-16 17:08:17 -0400157@@ -31,7 +31,12 @@ def options(opt):
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800158 opt.add_option('--enable-talloc-compat1',
159 help=("Build talloc 1.x.x compat library [False]"),
160 action="store_true", dest='TALLOC_COMPAT1', default=False)
Brad Bishop26bdd442019-08-16 17:08:17 -0400161-
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800162+ opt.add_option('--with-valgrind',
163+ help=("enable use of valgrind"),
164+ action="store_true", dest='enable_valgrind')
165+ opt.add_option('--without-valgrind',
166+ help=("disable use of valgrind"),
167+ action="store_false", dest='enable_valgrind', default=False)
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800168
169 def configure(conf):
Brad Bishop26bdd442019-08-16 17:08:17 -0400170 conf.RECURSE('lib/replace')
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800171--
1722.7.4
173