[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] configure: disable network and storage-fs drivers on mac os x

On 10/04/2010 06:57 AM, Justin Clift wrote:
  case "$host" in
      # match linux here so the *) case will match anything non-linux
+    with_linux=yes
+    case "$host" in
+      *-*-darwin*)
+        with_osx=yes
+        ;;
+    esac
>       if test "x$with_lxc" != "xyes"

Hmm; the nested case $host seems odd to me.  Maybe a better layout is:

with_linux=no with_osx=no
case $host in
  *-*-linux*) with_linux=yes ;;
  *-*-darwin*) with_osx=yes ;;
if $with_linux = no; then
  if test "x$with_lxc" != xyes

That is, use only a single host-detection case statement, and rely on the results of that for future checks, rather than mixing host-detection and actions based on host-detection into a nested case statement.

And yes, I trimmed out some of the redundant "" from the shell code in the example above (the shell word after case does not need "" unless it contains shell metacharacters to be taken literally, because it is not subject to field splitting; and $with_linux is exactly 'yes' or 'no' at the point where it is checked, so it is a safe expansion without quotes; whereas $with_lxc is user-provided and might begin with - or contain whitespace).

    AC_HELP_STRING([--with-network], [with virtual network driver @<:@default=yes@:>@]),[],[with_network=yes])
-if test "$with_libvirtd" = "no" ; then
+dnl theres no use compiling the network driver without the libvirt


+dnl daemon, nor compiling it for MacOS X, where it breaks the compile
+if test "$with_libvirtd" = "no" || test "$with_osx" = "yes"; then

Mostly looks okay, but probably worth a v2 to make sure the $host-detection case statement rewrite is still good.

Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]