Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 1 | From 10ac5e5fdda44adcc2a159b6f9a2d51a51361057 Mon Sep 17 00:00:00 2001 |
| 2 | From: Jackie Huang <jackie.huang@windriver.com> |
| 3 | Date: Wed, 21 Sep 2016 10:46:19 +0800 |
| 4 | Subject: [PATCH] tdb: Add configure options for packages |
| 5 | |
| 6 | Add configure options for the following packages: |
| 7 | - acl |
| 8 | - attr |
| 9 | - libaio |
| 10 | - libbsd |
| 11 | - libcap |
| 12 | - valgrind |
| 13 | |
| 14 | Upstream-Status: Inappropriate [oe deterministic build specific] |
| 15 | |
| 16 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
| 17 | --- |
| 18 | lib/replace/system/wscript_configure | 6 ++- |
| 19 | lib/replace/wscript | 85 ++++++++++++++++++++++++++++-------- |
| 20 | wscript | 7 ++- |
| 21 | 3 files changed, 79 insertions(+), 19 deletions(-) |
| 22 | |
| 23 | diff --git a/lib/replace/system/wscript_configure b/lib/replace/system/wscript_configure |
| 24 | index 2035474..10f9ae7 100644 |
| 25 | --- a/lib/replace/system/wscript_configure |
| 26 | +++ b/lib/replace/system/wscript_configure |
| 27 | @@ -1,6 +1,10 @@ |
| 28 | #!/usr/bin/env python |
| 29 | |
| 30 | -conf.CHECK_HEADERS('sys/capability.h') |
| 31 | +import Options |
| 32 | + |
| 33 | +if Options.options.enable_libcap: |
| 34 | + conf.CHECK_HEADERS('sys/capability.h') |
| 35 | + |
| 36 | conf.CHECK_FUNCS('getpwnam_r getpwuid_r getpwent_r') |
| 37 | |
| 38 | # solaris varients of getXXent_r |
| 39 | diff --git a/lib/replace/wscript b/lib/replace/wscript |
| 40 | index 145300d..310048c 100644 |
| 41 | --- a/lib/replace/wscript |
| 42 | +++ b/lib/replace/wscript |
| 43 | @@ -23,6 +23,41 @@ def set_options(opt): |
| 44 | opt.PRIVATE_EXTENSION_DEFAULT('') |
| 45 | opt.RECURSE('buildtools/wafsamba') |
| 46 | |
| 47 | + opt.add_option('--with-acl', |
| 48 | + help=("Enable use of acl"), |
| 49 | + action="store_true", dest='enable_acl') |
| 50 | + opt.add_option('--without-acl', |
| 51 | + help=("Disable use of acl"), |
| 52 | + action="store_false", dest='enable_acl', default=False) |
| 53 | + |
| 54 | + opt.add_option('--with-attr', |
| 55 | + help=("Enable use of attr"), |
| 56 | + action="store_true", dest='enable_attr') |
| 57 | + opt.add_option('--without-attr', |
| 58 | + help=("Disable use of attr"), |
| 59 | + action="store_false", dest='enable_attr', default=False) |
| 60 | + |
| 61 | + opt.add_option('--with-libaio', |
| 62 | + help=("Enable use of libaio"), |
| 63 | + action="store_true", dest='enable_libaio') |
| 64 | + opt.add_option('--without-libaio', |
| 65 | + help=("Disable use of libaio"), |
| 66 | + action="store_false", dest='enable_libaio', default=False) |
| 67 | + |
| 68 | + opt.add_option('--with-libbsd', |
| 69 | + help=("Enable use of libbsd"), |
| 70 | + action="store_true", dest='enable_libbsd') |
| 71 | + opt.add_option('--without-libbsd', |
| 72 | + help=("Disable use of libbsd"), |
| 73 | + action="store_false", dest='enable_libbsd', default=False) |
| 74 | + |
| 75 | + opt.add_option('--with-libcap', |
| 76 | + help=("Enable use of libcap"), |
| 77 | + action="store_true", dest='enable_libcap') |
| 78 | + opt.add_option('--without-libcap', |
| 79 | + help=("Disable use of libcap"), |
| 80 | + action="store_false", dest='enable_libcap', default=False) |
| 81 | + |
| 82 | @Utils.run_once |
| 83 | def configure(conf): |
| 84 | conf.RECURSE('buildtools/wafsamba') |
| 85 | @@ -32,12 +67,25 @@ def configure(conf): |
| 86 | conf.DEFINE('HAVE_LIBREPLACE', 1) |
| 87 | conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1) |
| 88 | |
| 89 | - conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h') |
| 90 | - conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h') |
| 91 | + conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h') |
| 92 | + conf.CHECK_HEADERS('compat.h ctype.h dustat.h') |
| 93 | conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h') |
| 94 | - conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h') |
| 95 | - conf.CHECK_HEADERS('shadow.h sys/acl.h') |
| 96 | - conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h') |
| 97 | + conf.CHECK_HEADERS('locale.h ndir.h pwd.h') |
| 98 | + conf.CHECK_HEADERS('shadow.h') |
| 99 | + conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h') |
| 100 | + |
| 101 | + if Options.options.enable_acl: |
| 102 | + conf.CHECK_HEADERS('acl/libacl.h sys/acl.h') |
| 103 | + |
| 104 | + if Options.options.enable_attr: |
| 105 | + conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h') |
| 106 | + |
| 107 | + if Options.options.enable_libaio: |
| 108 | + conf.CHECK_HEADERS('libaio.h') |
| 109 | + |
| 110 | + if Options.options.enable_libcap: |
| 111 | + conf.CHECK_HEADERS('sys/capability.h') |
| 112 | + |
| 113 | conf.CHECK_HEADERS('port.h') |
| 114 | conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h') |
| 115 | conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h') |
| 116 | @@ -73,7 +121,9 @@ def configure(conf): |
| 117 | |
| 118 | conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H') |
| 119 | |
| 120 | - conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h') |
| 121 | + if Options.options.enable_valgrind: |
| 122 | + conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h') |
| 123 | + |
| 124 | conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h') |
| 125 | conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h') |
| 126 | conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h') |
| 127 | @@ -248,17 +298,18 @@ def configure(conf): |
| 128 | |
| 129 | conf.CHECK_FUNCS('prctl dirname basename') |
| 130 | |
| 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 Options.options.enable_libbsd: |
| 143 | + # libbsd on some platforms provides strlcpy and strlcat |
| 144 | + if not conf.CHECK_FUNCS('strlcpy strlcat'): |
| 145 | + conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', |
| 146 | + checklibc=True) |
| 147 | + if not conf.CHECK_FUNCS('getpeereid'): |
| 148 | + conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 149 | + if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): |
| 150 | + conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 151 | + |
| 152 | + if not conf.CHECK_FUNCS('closefrom'): |
| 153 | + conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') |
| 154 | |
| 155 | conf.CHECK_CODE(''' |
| 156 | struct ucred cred; |
| 157 | diff --git a/wscript b/wscript |
| 158 | index 50b2286..748eef1 100644 |
| 159 | --- a/wscript |
| 160 | +++ b/wscript |
| 161 | @@ -64,7 +64,12 @@ def set_options(opt): |
| 162 | opt.add_option('--disable-python', |
| 163 | help=("disable the pytdb module"), |
| 164 | action="store_true", dest='disable_python', default=False) |
| 165 | - |
| 166 | + opt.add_option('--with-valgrind', |
| 167 | + help=("enable use of valgrind"), |
| 168 | + action="store_true", dest='enable_valgrind') |
| 169 | + opt.add_option('--without-valgrind', |
| 170 | + help=("disable use of valgrind"), |
| 171 | + action="store_false", dest='enable_valgrind', default=False) |
| 172 | |
| 173 | def configure(conf): |
| 174 | conf.env.disable_tdb_mutex_locking = getattr(Options.options, |
| 175 | -- |
| 176 | 2.8.3 |
| 177 | |