From: Günther Deschner Date: Tue, 16 Jan 2018 16:48:10 +0000 (+0100) Subject: build: deal with recent glibc sunrpc header removal X-Git-Tag: tevent-0.9.36~292 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=ee0be7eb723be1420fd601ea1abe0af748562953;p=samba.git build: deal with recent glibc sunrpc header removal We need to rely on libtirpc or libntirpc to be around in that case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238 BUG: https://bugzilla.samba.org/show_bug.cgi?id=10976 Guenther Pair-Programmed-With: Andreas Schneider Signed-off-by: Guenther Deschner Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy --- diff --git a/ctdb/wscript b/ctdb/wscript index 8774b999ff2..715ecb175fa 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -559,7 +559,7 @@ def build(bld): bld.SAMBA_BINARY('smnotify', source=bld.SUBDIR('utils/smnotify', 'smnotify.c gen_smnotify.c gen_xdr.c'), - deps='ctdb-smnotify-h ctdb-smnotify-c ctdb-smnotify-x popt', + deps='ctdb-smnotify-h ctdb-smnotify-c ctdb-smnotify-x popt tirpc', includes='utils utils/smnotify', install_path='${CTDB_HELPER_BINDIR}') diff --git a/lib/replace/wscript b/lib/replace/wscript index 2f94d4937d3..57b0a45faee 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -5,7 +5,7 @@ VERSION = '1.2.1' blddir = 'bin' -import sys, os +import Logs, sys, os # find the buildtools directory srcdir = '.' @@ -65,14 +65,42 @@ def configure(conf): headers='sys/inotify.h') conf.CHECK_HEADERS('security/pam_appl.h zlib.h asm/unistd.h') - conf.CHECK_HEADERS('aio.h sys/unistd.h rpc/rpc.h rpc/nettype.h alloca.h float.h') + conf.CHECK_HEADERS('aio.h sys/unistd.h alloca.h float.h') + + conf.SET_TARGET_TYPE('tirpc', 'EMPTY') + conf.CHECK_HEADERS('rpc/rpc.h rpc/nettype.h') + if not conf.CONFIG_SET('HAVE_RPC_RPC_H'): + if conf.CHECK_CFG(package='libtirpc', args='--cflags', + msg='Checking for libtirpc headers', + uselib_store='TIRPC'): + conf.CHECK_HEADERS('rpc/rpc.h rpc/nettype.h', lib='tirpc', together=True) + conf.SET_TARGET_TYPE('tirpc', 'SYSLIB') + if not conf.CONFIG_SET('HAVE_RPC_RPC_H'): + if conf.CHECK_CFG(package='libntirpc', args='--cflags', + msg='Checking for libntirpc headers', + uselib_store='TIRPC'): + conf.CHECK_HEADERS('rpc/rpc.h rpc/nettype.h', lib='tirpc', together=True) + conf.SET_TARGET_TYPE('tirpc', 'SYSLIB') + if not conf.CONFIG_SET('HAVE_RPC_RPC_H'): + Logs.error('ERROR: No rpc/rpc.h header found, tirpc or libntirpc missing?') + sys.exit(1) + + conf.SET_TARGET_TYPE('nsl', 'EMPTY') + conf.CHECK_HEADERS('rpc/rpc.h rpcsvc/yp_prot.h', lib='tirpc') + if not conf.CONFIG_SET('HAVE_RPCSVC_YP_PROT_H'): + if conf.CHECK_CFG(package='libnsl', args='--cflags --libs', + msg='Checking for libnsl', + uselib_store='NSL'): + conf.SET_TARGET_TYPE('nsl', 'SYSLIB') + conf.CHECK_HEADERS('rpc/rpc.h rpcsvc/yp_prot.h', lib='tirpc nsl') + else: + conf.SET_TARGET_TYPE('nsl', 'SYSLIB') + conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h', lib='tirpc nsl') - conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h sys/sysctl.h') + conf.CHECK_HEADERS('sys/sysctl.h') conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h') conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h') - conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H') - conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h') conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h') conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h') diff --git a/lib/util/wscript_build b/lib/util/wscript_build index 0b16b6f8216..30face34381 100644 --- a/lib/util/wscript_build +++ b/lib/util/wscript_build @@ -204,7 +204,7 @@ else: bld.SAMBA_SUBSYSTEM('access', source='access.c', - deps='interfaces samba-util', + deps='interfaces samba-util tirpc nsl', local_include=False) bld.SAMBA_SUBSYSTEM('util_str_escape', diff --git a/source3/auth/wscript_build b/source3/auth/wscript_build index 83b5ad18f03..8fd7dcded86 100644 --- a/source3/auth/wscript_build +++ b/source3/auth/wscript_build @@ -6,7 +6,7 @@ bld.SAMBA3_SUBSYSTEM('TOKEN_UTIL', bld.SAMBA3_SUBSYSTEM('USER_UTIL', source='user_util.c', - deps='TOKEN_UTIL') + deps='TOKEN_UTIL tirpc nsl') bld.SAMBA3_SUBSYSTEM('AUTH_COMMON', source='''auth_util.c diff --git a/source3/wscript b/source3/wscript index 3722b5a56ec..1c711aa570b 100644 --- a/source3/wscript +++ b/source3/wscript @@ -119,7 +119,6 @@ def configure(conf): conf.CHECK_FUNCS('memalign posix_memalign hstrerror') conf.CHECK_FUNCS('shmget') conf.CHECK_FUNCS_IN('shm_open', 'rt', checklibc=True) - #FIXME: for some reason this one still fails conf.CHECK_FUNCS_IN('yp_get_default_domain', 'nsl') conf.CHECK_FUNCS_IN('dn_expand _dn_expand __dn_expand', 'resolv') conf.CHECK_FUNCS_IN('dn_expand', 'inet') @@ -1446,7 +1445,7 @@ main() { #darwin style quota bytecount conf.CHECK_STRUCTURE_MEMBER('struct dqblk', 'dqb_curbytes', define='HAVE_STRUCT_DQBLK_DQB_CURBYTES', headers='sys/quota.h') - if conf.CHECK_HEADERS('rpcsvc/rquota.h'): + if conf.CHECK_HEADERS('rpcsvc/rquota.h', lib='tirpc'): conf.DEFINE('HAVE_NFS_QUOTAS', '1') conf.CHECK_STRUCTURE_MEMBER('struct getquota_rslt', 'getquota_rslt_u', define='HAVE_GETQUOTA_RSLT_GETQUOTA_RSLT_U', @@ -1484,7 +1483,8 @@ main() { define='HAVE_NFS_QUOTAS', msg='for NFS QUOTAS', execute=True, - local_include=False) + local_include=False, + lib='tirpc') if conf.CONFIG_SET('HAVE_QUOTACTL_LINUX') or \ conf.CONFIG_SET('HAVE_QUOTACTL_4A') or \ @@ -1650,7 +1650,7 @@ main() { Logs.info("building with Spotlight support") default_static_modules.extend(TO_LIST('rpc_mdssvc_module')) - conf.CHECK_HEADERS('rpc/xdr.h') + conf.CHECK_HEADERS('rpc/xdr.h', lib='tirpc') forced_static_modules.extend(TO_LIST('auth_builtin auth_sam auth_winbind')) default_static_modules.extend(TO_LIST('''pdb_smbpasswd pdb_tdbsam