From bdd384d10d4991b7a7b3ae73c8527b18311f6ec4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 21 May 2013 11:32:29 +0200 Subject: build-sys: always check for setns() and unshare() libs functions $ ./configure --disable-unshare $ make nsenter CC sys-utils/nsenter.o In file included from sys-utils/nsenter.c:36:0: ./include/namespace.h:31:19: error: static declaration of ‘unshare’ follows non-static declaration In file included from /usr/include/sched.h:42:0, from sys-utils/nsenter.c:23: /usr/include/bits/sched.h:86:12: note: previous declaration of ‘unshare’ was here make: *** [sys-utils/nsenter.o] Error 1 We have to always check for the libc function independently on --disable-{unshare,nsenter} to avoid collision between local and libc declarations. Reported-by: "Gabor Z. Papp" Signed-off-by: Karel Zak --- configure.ac | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index dad0439a3..9414e6ac4 100644 --- a/configure.ac +++ b/configure.ac @@ -905,9 +905,7 @@ UL_BUILD_INIT([unshare]) UL_REQUIRES_LINUX([unshare]) UL_REQUIRES_SYSCALL_CHECK([unshare], [UL_CHECK_SYSCALL([unshare])]) AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes) -if test "x$build_unshare" = xyes; then - AC_CHECK_FUNCS([unshare]) -fi +AC_CHECK_FUNCS([unshare]) AC_ARG_ENABLE([nsenter], AS_HELP_STRING([--disable-nsenter], [do not build nsenter]), @@ -917,9 +915,7 @@ UL_BUILD_INIT([nsenter]) UL_REQUIRES_LINUX([nsenter]) UL_REQUIRES_SYSCALL_CHECK([nsenter], [UL_CHECK_SYSCALL([setns])], [setns]) AM_CONDITIONAL(BUILD_NSENTER, test "x$build_nsenter" = xyes) -if test "x$build_nsenter" = xyes; then - AC_CHECK_FUNCS([setns]) -fi +AC_CHECK_FUNCS([setns]) dnl setpriv depends on libcap-ng. It would be possible to build dnl a version of setpriv with limited functionality without libcap-ng, -- cgit v1.2.3-55-g7522