]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: cleanup BUILD_UNSHARE
authorKarel Zak <kzak@redhat.com>
Thu, 27 Oct 2011 13:51:28 +0000 (15:51 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 3 Nov 2011 11:32:50 +0000 (12:32 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac

index e04622305070a75e4c8c448280b62e999f99904e..70d50a91ebacb3a113a5d6d3f1951928ac5ee3ca 100644 (file)
@@ -735,10 +735,17 @@ if test "x$build_fallocate" = xyes; then
 fi
 
 
-dnl unshare could be available as libc function or as syscall only
-UL_CHECK_SYSCALL([unshare])
-AC_CHECK_FUNCS([unshare])
-
+AC_ARG_ENABLE([unshare],
+  AS_HELP_STRING([--disable-unshare], [do not build unshare]),
+  [], enable_unshare=check
+)
+build_unshare=yes
+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
 
 
 UL_SET_ARCH(I86, i?86-*)
@@ -855,31 +862,6 @@ AM_CONDITIONAL(BUILD_PIVOT_ROOT, test "x$build_pivot_root" = xyes)
 
 
 
-AC_ARG_ENABLE([unshare],
-  AS_HELP_STRING([--disable-unshare], [do not build unshare]),
-  [], enable_unshare=check
-)
-if test "x$enable_unshare" = xno; then
-  build_unshare=no
-else
-  build_unshare=yes
-  case $enable_unshare:$linux_os in
-  yes:no) AC_MSG_ERROR([unshare selected for non-linux system]);;
-  check:no) AC_MSG_WARN([non-linux system; do not build unshare])
-            build_unshare=no;;
-  esac
-  if test "x$build_unshare" = xyes; then
-    case $enable_unshare:$ul_cv_syscall_unshare in
-    yes:no) AC_MSG_ERROR([unshare selected but unshare syscall not found]);;
-    check:no) AC_MSG_WARN([unshare syscall not found; do not build unshare])
-              build_unshare=no;;
-    esac
-  fi
-fi
-AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes)
-
-
-
 AC_ARG_ENABLE([elvtune],
   AS_HELP_STRING([--enable-elvtune], [build elvtune (only works with 2.2 and 2.4 kernels)]),
   [], enable_elvtune=no