aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-11-08 22:52:35 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-12-18 10:55:25 +0100
commit65eff01bcf920bcdbdb83dd0546005b522742c47 (patch)
tree164c91911c5b180652338fcb4b06025bfd136450 /configure
parentba7c60c203eb068cff591e4d0e7dbcc2b5aa013a (diff)
configure: move target detection before CPU detection
This makes more sense, since target detection can affect CPU detection on Solaris. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure115
1 files changed, 55 insertions, 60 deletions
diff --git a/configure b/configure
index e72e34b684..f0a82dd8f5 100755
--- a/configure
+++ b/configure
@@ -527,16 +527,67 @@ else
targetos=bogus
fi
-# Some host OSes need non-standard checks for which CPU to use.
-# Note that these checks are broken for cross-compilation: if you're
-# cross-compiling to one of these OSes then you'll need to specify
-# the correct CPU with the --cpu option.
+# OS specific
+
case $targetos in
+windows)
+ mingw32="yes"
+ plugins="no"
+ pie="no"
+;;
+gnu/kfreebsd)
+ bsd="yes"
+;;
+freebsd)
+ bsd="yes"
+ bsd_user="yes"
+ make="${MAKE-gmake}"
+ # needed for kinfo_getvmmap(3) in libutil.h
+;;
+dragonfly)
+ bsd="yes"
+ make="${MAKE-gmake}"
+;;
+netbsd)
+ bsd="yes"
+ make="${MAKE-gmake}"
+;;
+openbsd)
+ bsd="yes"
+ make="${MAKE-gmake}"
+;;
+darwin)
+ bsd="yes"
+ darwin="yes"
+ # Disable attempts to use ObjectiveC features in os/object.h since they
+ # won't work when we're compiling with gcc as a C compiler.
+ QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
+;;
sunos)
+ solaris="yes"
+ make="${MAKE-gmake}"
+ smbd="${SMBD-/usr/sfw/sbin/smbd}"
+# needed for CMSG_ macros in sys/socket.h
+ QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
+# needed for TIOCWIN* defines in termios.h
+ QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
# $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo
+ # Note that this check is broken for cross-compilation: if you're
+ # cross-compiling to one of these OSes then you'll need to specify
+ # the correct CPU with the --cpu option.
if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
cpu="x86_64"
fi
+;;
+haiku)
+ pie="no"
+ QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE -fPIC $QEMU_CFLAGS"
+;;
+linux)
+ linux="yes"
+ linux_user="yes"
+ vhost_user=${default_feature:-yes}
+;;
esac
if test ! -z "$cpu" ; then
@@ -620,62 +671,6 @@ if test -z "$ARCH"; then
ARCH="$cpu"
fi
-# OS specific
-
-case $targetos in
-windows)
- mingw32="yes"
- plugins="no"
- pie="no"
-;;
-gnu/kfreebsd)
- bsd="yes"
-;;
-freebsd)
- bsd="yes"
- bsd_user="yes"
- make="${MAKE-gmake}"
- # needed for kinfo_getvmmap(3) in libutil.h
-;;
-dragonfly)
- bsd="yes"
- make="${MAKE-gmake}"
-;;
-netbsd)
- bsd="yes"
- make="${MAKE-gmake}"
-;;
-openbsd)
- bsd="yes"
- make="${MAKE-gmake}"
-;;
-darwin)
- bsd="yes"
- darwin="yes"
- # Disable attempts to use ObjectiveC features in os/object.h since they
- # won't work when we're compiling with gcc as a C compiler.
- QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
-;;
-sunos)
- solaris="yes"
- make="${MAKE-gmake}"
- smbd="${SMBD-/usr/sfw/sbin/smbd}"
-# needed for CMSG_ macros in sys/socket.h
- QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
-# needed for TIOCWIN* defines in termios.h
- QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
-;;
-haiku)
- pie="no"
- QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE -fPIC $QEMU_CFLAGS"
-;;
-linux)
- linux="yes"
- linux_user="yes"
- vhost_user=${default_feature:-yes}
-;;
-esac
-
: ${make=${MAKE-make}}
# We prefer python 3.x. A bare 'python' is traditionally