]> err.no Git - util-linux/commitdiff
build-sys: enable lsblk and libmount for Linux only
authorKarel Zak <kzak@redhat.com>
Mon, 31 Jan 2011 13:18:46 +0000 (14:18 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 31 Jan 2011 13:18:46 +0000 (14:18 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
TODO
configure.ac
misc-utils/Makefile.am

diff --git a/TODO b/TODO
index af3750aad1fb1a2044594c4a777960f0c487327f..dea4052775cf6231140e62e90852a76f2e07a2f8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,36 @@
+build-sys
+--------
+
+ - we use something like
+
+       AC_ARG_ENABLE(...., enable_foo=check)
+       build_foo=yes
+       if test "x$enable_foo" = xcheck; then
+               if test "x$linux_os" = xno; then
+                       build_foo=no
+               fi
+       fi
+       AM_CONDITIONAL(BUILD_LIBMOUNT, test "x$build_foo" = xyes)
+
+   for Linux-only utils in configure.ac. It would be nice to set all defaults
+   for all $enable_ variables at begin of the configure script according to
+   $linux_os. Something like:
+
+       if test "x$linux_os" = xno
+               enable_mount=no
+               enable_libmount=no
+               enable_lsblk=no
+       fi
+
+   then we can remove all "if test "x$enable_foo" = xcheck;" stuff from the rest
+   of the configure script.
+
+ - it would be nice to remove all "if BUILD_LIB{MOUNT,BLKID,UUID}" from the 
+   Makefiles (e.g. misc-utils/Makefile.am) and use BUILD_<utilname> only
+
+   The configure.ac has to care about dependence between utils and librares and
+   enable BUILD_<utilname>.
+
 fsprobe
 -------
 
index 10250d31a3245ec47ed35e83f5e5e46b681cef13..59b55ea094c11d9744b2246835d82c39ffa08070 100644 (file)
@@ -445,10 +445,19 @@ AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid])
 
 AC_ARG_ENABLE([libmount],
   AS_HELP_STRING([--disable-libmount], [do not build libmount]),
-  [], enable_libmount=yes
+  [], enable_libmount=check
 )
+build_libmount=yes
+if test "x$enable_libmount" = xcheck; then
+  if test "x$linux_os" = xno; then
+    AC_MSG_WARN([non-linux system; do not build libmount])
+    build_libmount=no
+  fi
+elif test "x$enable_libmount" = xno; then
+    build_libmount=no
+fi
 
-case "$enable_libblkid:$enable_libmount" in
+case "$enable_libblkid:$build_libmount" in
 no:yes)
   AC_MSG_ERROR([cannot enable libmount when libblkid is disabled]) ;;
 esac
@@ -456,7 +465,7 @@ esac
 AC_SUBST([LIBMOUNT_VERSION])
 AC_SUBST([LIBMOUNT_VERSION_INFO])
 AC_DEFINE_UNQUOTED(LIBMOUNT_VERSION, "$LIBMOUNT_VERSION", [libmount version string])
-AM_CONDITIONAL(BUILD_LIBMOUNT, test "x$enable_libmount" = xyes)
+AM_CONDITIONAL(BUILD_LIBMOUNT, test "x$build_libmount" = xyes)
 
 
 AC_ARG_ENABLE([libmount-mount],
@@ -464,7 +473,7 @@ AC_ARG_ENABLE([libmount-mount],
   [], enable_libmount_mount=no
 )
 
-case "$enable_libmount:$enable_libmount_mount" in
+case "$build_libmount:$enable_libmount_mount" in
 no:yes)
   AC_MSG_ERROR([cannot link mount(8) with libmount when libmount is disabled]) ;;
 yes:yes)
index 8b1dbbe2e2b538971333baa55d433b746595aa6f..3f0843b2c22c62b8b55886e58b2ef526a4a22f7b 100644 (file)
@@ -50,6 +50,7 @@ wipefs_SOURCES = wipefs.c $(top_srcdir)/lib/strutils.c
 wipefs_LDADD = $(ul_libblkid_la)
 wipefs_CFLAGS = $(AM_CFLAGS) -I$(ul_libblkid_incdir)
 
+if LINUX
 bin_PROGRAMS += lsblk
 dist_man_MANS += lsblk.8
 lsblk_SOURCES = lsblk.c \
@@ -59,6 +60,8 @@ lsblk_SOURCES = lsblk.c \
                $(top_srcdir)/lib/strutils.c
 lsblk_LDADD = $(ul_libblkid_la)
 lsblk_CFLAGS = $(AM_CFLAGS) -I$(ul_libblkid_incdir)
+endif
+
 if HAVE_STATIC_BLKID
 sbin_PROGRAMS += blkid.static
 blkid_static_SOURCES = $(blkid_SOURCES)