]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: clean up partx Makefile
authorKarel Zak <kzak@redhat.com>
Wed, 16 Mar 2011 16:39:54 +0000 (17:39 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 16 Mar 2011 16:39:54 +0000 (17:39 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
Makefile.am
configure.ac
partx/Makefile.am

index 38207b7d50e28a450b3184ade5c66bd6bc2ec880..edf2dbfaeefc4af193887dbc2622bddbba1e2a5c 100644 (file)
@@ -41,7 +41,7 @@ if BUILD_HWCLOCK
 SUBDIRS += hwclock
 endif
 
-if LINUX
+if BUILD_PARTX
 SUBDIRS += partx
 endif
 
index 83cbc70846ef5b67bc67628a546e2c730d99b857..d66638d9f4b1ae3e009b8a416a312e0a11acfdd7 100644 (file)
@@ -367,6 +367,22 @@ AC_ARG_ENABLE([fsck],
 AM_CONDITIONAL(BUILD_FSCK, test "x$enable_fsck" = xyes)
 
 
+AC_ARG_ENABLE([partx],
+  AS_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
+  [], enable_partx=check
+)
+build_partx=yes
+if test "x$enable_partx" = xcheck; then
+  if test "x$linux_os" = xno; then
+    AC_MSG_WARN([non-linux system; do not build partx utilities])
+    build_partx=no
+  fi
+elif test "x$enable_partx" = xno; then
+    build_partx=no
+fi
+AM_CONDITIONAL(BUILD_PARTX, test "x$build_partx" = xyes)
+
+
 AC_ARG_ENABLE([libuuid],
   AS_HELP_STRING([--disable-libuuid], [do not build libuuid and uuid utilities]),
   [], enable_libuuid=yes
@@ -419,6 +435,9 @@ else
   if test "x$enable_fsck" = xyes; then
     AC_MSG_ERROR([libblkid is needed to build util-linux fsck])
   fi
+  if test "x$build_partx" = xyes; then
+    AC_MSG_ERROR([libblkid is needed to build util-linux partx])
+  fi
 fi
 
 
@@ -976,13 +995,6 @@ AC_ARG_ENABLE([mesg],
 AM_CONDITIONAL(BUILD_MESG, test "x$enable_mesg" = xyes)
 
 
-AC_ARG_ENABLE([partx],
-  AS_HELP_STRING([--enable-partx], [build addpart, delpart, partx]),
-  [], enable_partx=no
-)
-AM_CONDITIONAL(BUILD_PARTX, test "x$enable_partx" = xyes)
-
-
 AC_ARG_ENABLE([raw],
   AS_HELP_STRING([--enable-raw], [build raw]),
   [], enable_raw=no
index a99300d9137a1b7e8089d6156bee41631b153219..67ba7c53e17da590b5847acb3c1c175531e42990 100644 (file)
@@ -3,22 +3,15 @@ include $(top_srcdir)/config/include-Makefile.am
 usrsbin_exec_PROGRAMS = addpart delpart
 dist_man_MANS = addpart.8 delpart.8
 
-if BUILD_PARTX
-if BUILD_LIBBLKID
 usrsbin_exec_PROGRAMS += partx
 partx_SOURCES = partx.c partx.h \
                $(top_srcdir)/lib/blkdev.c \
                $(top_srcdir)/lib/tt.c \
                $(top_srcdir)/lib/mbsalign.c \
-               $(top_srcdir)/lib/strutils.c
-
-if LINUX
-partx_SOURCES += $(top_srcdir)/lib/linux_version.c
-endif
+               $(top_srcdir)/lib/strutils.c \
+               $(top_srcdir)/lib/linux_version.c
 
 partx_CFLAGS = -I$(ul_libblkid_incdir)
 partx_LDADD = $(ul_libblkid_la)
 dist_man_MANS += partx.8
-endif
-endif