build-sys: make fdisk, sfdisk, cfdisk optional (enabled by default)
PATCH 1/1 build-sys: make fdisk, sfdisk, cfdisk optional (enabled by default)
Useful for embedded systems, on which only few utilities are required.
Signed-off-by Carlos Santos <[email protected]>
--- configure.ac | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
configure.ac +9 -5
@@ -1152,26 +1152,30 @@ AC_SUBST([LIBFDISK_VERSION_INFO]) AC_DEFINE_UNQUOTED([LIBFDISK_VERSION], ["$LIBFDISK_VERSION"], [libfdisk version string]) -UL_BUILD_INIT([fdisk], [check]) +AC_ARG_ENABLE([fdisk], + AS_HELP_STRING([--disable-fdisk], [do not build fdisk(8), sfdisk(8) and cfdisk(8)]), + [], [UL_DEFAULT_ENABLE([fdisk], [check])] +) +UL_BUILD_INIT([fdisk]) UL_REQUIRES_HAVE([fdisk], [openat], [openat functions]) UL_REQUIRES_BUILD([fdisk], [libfdisk]) UL_REQUIRES_BUILD([fdisk], [libsmartcols]) AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes]) -UL_BUILD_INIT([sfdisk], [check]) +UL_BUILD_INIT([sfdisk]) UL_REQUIRES_HAVE([sfdisk], [openat], [openat functions]) UL_REQUIRES_BUILD([sfdisk], [libfdisk]) UL_REQUIRES_BUILD([sfdisk], [libsmartcols]) -AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes]) +AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_fdisk" = xyes]) -UL_BUILD_INIT([cfdisk], [check]) +UL_BUILD_INIT([cfdisk]) UL_REQUIRES_BUILD([cfdisk], [libfdisk]) UL_REQUIRES_BUILD([cfdisk], [libsmartcols]) UL_REQUIRES_HAVE([cfdisk], [open_memstream], [open_memstream function]) UL_REQUIRES_HAVE([cfdisk], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library]) -AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes]) +AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_fdisk" = xyes]) AC_ARG_ENABLE([mount],
Signature · 1 line
2.14.5
Karel Zak
maintainerQuoted 2 lines · Carlos Santos
configure.ac | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
Applied with a small change, thanks.
Quoted 1 line
+AC_ARG_ENABLE([fdisk],
renamed to --disable-fdisks
configure.ac AC_SUBST([LIBFDISK_VERSION_INFO]) · line 1158
Quoted 3 lines
configure.ac +3
-0+ AS_HELP_STRING([--disable-fdisk], [do not build fdisk(8), sfdisk(8) and cfdisk(8)]), + [], [UL_DEFAULT_ENABLE([fdisk], [check])] +)
It seems better to initialize $enable_fdisk, $enable_sfdisk and $enable_cfdisk to keep UL_BUILD_INIT() and UL_REQUIRES_* usable.
Karel
Quoted 30 lines
configure.ac +5
-4+UL_BUILD_INIT([fdisk]) UL_REQUIRES_HAVE([fdisk], [openat], [openat functions]) UL_REQUIRES_BUILD([fdisk], [libfdisk]) UL_REQUIRES_BUILD([fdisk], [libsmartcols]) AM_CONDITIONAL([BUILD_FDISK], [test "x$build_fdisk" = xyes]) -UL_BUILD_INIT([sfdisk], [check]) +UL_BUILD_INIT([sfdisk]) UL_REQUIRES_HAVE([sfdisk], [openat], [openat functions]) UL_REQUIRES_BUILD([sfdisk], [libfdisk]) UL_REQUIRES_BUILD([sfdisk], [libsmartcols]) -AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_sfdisk" = xyes]) +AM_CONDITIONAL([BUILD_SFDISK], [test "x$build_fdisk" = xyes]) -UL_BUILD_INIT([cfdisk], [check]) +UL_BUILD_INIT([cfdisk]) UL_REQUIRES_BUILD([cfdisk], [libfdisk]) UL_REQUIRES_BUILD([cfdisk], [libsmartcols]) UL_REQUIRES_HAVE([cfdisk], [open_memstream], [open_memstream function]) UL_REQUIRES_HAVE([cfdisk], [ncursesw,slang,ncurses], [ncursesw, ncurses or slang library]) -AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_cfdisk" = xyes]) +AM_CONDITIONAL([BUILD_CFDISK], [test "x$build_fdisk" = xyes]) AC_ARG_ENABLE([mount],Signature · 1 line
2.14.5
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com