blob: 882af0644ae00bd55749399441519e6b90acbbca [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From b2b19aa9968258b22cf31db0b9dba6bcf96046cf Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 20 Jun 2019 13:55:44 +0800
4Subject: [PATCH] Add configure options for packages
Brad Bishop316dfdd2018-06-25 12:45:53 -04005
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 0.9.33.
19
20Signed-off-by: Joe Slater <joe.slater@windriver.com>
Brad Bishop26bdd442019-08-16 17:08:17 -040021
22Update patch to version 0.10.0
23Signed-off-by: Changqing Li <changqing.li@windriver.com>
Brad Bishop316dfdd2018-06-25 12:45:53 -040024---
25 lib/replace/wscript | 89 ++++++++++++++++++++++++++++++++++++++++-------------
Brad Bishop26bdd442019-08-16 17:08:17 -040026 wscript | 6 ++++
27 2 files changed, 74 insertions(+), 21 deletions(-)
Brad Bishop316dfdd2018-06-25 12:45:53 -040028
29diff --git a/lib/replace/wscript b/lib/replace/wscript
Brad Bishop26bdd442019-08-16 17:08:17 -040030index 1d01e1e..5cf444a 100644
Brad Bishop316dfdd2018-06-25 12:45:53 -040031--- 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 Bishop316dfdd2018-06-25 12:45:53 -040034 opt.PRIVATE_EXTENSION_DEFAULT('')
35 opt.RECURSE('buildtools/wafsamba')
36
37+ 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)
71+
72 @Utils.run_once
73 def configure(conf):
74 conf.RECURSE('buildtools/wafsamba')
Brad Bishop26bdd442019-08-16 17:08:17 -040075@@ -34,12 +69,25 @@ def configure(conf):
Brad Bishop316dfdd2018-06-25 12:45:53 -040076 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('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 Bishop316dfdd2018-06-25 12:45:53 -0400105 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 Bishop316dfdd2018-06-25 12:45:53 -0400107 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 Bishop316dfdd2018-06-25 12:45:53 -0400112+ 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 Bishop316dfdd2018-06-25 12:45:53 -0400115 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,18 @@ def configure(conf):
Brad Bishop316dfdd2018-06-25 12:45:53 -0400119
Brad Bishop26bdd442019-08-16 17:08:17 -0400120 strlcpy_in_bsd = False
Brad Bishop316dfdd2018-06-25 12:45:53 -0400121
Brad Bishop316dfdd2018-06-25 12:45:53 -0400122- # 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')
Brad Bishop26bdd442019-08-16 17:08:17 -0400133-
134- if not conf.CHECK_FUNCS('closefrom'):
135- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
Brad Bishop316dfdd2018-06-25 12:45:53 -0400136+ if Options.options.enable_libbsd:
137+ # libbsd on some platforms provides strlcpy and strlcat
138+ if not conf.CHECK_FUNCS('strlcpy strlcat'):
139+ conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
140+ checklibc=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')
Brad Bishop26bdd442019-08-16 17:08:17 -0400145+
Brad Bishop316dfdd2018-06-25 12:45:53 -0400146+ if not conf.CHECK_FUNCS('closefrom'):
147+ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
148
149 conf.CHECK_CODE('''
150 struct ucred cred;
Brad Bishop316dfdd2018-06-25 12:45:53 -0400151diff --git a/wscript b/wscript
Brad Bishop26bdd442019-08-16 17:08:17 -0400152index ded182a..824a6dd 100644
Brad Bishop316dfdd2018-06-25 12:45:53 -0400153--- a/wscript
154+++ b/wscript
Brad Bishop26bdd442019-08-16 17:08:17 -0400155@@ -25,6 +25,12 @@ def options(opt):
Brad Bishop316dfdd2018-06-25 12:45:53 -0400156 opt.RECURSE('lib/replace')
157 opt.RECURSE('lib/talloc')
Brad Bishop26bdd442019-08-16 17:08:17 -0400158
Brad Bishop316dfdd2018-06-25 12:45:53 -0400159+ opt.add_option('--with-valgrind',
160+ help=("enable use of valgrind"),
161+ action="store_true", dest='enable_valgrind')
162+ opt.add_option('--without-valgrind',
163+ help=("disable use of valgrind"),
164+ action="store_false", dest='enable_valgrind', default=False)
165
166 def configure(conf):
167 conf.RECURSE('lib/replace')
168--
Brad Bishop26bdd442019-08-16 17:08:17 -04001692.7.4
Brad Bishop316dfdd2018-06-25 12:45:53 -0400170