[app-emulation/qemu] sync with tree

This commit is contained in:
Robert Förster 2014-04-26 10:00:12 +02:00
parent 3b15cad1f2
commit 754764e337
1 changed files with 120 additions and 124 deletions

View File

@ -36,28 +36,21 @@ rbd sasl +seccomp sdl selinux smartcard spice ssh static static-softmmu \
static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \ static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \
virtfs +vnc xattr xen xfs" virtfs +vnc xattr xen xfs"
COMMON_TARGETS="i386 x86_64 alpha arm cris m68k microblaze microblazeel mips COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
mipsel mips64 mips64el or32 ppc ppc64 sh4 sh4eb sparc sparc64 s390x unicore32" mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32
x86_64"
IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb" IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb"
IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus" IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus"
# Setup the default SoftMMU targets, while using the loops use_targets="
# below to setup the other targets. $(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
REQUIRED_USE="|| (" $(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
"
IUSE+=" ${use_targets}"
for target in ${IUSE_SOFTMMU_TARGETS}; do # Require at least one softmmu or user target.
IUSE="${IUSE} qemu_softmmu_targets_${target}" # Block USE flag configurations known to not work.
REQUIRED_USE="${REQUIRED_USE} qemu_softmmu_targets_${target}" REQUIRED_USE="|| ( ${use_targets} )
done
for target in ${IUSE_USER_TARGETS}; do
IUSE="${IUSE} qemu_user_targets_${target}"
REQUIRED_USE="${REQUIRED_USE} qemu_user_targets_${target}"
done
REQUIRED_USE="${REQUIRED_USE} )"
# Block USE flag configurations known to not work
REQUIRED_USE="${REQUIRED_USE}
python? ( ${PYTHON_REQUIRED_USE} ) python? ( ${PYTHON_REQUIRED_USE} )
qemu_softmmu_targets_arm? ( fdt ) qemu_softmmu_targets_arm? ( fdt )
qemu_softmmu_targets_microblaze? ( fdt ) qemu_softmmu_targets_microblaze? ( fdt )
@ -68,9 +61,9 @@ REQUIRED_USE="${REQUIRED_USE}
virtfs? ( xattr )" virtfs? ( xattr )"
# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. # Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)] COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
sys-apps/pciutils[static-libs(+)] sys-libs/zlib[static-libs(+)]"
sys-libs/zlib[static-libs(+)] SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
>=x11-libs/pixman-0.28.0[static-libs(+)] >=x11-libs/pixman-0.28.0[static-libs(+)]
aio? ( dev-libs/libaio[static-libs(+)] ) aio? ( dev-libs/libaio[static-libs(+)] )
caps? ( sys-libs/libcap-ng[static-libs(+)] ) caps? ( sys-libs/libcap-ng[static-libs(+)] )
@ -92,8 +85,9 @@ LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
vde? ( net-misc/vde[static-libs(+)] ) vde? ( net-misc/vde[static-libs(+)] )
xattr? ( sys-apps/attr[static-libs(+)] ) xattr? ( sys-apps/attr[static-libs(+)] )
xfs? ( sys-fs/xfsprogs[static-libs(+)] )" xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
RDEPEND="!static-softmmu? ( ${LIB_DEPEND//\[static-libs(+)]} ) USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
static-user? ( >=dev-libs/glib-2.0[static-libs(+)] ) RDEPEND="!static-softmmu? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} )
!static-user? ( ${USER_LIB_DEPEND//\[static-libs(+)]} )
qemu_softmmu_targets_i386? ( qemu_softmmu_targets_i386? (
>=sys-firmware/ipxe-1.0.0_p20130624 >=sys-firmware/ipxe-1.0.0_p20130624
~sys-firmware/seabios-1.7.4 ~sys-firmware/seabios-1.7.4
@ -123,14 +117,14 @@ RDEPEND="!static-softmmu? ( ${LIB_DEPEND//\[static-libs(+)]} )
usbredir? ( >=sys-apps/usbredir-0.6 ) usbredir? ( >=sys-apps/usbredir-0.6 )
virtfs? ( sys-libs/libcap ) virtfs? ( sys-libs/libcap )
xen? ( app-emulation/xen-tools )" xen? ( app-emulation/xen-tools )"
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
dev-lang/perl dev-lang/perl
=dev-lang/python-2* =dev-lang/python-2*
sys-apps/texinfo sys-apps/texinfo
virtual/pkgconfig virtual/pkgconfig
kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
static-softmmu? ( ${LIB_DEPEND} ) static-softmmu? ( ${SOFTMMU_LIB_DEPEND} )
static-user? ( ${USER_LIB_DEPEND} )
test? ( test? (
dev-libs/glib[utils] dev-libs/glib[utils]
sys-devel/bc sys-devel/bc
@ -252,137 +246,139 @@ src_prepare() {
# we are using. # we are using.
# #
qemu_src_configure() { qemu_src_configure() {
debug-print-function $FUNCNAME "$@" debug-print-function ${FUNCNAME} "$@"
local buildtype=$1 local buildtype=$1
local builddir=$2 local builddir=$2
local conf_opts audio_opts
local static_flag="static-${buildtype}" local static_flag="static-${buildtype}"
conf_opts="--prefix=/usr"
conf_opts+=" --sysconfdir=/etc"
conf_opts+=" --libdir=/usr/$(get_libdir)"
conf_opts+=" --docdir=/usr/share/doc/${PF}/html"
conf_opts+=" --disable-bsd-user"
conf_opts+=" --disable-guest-agent"
conf_opts+=" --disable-strip"
conf_opts+=" --disable-werror"
conf_opts+=" --python=${PYTHON}"
# audio options # audio options
audio_opts="oss" local audio_opts="oss"
use alsa && audio_opts="alsa,${audio_opts}" use alsa && audio_opts="alsa,${audio_opts}"
use sdl && audio_opts="sdl,${audio_opts}" use sdl && audio_opts="sdl,${audio_opts}"
use pulseaudio && audio_opts="pa,${audio_opts}" use pulseaudio && audio_opts="pa,${audio_opts}"
if [[ ${buildtype} == "user" ]]; then local conf_opts=(
conf_opts+=" --enable-linux-user" --prefix=/usr
conf_opts+=" --disable-system" --sysconfdir=/etc
conf_opts+=" --target-list=${user_targets}" --libdir=/usr/$(get_libdir)
conf_opts+=" --disable-blobs" --docdir=/usr/share/doc/${PF}/html
conf_opts+=" --disable-bluez" --disable-bsd-user
conf_opts+=" --disable-curses" --disable-guest-agent
conf_opts+=" --disable-kvm" --disable-strip
conf_opts+=" --disable-libiscsi" --disable-werror
conf_opts+=" --disable-glusterfs" --python="${PYTHON}"
conf_opts+=" $(use_enable seccomp)" --cc="$(tc-getCC)"
conf_opts+=" --disable-sdl" --host-cc="$(tc-getBUILD_CC)"
conf_opts+=" --disable-smartcard-nss" $(use_enable debug debug-info)
conf_opts+=" --disable-tools" $(use_enable debug debug-tcg)
conf_opts+=" --disable-vde" --enable-docs
conf_opts+=" --disable-libssh2" $(use_enable tci tcg-interpreter)
conf_opts+=" --disable-libusb" )
fi
if [[ ${buildtype} == "softmmu" ]]; then case ${buildtype} in
conf_opts+=" --disable-linux-user" user)
conf_opts+=" --enable-system" conf_opts+=(
conf_opts+=" --with-system-pixman" --enable-linux-user
conf_opts+=" --target-list=${softmmu_targets}" --disable-system
conf_opts+=" $(use_enable bluetooth bluez)" --target-list="${user_targets}"
conf_opts+=" $(use_enable gtk)" --disable-blobs
use gtk && conf_opts+=" --with-gtkabi=3.0" --disable-bluez
conf_opts+=" $(use_enable sdl)" --disable-curses
conf_opts+=" $(use_enable aio linux-aio)" --disable-kvm
conf_opts+=" $(use_enable accessibility brlapi)" --disable-libiscsi
conf_opts+=" $(use_enable caps cap-ng)" --disable-glusterfs
conf_opts+=" $(use_enable curl)" --disable-seccomp
conf_opts+=" $(use_enable fdt)" --disable-sdl
conf_opts+=" $(use_enable glusterfs)" --disable-smartcard-nss
conf_opts+=" $(use_enable iscsi libiscsi)" --disable-tools
conf_opts+=" $(use_enable jpeg vnc-jpeg)" --disable-vde
conf_opts+=" $(use_enable kernel_linux kvm)" --disable-libssh2
conf_opts+=" $(use_enable ncurses curses)" --disable-libusb
conf_opts+=" $(use_enable opengl glx)" )
conf_opts+=" $(use_enable png vnc-png)" ;;
conf_opts+=" $(use_enable rbd)" softmmu)
conf_opts+=" $(use_enable sasl vnc-sasl)" conf_opts+=(
conf_opts+=" $(use_enable seccomp)" --disable-linux-user
conf_opts+=" $(use_enable smartcard smartcard-nss)" --enable-system
conf_opts+=" $(use_enable spice)" --with-system-pixman
conf_opts+=" $(use_enable ssh libssh2)" --target-list="${softmmu_targets}"
conf_opts+=" $(use_enable tls vnc-tls)" $(use_enable bluetooth bluez)
conf_opts+=" $(use_enable tls vnc-ws)" $(use_enable gtk)
conf_opts+=" $(use_enable usb libusb)" $(use_enable sdl)
conf_opts+=" $(use_enable usbredir usb-redir)" $(use_enable aio linux-aio)
conf_opts+=" $(use_enable uuid)" $(use_enable accessibility brlapi)
conf_opts+=" $(use_enable vde)" $(use_enable caps cap-ng)
conf_opts+=" $(use_enable vhost-net)" $(use_enable curl)
conf_opts+=" $(use_enable virtfs)" $(use_enable fdt)
conf_opts+=" $(use_enable vnc)" $(use_enable glusterfs)
conf_opts+=" $(use_enable xattr attr)" $(use_enable iscsi libiscsi)
conf_opts+=" $(use_enable xen)" $(use_enable jpeg vnc-jpeg)
conf_opts+=" $(use_enable xen xen-pci-passthrough)" $(use_enable kernel_linux kvm)
conf_opts+=" $(use_enable xfs xfsctl)" $(use_enable ncurses curses)
conf_opts+=" --audio-drv-list=${audio_opts}" $(use_enable opengl glx)
fi $(use_enable png vnc-png)
$(use_enable rbd)
conf_opts+=" $(use_enable debug debug-info)" $(use_enable sasl vnc-sasl)
conf_opts+=" $(use_enable debug debug-tcg)" $(use_enable seccomp)
conf_opts+=" --enable-docs" $(use_enable smartcard smartcard-nss)
conf_opts+=" $(use_enable tci tcg-interpreter)" $(use_enable spice)
$(use_enable ssh libssh2)
$(use_enable tls vnc-tls)
$(use_enable tls vnc-ws)
$(use_enable usb libusb)
$(use_enable usbredir usb-redir)
$(use_enable uuid)
$(use_enable vde)
$(use_enable vhost-net)
$(use_enable virtfs)
$(use_enable vnc)
$(use_enable xattr attr)
$(use_enable xen)
$(use_enable xen xen-pci-passthrough)
$(use_enable xfs xfsctl)
--audio-drv-list="${audio_opts}"
)
use gtk && conf_opts+=( --with-gtkabi=3.0 )
;;
esac
# Add support for SystemTAP # Add support for SystemTAP
use systemtap && conf_opts="${conf_opts} --enable-trace-backend=dtrace" use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
# Add support for static builds
use ${static_flag} && conf_opts="${conf_opts} --static --disable-pie"
# We always want to attempt to build with PIE support as it results # We always want to attempt to build with PIE support as it results
# in a more secure binary. But it doesn't work with static or if # in a more secure binary. But it doesn't work with static or if
# the current GCC doesn't have PIE support. # the current GCC doesn't have PIE support.
if ! use ${static_flag} && gcc-specs-pie; then if use ${static_flag}; then
conf_opts="${conf_opts} --enable-pie" conf_opts+=( --static --disable-pie )
else
gcc-specs-pie && conf_opts+=( --enable-pie )
fi fi
einfo "./configure ${conf_opts}" einfo "./configure ${conf_opts[*]}"
cd ${builddir} cd "${builddir}"
../configure \ ../configure "${conf_opts[@]}" || die "configure failed"
--cc="$(tc-getCC)" \
--host-cc="$(tc-getBUILD_CC)" \
${conf_opts} \
|| die "configure failed"
# FreeBSD's kernel does not support QEMU assigning/grabbing # FreeBSD's kernel does not support QEMU assigning/grabbing
# host USB devices yet # host USB devices yet
use kernel_FreeBSD && \ use kernel_FreeBSD && \
sed -E -e "s|^(HOST_USB=)bsd|\1stub|" -i "${S}"/config-host.mak sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
} }
src_configure() { src_configure() {
local target
python_export_best python_export_best
softmmu_targets= softmmu_targets=
user_targets= user_targets=
for target in ${IUSE_SOFTMMU_TARGETS} ; do for target in ${IUSE_SOFTMMU_TARGETS} ; do
use "qemu_softmmu_targets_${target}" && \ use "qemu_softmmu_targets_${target}" && softmmu_targets+=",${target}-softmmu"
softmmu_targets="${softmmu_targets},${target}-softmmu"
done done
for target in ${IUSE_USER_TARGETS} ; do for target in ${IUSE_USER_TARGETS} ; do
use "qemu_user_targets_${target}" && \ use "qemu_user_targets_${target}" && user_targets+=",${target}-linux-user"
user_targets="${user_targets},${target}-linux-user"
done done
[[ -n ${softmmu_targets} ]] && \ [[ -n ${softmmu_targets} ]] && \