[libvirt] [PATCH] maint: Correctly detect wether "gluster" cli tool is accessible

The configure definition previously always defined the GLUSTER_CLI macro and thus the code needing it wasn't compiled out if the tool wasn't accessible. --- configure.ac | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index e68f5f6..fa07cfd 100644 --- a/configure.ac +++ b/configure.ac @@ -1938,9 +1938,11 @@ AM_CONDITIONAL([WITH_STORAGE_GLUSTER], [test "$with_storage_gluster" = "yes"]) if test "$with_storage_fs" = "yes" || test "$with_storage_gluster" = "yes"; then - AC_PATH_PROG([GLUSTER_CLI], [gluster], [], [$PATH:/sbin:/usr/sbin]) - AC_DEFINE_UNQUOTED([GLUSTER_CLI], ["$GLUSTER_CLI"], - [Location or name of the gluster command line tool]) + AC_PATH_PROG([GLUSTER_CLI], [gluster], [no], [$PATH:/sbin:/usr/sbin]) + if test "x$GLUSTER_CLI" != "xno"; then + AC_DEFINE_UNQUOTED([GLUSTER_CLI], ["$GLUSTER_CLI"], + [Location or name of the gluster command line tool]) + fi fi LIBPARTED_CFLAGS= -- 1.9.1

On 04/07/2014 09:49 AM, Peter Krempa wrote:
The configure definition previously always defined the GLUSTER_CLI macro and thus the code needing it wasn't compiled out if the tool wasn't accessible. --- configure.ac | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac index e68f5f6..fa07cfd 100644 --- a/configure.ac +++ b/configure.ac @@ -1938,9 +1938,11 @@ AM_CONDITIONAL([WITH_STORAGE_GLUSTER], [test "$with_storage_gluster" = "yes"])
if test "$with_storage_fs" = "yes" || test "$with_storage_gluster" = "yes"; then - AC_PATH_PROG([GLUSTER_CLI], [gluster], [], [$PATH:/sbin:/usr/sbin])
If you leave this line as it is now
- AC_DEFINE_UNQUOTED([GLUSTER_CLI], ["$GLUSTER_CLI"], - [Location or name of the gluster command line tool]) + AC_PATH_PROG([GLUSTER_CLI], [gluster], [no], [$PATH:/sbin:/usr/sbin]) + if test "x$GLUSTER_CLI" != "xno"; then
You can do: if test -n "$GLUSTER_CLI" here, which matches most of the usage elsewhere in the file. (Or test "x$GLUSTER_CLI" != "x" as we do for pkcheck) Jan
participants (2)
-
Ján Tomko
-
Peter Krempa