From 5e2f91de348658111b42b7fb286ffe65490d99af Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 15 Mar 2018 16:46:39 +0000 Subject: [PATCH] lib:replace: Fix linking when libtirpc-devel overwrites system headers Some systems (like SUSE currently) install the new tirpc headers by overwritting the existing system location used by gcc. This patch will detect if the headers in the system location belong to tirpc or not. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13341 Signed-off-by: Noel Power Reviewed-by: Andreas Schneider Reviewed-by: Alexander Bokovoy (cherry picked from commit 618c714b6b6c0b63993299b40b9a466adb753cc2) --- lib/replace/wscript | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index 2c638b77212..0e04bf7e121 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -68,7 +68,15 @@ def configure(conf): 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 conf.CHECK_CODE( + '\n#ifndef _TIRPC_RPC_H\n#error "no tirpc headers in system path"\n#endif\n', + 'HAVE_RPC_RPC_HEADERS', + headers=['rpc/rpc.h', 'rpc/nettype.h'], + msg='Checking for tirpc rpc headers in default system path'): + if conf.CONFIG_SET('HAVE_RPC_RPC_H'): + conf.undefine('HAVE_RPC_RPC_H') + if not conf.CONFIG_SET('HAVE_RPC_RPC_H'): if conf.CHECK_CFG(package='libtirpc', args='--cflags --libs', msg='Checking for libtirpc headers', -- 2.16.2