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

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

 



On 10/04/2010 06:57 AM, Justin Clift wrote:
+with_linux=no
+with_osx=no
  case "$host" in
    *-*-linux*)
      # 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 ;;
esac
if $with_linux = no; then
  if test "x$with_lxc" != xyes
...
fi


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_ARG_WITH([network],
    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

s/theres/there's/

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

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

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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]