blob: 363c5867cc505821a195695996e68d02fb492564 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From c3e2e4f89cf37b27609fd02ad67eb02d0015cc1e Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Wed, 21 Sep 2016 09:57:49 +0800
4Subject: [PATCH 1/1] tevent: 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 0.9.33.
19
20Signed-off-by: Joe Slater <joe.slater@windriver.com>
21---
22 lib/replace/wscript | 89 ++++++++++++++++++++++++++++++++++++++++-------------
23 wscript | 7 ++++-
24 2 files changed, 73 insertions(+), 23 deletions(-)
25
26diff --git a/lib/replace/wscript b/lib/replace/wscript
27index 2c638b7..079761d 100644
28--- a/lib/replace/wscript
29+++ b/lib/replace/wscript
30@@ -23,6 +23,41 @@ def set_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@@ -32,12 +67,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('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('libaio.h 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('locale.h ndir.h pwd.h')
85+ conf.CHECK_HEADERS('shadow.h')
86+ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
87+
88+ if Options.options.enable_acl:
89+ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
90+
91+ if Options.options.enable_attr:
92+ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
93+
94+ if Options.options.enable_libaio:
95+ conf.CHECK_HEADERS('libaio.h')
96+
97+ if Options.options.enable_libcap:
98+ conf.CHECK_HEADERS('sys/capability.h')
99+
100 conf.CHECK_HEADERS('port.h')
101 conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
102 conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
103@@ -101,7 +149,8 @@ def configure(conf):
104 conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
105 conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
106
107- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
108+ if Options.options.enable_valgrind:
109+ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
110 conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
111 conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
112 conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
113@@ -294,22 +343,18 @@ def configure(conf):
114
115 conf.CHECK_FUNCS('prctl dirname basename')
116
117- strlcpy_in_bsd = False
118-
119- # libbsd on some platforms provides strlcpy and strlcat
120- if not conf.CHECK_FUNCS('strlcpy strlcat'):
121- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
122- checklibc=True):
123- strlcpy_in_bsd = True
124- if not conf.CHECK_FUNCS('getpeereid'):
125- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
126- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
127- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
128- if not conf.CHECK_FUNCS('setproctitle_init'):
129- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
130+ if Options.options.enable_libbsd:
131+ # libbsd on some platforms provides strlcpy and strlcat
132+ if not conf.CHECK_FUNCS('strlcpy strlcat'):
133+ conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
134+ checklibc=True)
135+ if not conf.CHECK_FUNCS('getpeereid'):
136+ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
137+ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
138+ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
139
140- if not conf.CHECK_FUNCS('closefrom'):
141- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
142+ if not conf.CHECK_FUNCS('closefrom'):
143+ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
144
145 conf.CHECK_CODE('''
146 struct ucred cred;
147@@ -660,7 +705,7 @@ removeea setea
148 # look for a method of finding the list of network interfaces
149 for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
150 bsd_for_strlcpy = ''
151- if strlcpy_in_bsd:
152+ if Options.options.enable_libbsd:
153 bsd_for_strlcpy = ' bsd'
154 if conf.CHECK_CODE('''
155 #define %s 1
156diff --git a/wscript b/wscript
157index 94d190f..742f779 100644
158--- a/wscript
159+++ b/wscript
160@@ -22,7 +22,12 @@ def set_options(opt):
161 opt.PRIVATE_EXTENSION_DEFAULT('tevent', noextension='tevent')
162 opt.RECURSE('lib/replace')
163 opt.RECURSE('lib/talloc')
164-
165+ opt.add_option('--with-valgrind',
166+ help=("enable use of valgrind"),
167+ action="store_true", dest='enable_valgrind')
168+ opt.add_option('--without-valgrind',
169+ help=("disable use of valgrind"),
170+ action="store_false", dest='enable_valgrind', default=False)
171
172 def configure(conf):
173 conf.RECURSE('lib/replace')
174--
1752.16.2
176