Permalink
Browse files

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" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information...
1 parent 857d9cd commit bdd384d10d4991b7a7b3ae73c8527b18311f6ec4 @karelzak committed May 21, 2013
Showing with 2 additions and 6 deletions.
  1. +2 −6 configure.ac
View
@@ -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,

0 comments on commit bdd384d

Please sign in to comment.