From 5c73f3de5722a192e06c5ae0fc6c92e7ba752c7e Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Tue, 12 Aug 2014 12:11:58 +0100 Subject: [PATCH] Tidy up Autoconf check for --enable-libparted-dmraid (#734076) Use AC_ARG_ENABLE() Autoconf macro to set enable_libparted_dmraid variable to either yes or no in all cases, whether set on the command line or not. Use AS_HELP_STRING() macro to format the option help text. Bug #734076 - Autodetect parted online partition resizing capability --- configure.ac | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 57903803..5a97053c 100644 --- a/configure.ac +++ b/configure.ac @@ -264,17 +264,20 @@ AM_CONDITIONAL([DISABLE_DOC], [test ${enable_doc} = no]) dnl====================== dnl check whether to use native libparted dmraid support dnl====================== -AC_ARG_ENABLE([libparted_dmraid], - [ --enable-libparted-dmraid do use native libparted /dev/mapper dmraid support],,) -if test "x${enable_libparted_dmraid}" = "x" ; then - enable_libparted_dmraid=no -fi +AC_ARG_ENABLE( + [libparted_dmraid], + AS_HELP_STRING( + [--enable-libparted-dmraid], + [use native libparted /dev/mapper dmraid support @<:@default=disabled@:>@]), + [enable_libparted_dmraid=$enableval], + [enable_libparted_dmraid=no] +) -AC_MSG_CHECKING([whether native libparted /dev/mapper dmraid support should be used]) -if test ${enable_libparted_dmraid} = yes; then +AC_MSG_CHECKING([whether to use native libparted /dev/mapper dmraid support]) +if test "x$enable_libparted_dmraid" = xyes; then + AC_DEFINE([USE_LIBPARTED_DMRAID], [1], + [Define to 1 to use native libparted /dev/mapper dmraid support]) AC_MSG_RESULT([yes]) - dnl Set #define USE_LIBPARTED_DMRAID 1 to indicate documentation not wanted - AC_DEFINE([USE_LIBPARTED_DMRAID], [1], [Define to 1 if --enable-libparted-dmraid specified]) else AC_MSG_RESULT([no]) fi