Index: head/emulators/qemu30/Makefile =================================================================== --- head/emulators/qemu30/Makefile (revision 528818) +++ head/emulators/qemu30/Makefile (revision 528819) @@ -1,144 +1,147 @@ # Created by: Juergen Lock # $FreeBSD$ PORTNAME= qemu PORTVERSION= 3.0.1 CATEGORIES= emulators MASTER_SITES= https://download.qemu.org/ PKGNAMESUFFIX= 30 DIST_SUBDIR= qemu/${PORTVERSION} MAINTAINER?= bofh@FreeBSD.org COMMENT?= QEMU CPU Emulator LICENSE= GPLv2 +DEPRECATED= No longer maintained by upstream +EXPIRATION_DATE=2020-04-21 + LIB_DEPENDS?= libnettle.so:security/nettle \ libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 USES?= compiler:c11 cpe gmake gnome pkgconfig bison perl5 python:build \ tar:xz USE_PERL5= build PORTSCOUT= limit:^3\.0\. HAS_CONFIGURE= yes MAKE_ENV+= BSD_MAKE="${MAKE}" V=1 OPTIONS_DEFINE= SAMBA X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CURL \ VDE CDROM_DMA PCAP USBREDIR X86_TARGETS \ STATIC_LINK DOCS NCURSES CDROM_DMA_DESC= IDE CDROM DMA GNUTLS_DESC= gnutls dependency (vnc encryption) JPEG_DESC= jpeg dependency (vnc lossy compression) PCAP_DESC= pcap dependency (networking with bpf) PNG_DESC= png dependency (vnc compression) SAMBA_DESC= samba dependency (for -smb) SASL_DESC= cyrus-sasl dependency (vnc encryption) STATIC_LINK_DESC= Statically link the executables USBREDIR_DESC= usb device network redirection (experimental!) VDE_DESC= vde dependency (for vde networking) X86_TARGETS_DESC= Build only x86 system targets OPTIONS_DEFAULT=X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA CURL PCAP NCURSES VDE OPTIONS_SUB= yes CURL_CONFIGURE_OFF= --disable-curl CURL_LIB_DEPENDS= libcurl.so:ftp/curl DOCS_BUILD_DEPENDS= texi2html:textproc/texi2html DOCS_MAKE_ARGS_OFF= NOPORTDOCS=1 DOCS_USES= makeinfo GNUTLS_CONFIGURE_OFF= --disable-gnutls GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls GTK3_CONFIGURE_OFF= --disable-gtk --disable-vte GTK3_LIB_DEPENDS= libxkbcommon.so:x11/libxkbcommon \ libepoxy.so:graphics/libepoxy \ libpcre2-8.so:devel/pcre2 GTK3_USE= GNOME=gtk30,vte3,gdkpixbuf2 XORG=x11,xext GL=gbm GTK3_USES= gettext gl gnome xorg JPEG_CONFIGURE_OFF= --disable-vnc-jpeg JPEG_USES= jpeg NCURSES_USES= ncurses:base OPENGL_CONFIGURE_OFF= --disable-opengl OPENGL_USE= GL=glu OPENGL_USES= gl PCAP_CONFIGURE_ON= --enable-pcap PCAP_EXTRA_PATCHES= ${FILESDIR}/pcap-patch ${FILESDIR}/pcap-patch-net_net.c \ ${FILESDIR}/pcap-patch-net_clients.h PNG_CONFIGURE_OFF= --disable-vnc-png PNG_LIB_DEPENDS= libpng.so:graphics/png SAMBA_CONFIGURE_ON= --smbd=${LOCALBASE}/sbin/smbd SAMBA_USES= samba:run # smbd SASL_CONFIGURE_OFF= --disable-vnc-sasl SASL_LIB_DEPENDS= libsasl2.so:security/cyrus-sasl2 STATIC_LINK_CONFIGURE_ON= --static STATIC_LINK_PREVENTS= GTK2 X11 STATIC_LINK_PREVENTS_MSG= X11 ui cannot be built static USBREDIR_BUILD_DEPENDS= usbredir>=0.6:net/usbredir USBREDIR_CONFIGURE_OFF= --disable-usb-redir USBREDIR_RUN_DEPENDS= usbredir>=0.6:net/usbredir VDE_CONFIGURE_OFF= --disable-vde VDE_LIB_DEPENDS= libvdeplug.so:net/vde2 X11_CONFIGURE_ENABLE= sdl X11_USE= SDL=sdl2 XORG=x11,xext X11_USES= sdl xorg .if !defined(PKGNAMESUFFIX) || ${PKGNAMESUFFIX} != "-utils" X86_TARGETS_USE_OFF= GNOME=cairo,gdkpixbuf2 .endif PORTDOCS?= docs qemu-doc.html qemu-doc.txt qemu-ga-ref.html qemu-ga-ref.txt \ qemu-qmp-ref.html qemu-qmp-ref.txt WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation CFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} CONFIGURE_ARGS?=--localstatedir=/var --extra-ldflags=-L\"/usr/lib\" \ --extra-ldflags=-L\"${LOCALBASE}/lib\" --disable-libssh2 --enable-debug \ --prefix=${PREFIX} --cc=${CC} --enable-netmap --enable-docs --disable-kvm \ --disable-linux-user --disable-linux-aio --disable-xen \ --enable-debug-info --python=${PYTHON_CMD} \ --extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\" .include .if !defined(STRIP) || ${STRIP} == "" CONFIGURE_ARGS+=--disable-strip .endif .if ${ARCH} == "amd64" MAKE_ARGS+= ARCH=x86_64 .endif .if ${ARCH} == "powerpc" MAKE_ARGS+= ARCH=ppc .endif .if ${ARCH} == "powerpc64" MAKE_ARGS+= ARCH=ppc64 .endif .if ${ARCH} == "sparc64" CONFIGURE_ARGS+= --sparc_cpu=v9 .endif PLIST_SUB+= LINUXBOOT_DMA="" post-patch-CDROM_DMA-off: @${REINPLACE_CMD} -e '/USE_DMA_CDROM/d' ${WRKSRC}/include/hw/ide/internal.h # XXX need to disable usb host code on head while it's not ported to the # new usb stack yet post-configure: @${REINPLACE_CMD} -E \ -e "s|^(HOST_USB=)bsd|\1stub|" \ ${WRKSRC}/config-host.mak .if !target(post-install) post-install: ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample ${STAGEDIR}${PREFIX}/etc ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample ${STAGEDIR}${PREFIX}/etc @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-* post-install-DOCS-on: @(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR}/) .endif .include Index: head/emulators/qemu30/files/patch-configure =================================================================== --- head/emulators/qemu30/files/patch-configure (revision 528818) +++ head/emulators/qemu30/files/patch-configure (revision 528819) @@ -1,264 +1,314 @@ ---- configure.orig 2019-04-14 21:25:18 UTC +--- configure.orig 2019-04-12 03:28:28 UTC +++ configure @@ -375,6 +375,7 @@ hax="no" hvf="no" whpx="no" rdma="" +pvrdma="" gprof="no" debug_tcg="no" debug="no" @@ -391,7 +392,7 @@ DSOSUF=".so" LDFLAGS_SHARED="-shared" modules="no" prefix="/usr/local" -mandir="\${prefix}/share/man" +mandir="\${prefix}/man" datadir="\${prefix}/share" firmwarepath="\${prefix}/share/qemu-firmware" qemu_docdir="\${prefix}/share/doc/qemu" @@ -471,6 +472,9 @@ numa="" tcmalloc="no" jemalloc="no" replication="yes" +pcap="no" +pcap_create="no" +bpf="no" vxhs="" libxml2="" docker="no" @@ -1087,6 +1091,10 @@ for opt do ;; --enable-vnc-png) vnc_png="yes" ;; + --enable-pcap) pcap="yes" + ;; + --disable-pcap) pcap="no" + ;; --disable-slirp) slirp="no" ;; --disable-vde) vde="no" @@ -1363,6 +1371,10 @@ for opt do ;; --disable-rdma) rdma="no" ;; + --enable-pvrdma) pvrdma="yes" + ;; + --disable-pvrdma) pvrdma="no" + ;; --with-gtkabi=*) gtkabi="$optarg" ;; --disable-vte) vte="no" @@ -1669,7 +1681,8 @@ disabled with --disable-FEATURE, default is enabled if hax HAX acceleration support hvf Hypervisor.framework acceleration support whpx Windows Hypervisor Platform acceleration support - rdma Enable RDMA-based migration and PVRDMA support + rdma Enable RDMA-based migration + pvrdma Enable PVRDMA support vde support for vde network netmap support for netmap network linux-aio Linux AIO support @@ -2881,7 +2894,49 @@ else tasn1=no fi +########################################## +# PVRDMA detection +cat > $TMPC < + +int +main(void) +{ + char buf = 0; + void *addr = &buf; + addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED); + + return 0; +} +EOF + +if test "$rdma" = "yes" ; then + case "$pvrdma" in + "") + if compile_prog "" ""; then + pvrdma="yes" + else + pvrdma="no" + fi + ;; + "yes") + if ! compile_prog "" ""; then + error_exit "PVRDMA is not supported since mremap is not implemented" + fi + pvrdma="yes" + ;; + "no") + pvrdma="no" + ;; + esac +else + if test "$pvrdma" = "yes" ; then + error_exit "PVRDMA requires rdma suppport" + fi + pvrdma="no" +fi + ########################################## # getifaddrs (for tests/test-io-channel-socket ) @@ -2891,6 +2946,14 @@ if ! check_include "ifaddrs.h" ; then fi ########################################## +# getifaddrs (for tests/test-io-channel-socket ) + +have_ifaddrs_h=yes +if ! check_include "ifaddrs.h" ; then + have_ifaddrs_h=no +fi + +########################################## # VTE probe if test "$vte" != "no"; then @@ -3061,7 +3124,51 @@ EOF fi fi +########################################## +# pcap probe +if test "$pcap" = "yes" -a "$pcap" != "no"; then + cat > $TMPC << EOF +#include +int main(void) { return (pcap_lib_version() == (char *)0 ? 1 : 0); } +EOF + if test "$mingw32" = "no" ; then + libpcap=-lpcap + else + libpcap=-lwpcap + fi + if compile_prog "" "$libpcap" ; then + : + else + echo + echo "Error: Could not find pcap" + echo "Make sure to have the pcap libs and headers installed." + echo + exit 1 + fi + cat > $TMPC << EOF +#include +int main(void) +{ + char errbuf[PCAP_ERRBUF_SIZE]; + return (pcap_create("foo", errbuf) == (pcap_t *)0 ? 1 : 0); +} +EOF + if compile_prog "" "$libpcap" ; then + pcap_create="yes" + fi + cat > $TMPC << EOF +#define PCAP_DONT_INCLUDE_PCAP_BPF_H +#include +#include +int main(void) { return (BPF_MAJOR_VERSION); } +EOF + if compile_prog ; then + bpf="yes" + fi + libs_softmmu="$libpcap $libs_softmmu" +fi # test "$pcap" + ########################################## # VNC SASL detection if test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then @@ -3474,7 +3581,7 @@ for i in $glib_modules; do glib_libs=$($pkg_config --libs $i) QEMU_CFLAGS="$glib_cflags $QEMU_CFLAGS" LIBS="$glib_libs $LIBS" - libs_qga="$glib_libs $libs_qga" + libs_qga="$glib_libs -lintl $libs_qga" else error_exit "glib-$glib_req_ver $i is required to compile QEMU" fi @@ -4419,14 +4526,7 @@ fi # Check if tools are available to build documentation. if test "$docs" != "no" ; then - if has makeinfo && has pod2man; then docs=yes - else - if test "$docs" = "yes" ; then - feature_not_found "docs" "Install texinfo and Perl/perl-podlators" - fi - docs=no - fi fi # Search for bswap_32 function @@ -4551,7 +4651,7 @@ fi # check for libusb if test "$libusb" != "no" ; then - if $pkg_config --atleast-version=1.0.13 libusb-1.0; then + if $pkg_config libusb-1.0; then libusb="yes" libusb_cflags=$($pkg_config --cflags libusb-1.0) libusb_libs=$($pkg_config --libs libusb-1.0) -@@ -5914,6 +6014,7 @@ echo "Audio drivers $audio_drv_list" +@@ -5779,27 +5879,30 @@ if ( [ "$linux_user" = yes ] || [ "$bsd_user" = yes ] + cat > $TMPC </dev/null 2>&1; then +- error_exit \ +- "We need to link the QEMU user mode binaries at a" \ +- "specific text address. Unfortunately your linker" \ +- "doesn't support either the -Ttext-segment option or" \ +- "printing the default linker script with --verbose." \ +- "If you don't want the user mode binaries, pass the" \ +- "--disable-user option to configure." +- fi ++ textseg_ldflags="-Wl,-Ttext-segment=$textseg_addr" ++ if ! compile_prog "" "$textseg_ldflags"; then ++ # In case ld does not support -Ttext-segment, edit the default linker ++ # script via sed to set the .text start addr. This is needed on FreeBSD ++ # at least. ++ if ! $ld --verbose >/dev/null 2>&1; then ++ error_exit \ ++ "We need to link the QEMU user mode binaries at a" \ ++ "specific text address. Unfortunately your linker" \ ++ "doesn't support either the -Ttext-segment option or" \ ++ "printing the default linker script with --verbose." \ ++ "If you don't want the user mode binaries, pass the" \ ++ "--disable-user option to configure." ++ fi + +- $ld --verbose | sed \ +- -e '1,/==================================================/d' \ +- -e '/==================================================/,$d' \ +- -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ +- -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld +- textseg_ldflags="-Wl,-T../config-host.ld" ++ $ld --verbose | sed \ ++ -e '1,/==================================================/d' \ ++ -e '/==================================================/,$d' \ ++ -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ ++ -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld ++ textseg_ldflags="-Wl,-T../config-host.ld" ++ fi + fi + fi + fi +@@ -5914,6 +6017,7 @@ echo "Audio drivers $audio_drv_list" echo "Block whitelist (rw) $block_drv_rw_whitelist" echo "Block whitelist (ro) $block_drv_ro_whitelist" echo "VirtFS support $virtfs" +echo "pcap support $pcap" echo "Multipath support $mpath" echo "VNC support $vnc" if test "$vnc" = "yes" ; then -@@ -5949,6 +6050,7 @@ if test "$tcg" = "yes" ; then +@@ -5949,6 +6053,7 @@ if test "$tcg" = "yes" ; then fi echo "malloc trim support $malloc_trim" echo "RDMA support $rdma" +echo "PVRDMA support $pvrdma" echo "fdt support $fdt" echo "membarrier $membarrier" echo "preadv support $preadv" -@@ -6143,6 +6245,15 @@ fi +@@ -6143,6 +6248,15 @@ fi if test "$profiler" = "yes" ; then echo "CONFIG_PROFILER=y" >> $config_host_mak fi +if test "$pcap" = "yes" ; then + echo "CONFIG_PCAP=y" >> $config_host_mak + if test "$pcap_create" = "yes" ; then + echo "CONFIG_PCAP_CREATE=y" >> $config_host_mak + fi + if test "$bpf" = "yes" ; then + echo "CONFIG_BPF=y" >> $config_host_mak + fi +fi if test "$slirp" = "yes" ; then echo "CONFIG_SLIRP=y" >> $config_host_mak echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak -@@ -6384,6 +6495,9 @@ fi +@@ -6384,6 +6498,9 @@ fi if test "$have_fsxattr" = "yes" ; then echo "HAVE_FSXATTR=y" >> $config_host_mak fi +if test "$have_ifaddrs_h" = "yes" ; then + echo "HAVE_IFADDRS_H=y" >> $config_host_mak +fi if test "$have_copy_file_range" = "yes" ; then echo "HAVE_COPY_FILE_RANGE=y" >> $config_host_mak fi -@@ -6703,6 +6817,10 @@ echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_m +@@ -6703,6 +6820,10 @@ echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_m if test "$rdma" = "yes" ; then echo "CONFIG_RDMA=y" >> $config_host_mak echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak +fi + +if test "$pvrdma" = "yes" ; then + echo "CONFIG_PVRDMA=y" >> $config_host_mak fi if test "$have_rtnetlink" = "yes" ; then