On 12/17/21 21:49, Richard Henderson wrote:
On 12/16/21 12:51 AM, Paolo Bonzini wrote:
@@ -541,7 +541,6 @@ gnu/kfreebsd)
  ;;
  freebsd)
    bsd="yes"
-  bsd_user="yes"
    make="${MAKE-gmake}"
    # needed for kinfo_getvmmap(3) in libutil.h
  ;;
@@ -586,7 +585,6 @@ haiku)
  ;;
  linux)
    linux="yes"
-  linux_user="yes"
    vhost_user=${default_feature:-yes}
  ;;
  esac
...
+if [ "$linux_user" != no ]; then
+    if [ "$targetos" = linux ] && [ -d $source_path/linux-user/host/$cpu ]; then
+        linux_user=yes
+    elif [ "$linux_user" = yes ]; then
+        error_exit "linux-user not supported on this architecture"
+    fi
+fi
+if [ "$bsd_user" != no ]; then
+    if [ -d $source_path/bsd-user/$targetos ]; then
+        bsd_user=yes
+    elif [ "$bsd_user" = yes ]; then
+        error_exit "bsd-user not supported on this host OS"
+    fi
+fi

Missing the check for $targetos = freebsd.
This looks like it would enable bsd_user on linux, etc.

It's replaced by checking for bsd-user/$targetos but yes, that would
flip the default for netbsd and openbsd.

A better condition is

if [ "$bsd_user" != no ]; then
    if [ "$bsd_user" = "" ]; then
        test $targetos = freebsd && bsd_user=yes
    fi
if [ "$bsd_user" = yes ] && ! [ -d $source_path/bsd-user/$targetos ]; then
        error_exit "bsd-user not supported on this host OS"
    fi
fi

Paolo

Reply via email to