Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From ffffd29bc6303d60b3d77048fbbf6776f6fbbe01 Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Thu, 19 Jul 2018 16:40:31 +0800 |
| 4 | Subject: [PATCH] ldb: 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 | Update to version 1.4.1, and fix one configure error |
| 19 | |
| 20 | Cross answers file cross-answers-i586.txt is incomplete with |
| 21 | "Checking for a 64-bit host to support lmdb: UNKNOWN" |
| 22 | |
| 23 | we don't support lmdb, so only check when lmdb is support |
| 24 | |
| 25 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 26 | --- |
| 27 | lib/replace/wscript | 94 ++++++++++++++++++++++++++++++++++++++++------------- |
| 28 | wscript | 6 ++++ |
| 29 | 2 files changed, 77 insertions(+), 23 deletions(-) |
| 30 | |
| 31 | diff --git a/lib/replace/wscript b/lib/replace/wscript |
| 32 | index fd00a42..434192e 100644 |
| 33 | --- a/lib/replace/wscript |
| 34 | +++ b/lib/replace/wscript |
| 35 | @@ -23,6 +23,41 @@ def set_options(opt): |
| 36 | opt.PRIVATE_EXTENSION_DEFAULT('') |
| 37 | opt.RECURSE('buildtools/wafsamba') |
| 38 | |
| 39 | + opt.add_option('--with-acl', |
| 40 | + help=("Enable use of acl"), |
| 41 | + action="store_true", dest='enable_acl') |
| 42 | + opt.add_option('--without-acl', |
| 43 | + help=("Disable use of acl"), |
| 44 | + action="store_false", dest='enable_acl', default=False) |
| 45 | + |
| 46 | + opt.add_option('--with-attr', |
| 47 | + help=("Enable use of attr"), |
| 48 | + action="store_true", dest='enable_attr') |
| 49 | + opt.add_option('--without-attr', |
| 50 | + help=("Disable use of attr"), |
| 51 | + action="store_false", dest='enable_attr', default=False) |
| 52 | + |
| 53 | + opt.add_option('--with-libaio', |
| 54 | + help=("Enable use of libaio"), |
| 55 | + action="store_true", dest='enable_libaio') |
| 56 | + opt.add_option('--without-libaio', |
| 57 | + help=("Disable use of libaio"), |
| 58 | + action="store_false", dest='enable_libaio', default=False) |
| 59 | + |
| 60 | + opt.add_option('--with-libbsd', |
| 61 | + help=("Enable use of libbsd"), |
| 62 | + action="store_true", dest='enable_libbsd') |
| 63 | + opt.add_option('--without-libbsd', |
| 64 | + help=("Disable use of libbsd"), |
| 65 | + action="store_false", dest='enable_libbsd', default=False) |
| 66 | + |
| 67 | + opt.add_option('--with-libcap', |
| 68 | + help=("Enable use of libcap"), |
| 69 | + action="store_true", dest='enable_libcap') |
| 70 | + opt.add_option('--without-libcap', |
| 71 | + help=("Disable use of libcap"), |
| 72 | + action="store_false", dest='enable_libcap', default=False) |
| 73 | + |
| 74 | @Utils.run_once |
| 75 | def configure(conf): |
| 76 | conf.RECURSE('buildtools/wafsamba') |
| 77 | @@ -32,12 +67,25 @@ def configure(conf): |
| 78 | conf.DEFINE('HAVE_LIBREPLACE', 1) |
| 79 | conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1) |
| 80 | |
| 81 | - conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h') |
| 82 | - conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h') |
| 83 | + conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h') |
| 84 | + conf.CHECK_HEADERS('compat.h ctype.h dustat.h') |
| 85 | conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h') |
| 86 | - conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h') |
| 87 | - conf.CHECK_HEADERS('shadow.h sys/acl.h') |
| 88 | - conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h') |
| 89 | + conf.CHECK_HEADERS('locale.h ndir.h pwd.h') |
| 90 | + 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 | + |
| 105 | conf.CHECK_HEADERS('port.h') |
| 106 | conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h') |
| 107 | conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h') |
| 108 | @@ -108,7 +156,9 @@ def configure(conf): |
| 109 | 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 valgrind/memcheck.h') |
| 113 | + if Options.options.enable_valgrind: |
| 114 | + conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h') |
| 115 | + |
| 116 | conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h') |
| 117 | conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h') |
| 118 | conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h') |
| 119 | @@ -340,22 +390,20 @@ def configure(conf): |
| 120 | |
| 121 | conf.CHECK_FUNCS('prctl dirname basename') |
| 122 | |
| 123 | - strlcpy_in_bsd = False |
| 124 | - |
| 125 | - # libbsd on some platforms provides strlcpy and strlcat |
| 126 | - if not conf.CHECK_FUNCS('strlcpy strlcat'): |
| 127 | - if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', |
| 128 | - checklibc=True): |
| 129 | - strlcpy_in_bsd = True |
| 130 | - if not conf.CHECK_FUNCS('getpeereid'): |
| 131 | - conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 132 | - if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): |
| 133 | - conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 134 | - if not conf.CHECK_FUNCS('setproctitle_init'): |
| 135 | - conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 136 | - |
| 137 | - if not conf.CHECK_FUNCS('closefrom'): |
| 138 | - conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') |
| 139 | + if Options.options.enable_libbsd: |
| 140 | + # libbsd on some platforms provides strlcpy and strlcat |
| 141 | + if not conf.CHECK_FUNCS('strlcpy strlcat'): |
| 142 | + conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h', |
| 143 | + checklibc=True) |
| 144 | + if not conf.CHECK_FUNCS('getpeereid'): |
| 145 | + conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 146 | + if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'): |
| 147 | + conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 148 | + if not conf.CHECK_FUNCS('setproctitle_init'): |
| 149 | + conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h') |
| 150 | + |
| 151 | + if not conf.CHECK_FUNCS('closefrom'): |
| 152 | + conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h') |
| 153 | |
| 154 | conf.CHECK_CODE(''' |
| 155 | struct ucred cred; |
| 156 | @@ -699,7 +747,7 @@ def configure(conf): |
| 157 | # look for a method of finding the list of network interfaces |
| 158 | for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']: |
| 159 | bsd_for_strlcpy = '' |
| 160 | - if strlcpy_in_bsd: |
| 161 | + if Options.options.enable_libbsd: |
| 162 | bsd_for_strlcpy = ' bsd' |
| 163 | if conf.CHECK_CODE(''' |
| 164 | #define %s 1 |
| 165 | diff --git a/wscript b/wscript |
| 166 | index ad91bc6..2d20fee 100644 |
| 167 | --- a/wscript |
| 168 | +++ b/wscript |
| 169 | @@ -36,6 +36,12 @@ def set_options(opt): |
| 170 | help='disable new LMDB backend for LDB', |
| 171 | action='store_true', dest='without_ldb_lmdb', default=False) |
| 172 | |
| 173 | + opt.add_option('--with-valgrind', |
| 174 | + help=("enable use of valgrind"), |
| 175 | + action="store_true", dest='enable_valgrind') |
| 176 | + opt.add_option('--without-valgrind', |
| 177 | + help=("disable use of valgrind"), |
| 178 | + action="store_false", dest='enable_valgrind', default=False) |
| 179 | |
| 180 | def configure(conf): |
| 181 | conf.RECURSE('lib/tdb') |
| 182 | -- |
| 183 | 2.7.4 |
| 184 | |