blob: cb66adba9cbed843219d321320f2f8dbfc2ea379 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From d9fd1c52d1646254944bfee37be611e04d4daddb Mon Sep 17 00:00:00 2001
2From: Wang Mingyu <wangmy@cn.fujitsu.com>
3Date: Fri, 25 Dec 2020 15:03:17 +0900
4Subject: [PATCH] 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
22Update patch to version 0.10.0
23Signed-off-by: Changqing Li <changqing.li@windriver.com>
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060024
25Update patch to version 0.14.1
26Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Andrew Geissler517393d2023-01-13 08:55:19 -060027---
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060028 lib/replace/wscript | 85 +++++++++++++++++++++++++++++++++++----------
Andrew Geissler517393d2023-01-13 08:55:19 -060029 wscript | 6 ++++
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060030 2 files changed, 73 insertions(+), 18 deletions(-)
Andrew Geissler517393d2023-01-13 08:55:19 -060031
32diff --git a/lib/replace/wscript b/lib/replace/wscript
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060033index 5c2b750..28835ac 100644
Andrew Geissler517393d2023-01-13 08:55:19 -060034--- a/lib/replace/wscript
35+++ b/lib/replace/wscript
36@@ -25,6 +25,41 @@ def options(opt):
37 opt.PRIVATE_EXTENSION_DEFAULT('')
38 opt.RECURSE('buildtools/wafsamba')
39
40+ opt.add_option('--with-acl',
41+ help=("Enable use of acl"),
42+ action="store_true", dest='enable_acl')
43+ opt.add_option('--without-acl',
44+ help=("Disable use of acl"),
45+ action="store_false", dest='enable_acl', default=False)
46+
47+ opt.add_option('--with-attr',
48+ help=("Enable use of attr"),
49+ action="store_true", dest='enable_attr')
50+ opt.add_option('--without-attr',
51+ help=("Disable use of attr"),
52+ action="store_false", dest='enable_attr', default=False)
53+
54+ opt.add_option('--with-libaio',
55+ help=("Enable use of libaio"),
56+ action="store_true", dest='enable_libaio')
57+ opt.add_option('--without-libaio',
58+ help=("Disable use of libaio"),
59+ action="store_false", dest='enable_libaio', default=False)
60+
61+ opt.add_option('--with-libbsd',
62+ help=("Enable use of libbsd"),
63+ action="store_true", dest='enable_libbsd')
64+ opt.add_option('--without-libbsd',
65+ help=("Disable use of libbsd"),
66+ action="store_false", dest='enable_libbsd', default=False)
67+
68+ opt.add_option('--with-libcap',
69+ help=("Enable use of libcap"),
70+ action="store_true", dest='enable_libcap')
71+ opt.add_option('--without-libcap',
72+ help=("Disable use of libcap"),
73+ action="store_false", dest='enable_libcap', default=False)
74+
75 @Utils.run_once
76 def configure(conf):
77 conf.RECURSE('buildtools/wafsamba')
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060078@@ -38,12 +73,27 @@ def configure(conf):
Andrew Geissler517393d2023-01-13 08:55:19 -060079 conf.DEFINE('HAVE_LIBREPLACE', 1)
80 conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
81
82- conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
83- conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
84+ conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h')
85+ conf.CHECK_HEADERS('compat.h ctype.h dustat.h')
86 conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
87 conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060088 conf.CHECK_HEADERS('shadow.h sys/acl.h')
89 conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
Andrew Geissler517393d2023-01-13 08:55:19 -060090+ conf.CHECK_HEADERS('shadow.h')
91+ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
92+
93+ if Options.options.enable_acl:
94+ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
95+
96+ if Options.options.enable_attr:
97+ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
98+
99+ if Options.options.enable_libaio:
100+ conf.CHECK_HEADERS('libaio.h')
101+
102+ if Options.options.enable_libcap:
103+ conf.CHECK_HEADERS('sys/capability.h')
104+
Andrew Geissler517393d2023-01-13 08:55:19 -0600105 conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h')
106 conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600107 conf.CHECK_HEADERS('sys/resource.h sys/security.h sys/shm.h sys/statfs.h sys/statvfs.h sys/termio.h')
108@@ -113,8 +163,9 @@ def configure(conf):
Andrew Geissler517393d2023-01-13 08:55:19 -0600109 conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
110 conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
111
112- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
113- conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
114+ if Options.options.enable_valgrind:
115+ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h')
116+ conf.CHECK_HEADERS('valgrind/memcheck.h valgrind/helgrind.h')
117 conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
118 conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
119 conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600120@@ -436,20 +487,18 @@ def configure(conf):
Andrew Geissler517393d2023-01-13 08:55:19 -0600121
122 strlcpy_in_bsd = False
123
124- # libbsd on some platforms provides strlcpy and strlcat
125- if not conf.CHECK_FUNCS('strlcpy strlcat'):
126- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
127- checklibc=True):
128- strlcpy_in_bsd = True
129- if not conf.CHECK_FUNCS('getpeereid'):
130- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
131- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
132- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
133- if not conf.CHECK_FUNCS('setproctitle_init'):
134- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
135-
136- if not conf.CHECK_FUNCS('closefrom'):
137- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
138+ if Options.options.enable_libbsd:
139+ # libbsd on some platforms provides strlcpy and strlcat
140+ if not conf.CHECK_FUNCS('strlcpy strlcat'):
141+ conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
142+ checklibc=True)
143+ if not conf.CHECK_FUNCS('getpeereid'):
144+ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
145+ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
146+ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
147+
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
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600154index 0f6e92f..5a54f3a 100644
Andrew Geissler517393d2023-01-13 08:55:19 -0600155--- a/wscript
156+++ b/wscript
157@@ -28,6 +28,12 @@ def options(opt):
158 opt.RECURSE('lib/replace')
159 opt.RECURSE('lib/talloc')
160
161+ opt.add_option('--with-valgrind',
162+ help=("enable use of valgrind"),
163+ action="store_true", dest='enable_valgrind')
164+ opt.add_option('--without-valgrind',
165+ help=("disable use of valgrind"),
166+ action="store_false", dest='enable_valgrind', default=False)
167
168 def configure(conf):
169 conf.RECURSE('lib/replace')
170--
Andrew Geissler6aa7eec2023-03-03 12:41:14 -06001712.34.1
Andrew Geissler517393d2023-01-13 08:55:19 -0600172