]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: cleanup --disable-{fallocate,pivot_root,unshare}
authorKarel Zak <kzak@redhat.com>
Tue, 6 Oct 2009 10:43:22 +0000 (12:43 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 6 Oct 2009 10:45:50 +0000 (12:45 +0200)
 * add --disable-fallocate
 * add --disable-pivot_root
 * cleanup --disable-unshare

Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
sys-utils/Makefile.am

index 07c851fc1a4803f4c4f03daa1e9b86fe1ef2b36f..19af11ed0b8d0e63ab8a8ccfc5b357233e759ffe 100644 (file)
@@ -372,21 +372,6 @@ AM_CONDITIONAL(HAVE_BLKID, test "x$have_blkid" = xyes)
 
 AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid])
 
-AC_ARG_ENABLE([unshare],
-  AS_HELP_STRING([--disable-unshare], [do not build unshare]),
-  [], enable_unshare=check
-)
-build_unshare=yes
-if test "x$enable_unshare" = xcheck; then
-  if test "x$linux_os" = xno; then
-    AC_MSG_WARN([non-linux system; do not build unshare])
-    build_unshare=no
-  fi
-elif test "x$enable_unshare" = xno; then
-    build_unshare=no
-fi
-AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_unshare" = xyes)
-
 UTIL_CHECK_LIB(util, openpty)
 UTIL_CHECK_LIB(termcap, tgetnum)
 
@@ -677,7 +662,6 @@ AC_ARG_ENABLE([switch_root],
   AS_HELP_STRING([--disable-switch_root], [do not build switch_root]),
   [], enable_switch_root=check
 )
-
 if test "x$enable_switch_root" = xno; then
   build_switch_root=no
 else
@@ -698,6 +682,79 @@ fi
 AM_CONDITIONAL(BUILD_SWITCH_ROOT, test "x$build_switch_root" = xyes)
 
 
+AC_ARG_ENABLE([pivot_root],
+  AS_HELP_STRING([--disable-pivot_root], [do not build pivot_root]),
+  [], enable_pivot_root=check
+)
+if test "x$enable_pivot_root" = xno; then
+  build_pivot_root=no
+else
+  build_pivot_root=yes
+  case $enable_pivot_root:$linux_os in
+  yes:no) AC_MSG_ERROR([pivot_root selected for non-linux system]);;
+  check:no) AC_MSG_WARN([non-linux system; do not build pivot_root])
+            build_pivot_root=no;;
+  esac
+  if test "x$build_pivot_root" = xyes; then
+    case $enable_pivot_root:$util_cv_syscall_pivot_root in
+    yes:no) AC_MSG_ERROR([pivot_root selected but pivot_root syscall not found]);;
+    check:no) AC_MSG_WARN([pivot_root syscall not found; do not build pivot_root])
+              build_pivot_root=no;;
+    esac
+  fi
+fi
+AM_CONDITIONAL(BUILD_UNSHARE, test "x$build_pivot_root" = xyes)
+
+
+AC_ARG_ENABLE([fallocate],
+  AS_HELP_STRING([--disable-fallocate], [do not build fallocate]),
+  [], enable_fallocate=check
+)
+if test "x$enable_fallocate" = xno; then
+  build_fallocate=no
+else
+  build_fallocate=yes
+  case $enable_fallocate:$linux_os in
+  yes:no) AC_MSG_ERROR([fallocate selected for non-linux system]);;
+  check:no) AC_MSG_WARN([non-linux system; do not build fallocate])
+            build_fallocate=no;;
+  esac
+  if test "x$build_fallocate" = xyes; then
+    case $enable_fallocate:$util_cv_syscall_fallocate in
+    yes:no) AC_MSG_ERROR([fallocate selected but fallocate syscall not found]);;
+    check:no) AC_MSG_WARN([fallocate syscall not found; do not build fallocate])
+              build_fallocate=no;;
+    esac
+  fi
+fi
+AM_CONDITIONAL(BUILD_FALLOCATE, test "x$build_fallocate" = 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:$util_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
index 3c0525a94cb4cb9f0a715448453e13cc4b74750c..922533343079ba93bad4f1954a998f33f1c25b0f 100644 (file)
@@ -23,12 +23,12 @@ tunelp_SOURCES = tunelp.c lp.h
 
 info_TEXINFOS = ipc.texi
 
-if HAVE_FALLOCATE
+if BUILD_FALLOCATE
 usrbin_exec_PROGRAMS += fallocate
 dist_man_MANS += fallocate.1
 endif
 
-if HAVE_PIVOT_ROOT
+if BUILD_PIVOT_ROOT
 sbin_PROGRAMS += pivot_root
 dist_man_MANS += pivot_root.8
 endif