summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorryoon <ryoon>2015-12-21 12:10:22 +0000
committerryoon <ryoon>2015-12-21 12:10:22 +0000
commit9d02e9730130ed178d67f8868bcd694e547e72c8 (patch)
tree74ca1407c4f7369b5fcce8e9fd34c1a76bac6070 /emulators
parent85ad8af853612bcee0a2c5b67c956afa607bdd21 (diff)
downloadpkgsrc-9d02e9730130ed178d67f8868bcd694e547e72c8.tar.gz
Fix build under NetBSD 6 or other platform that has no shm_open()
Fix PR pkg/50572.
Diffstat (limited to 'emulators')
-rw-r--r--emulators/qemu/Makefile4
-rw-r--r--emulators/qemu/PLIST6
-rw-r--r--emulators/qemu/distinfo6
-rw-r--r--emulators/qemu/options.mk15
-rw-r--r--emulators/qemu/patches/patch-Makefile.objs12
-rw-r--r--emulators/qemu/patches/patch-configure52
-rw-r--r--emulators/qemu/patches/patch-default-configs_pci.mak11
7 files changed, 93 insertions, 13 deletions
diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile
index 70cd094ef7a..5f8f0dda9a7 100644
--- a/emulators/qemu/Makefile
+++ b/emulators/qemu/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.147 2015/12/18 22:39:33 ryoon Exp $
+# $NetBSD: Makefile,v 1.148 2015/12/21 12:10:22 ryoon Exp $
DISTNAME= qemu-2.5.0
CATEGORIES= emulators
@@ -80,7 +80,7 @@ PLIST.nbd= YES
CONFIGURE_ARGS+= --disable-coroutine-pool
.endif
-PLIST_VARS+= ${UE_ARCHS} nbd
+PLIST_VARS+= ${UE_ARCHS} nbd ivshmem
.for _var_ in ${USER_EMUL}
PLIST.${_var_}= YES
.endfor
diff --git a/emulators/qemu/PLIST b/emulators/qemu/PLIST
index a932fa84c7d..a74116ad138 100644
--- a/emulators/qemu/PLIST
+++ b/emulators/qemu/PLIST
@@ -1,6 +1,6 @@
-@comment $NetBSD: PLIST,v 1.44 2015/12/18 22:39:33 ryoon Exp $
-bin/ivshmem-client
-bin/ivshmem-server
+@comment $NetBSD: PLIST,v 1.45 2015/12/21 12:10:22 ryoon Exp $
+${PLIST.ivshmem}bin/ivshmem-client
+${PLIST.ivshmem}bin/ivshmem-server
${PLIST.alpha}bin/qemu-alpha
${PLIST.arm}bin/qemu-arm
${PLIST.armeb}bin/qemu-armeb
diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo
index ec33e0e63b1..6cdac51bcc4 100644
--- a/emulators/qemu/distinfo
+++ b/emulators/qemu/distinfo
@@ -1,10 +1,12 @@
-$NetBSD: distinfo,v 1.109 2015/12/18 22:39:33 ryoon Exp $
+$NetBSD: distinfo,v 1.110 2015/12/21 12:10:22 ryoon Exp $
SHA1 (qemu-2.5.0.tar.bz2) = ed6c02a267f9edf98058743f0f76a25743a0dfe7
RMD160 (qemu-2.5.0.tar.bz2) = 51007a50ddbeae1ba2c986e0cb0b110efeae2dc9
SHA512 (qemu-2.5.0.tar.bz2) = 12153f94cc7f834fd6a85f25690c36f2331d88d414426fb8b9ac20a34e6f9222b1eda30b727674af583580fae90dfd6d0614a905dce1567d94cd049d426b9dd3
Size (qemu-2.5.0.tar.bz2) = 25464996 bytes
-SHA1 (patch-configure) = cc58f66ea917ca678a5ed5b56e5fc94d1f61a639
+SHA1 (patch-Makefile.objs) = 81274d0dde593a8379428df1f974d6c50a65dd92
+SHA1 (patch-configure) = 7ef7a8e1071edc56b317d214ec285ceecf08a68c
+SHA1 (patch-default-configs_pci.mak) = 09567d0d56cdee3d72ae93c0609dee7ca749ef18
SHA1 (patch-ef) = 6e57de87f91067e8a9a1388c91133a31b3582b3a
SHA1 (patch-et) = e9b850ac5985cbe934b541acbfdb330cce421d50
SHA1 (patch-hw_display_omap__dss.c) = 6b13242f28e32346bc70548c216c578d98fd3420
diff --git a/emulators/qemu/options.mk b/emulators/qemu/options.mk
index eac6719eb9e..a4403f017f5 100644
--- a/emulators/qemu/options.mk
+++ b/emulators/qemu/options.mk
@@ -1,12 +1,16 @@
-# $NetBSD: options.mk,v 1.1 2011/02/28 17:49:30 wiz Exp $
+# $NetBSD: options.mk,v 1.2 2015/12/21 12:10:22 ryoon Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.qemu
-PKG_SUPPORTED_OPTIONS= sdl
+PKG_SUPPORTED_OPTIONS= sdl ivshmem
.include "../../mk/bsd.fast.prefs.mk"
+.if empty(MACHINE_PLATFORM:MNetBSD-[5-6].*-*)
+PKG_SUGGESTED_OPTIONS+= ivshmem
+.endif
+
.if empty(OPSYS:MDarwin)
-PKG_SUGGESTED_OPTIONS= sdl
+PKG_SUGGESTED_OPTIONS+= sdl
.endif
.include "../../mk/bsd.options.mk"
@@ -17,3 +21,8 @@ CONFIGURE_ARGS+= --enable-sdl
.else
CONFIGURE_ARGS+= --disable-sdl
.endif
+
+.if !empty(PKG_OPTIONS:Mivshmem)
+PLIST.ivshmem= yes
+.endif
+
diff --git a/emulators/qemu/patches/patch-Makefile.objs b/emulators/qemu/patches/patch-Makefile.objs
new file mode 100644
index 00000000000..8f76d78f6d5
--- /dev/null
+++ b/emulators/qemu/patches/patch-Makefile.objs
@@ -0,0 +1,12 @@
+$NetBSD: patch-Makefile.objs,v 1.1 2015/12/21 12:10:22 ryoon Exp $
+
+--- Makefile.objs.orig 2015-12-16 22:04:47.000000000 +0000
++++ Makefile.objs
+@@ -109,5 +109,7 @@ qga-vss-dll-obj-y = qga/
+
+ ######################################################################
+ # contrib
++ifeq ($(CONFIG_SHM_OPEN),y)
+ ivshmem-client-obj-y = contrib/ivshmem-client/
+ ivshmem-server-obj-y = contrib/ivshmem-server/
++endif
diff --git a/emulators/qemu/patches/patch-configure b/emulators/qemu/patches/patch-configure
index fad1d7d5472..078315ef843 100644
--- a/emulators/qemu/patches/patch-configure
+++ b/emulators/qemu/patches/patch-configure
@@ -1,4 +1,4 @@
-$NetBSD: patch-configure,v 1.7 2015/12/18 22:39:33 ryoon Exp $
+$NetBSD: patch-configure,v 1.8 2015/12/21 12:10:22 ryoon Exp $
Don't use gld on SunOS
--- configure.orig 2015-12-16 22:04:48.000000000 +0000
@@ -11,16 +11,62 @@ Don't use gld on SunOS
smbd="${SMBD-/usr/sfw/sbin/smbd}"
needs_libsunmath="no"
solarisrev=`uname -r | cut -f2 -d.`
-@@ -3935,8 +3934,12 @@ fi
+@@ -3672,6 +3671,23 @@ if compile_prog "" "" ; then
+ fallocate_zero_range=yes
+ fi
+
++# check for shm_open
++shm_open=no
++cat > $TMPC << EOF
++#include <sys/types.h>
++#include <sys/mman.h>
++#include <fcntl.h>
++
++int main(void)
++{
++ shm_open(NULL, O_RDWR, 0644);
++ return 0;
++}
++EOF
++if compile_prog "" "-lrt" ; then
++ shm_open=yes
++fi
++
+ # check for posix_fallocate
+ posix_fallocate=no
+ cat > $TMPC << EOF
+@@ -3935,8 +3951,13 @@ fi
cat > $TMPC <<EOF
#include <signal.h>
#include <time.h>
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <fcntl.h>
++
int main(void) {
timer_create(CLOCK_REALTIME, NULL, NULL);
-+ shm_open(NULL, O_RDWR, 0644);
++ shm_open(NULL, O_RDWR, 0644);
return clock_gettime(CLOCK_REALTIME, NULL);
}
EOF
+@@ -4568,7 +4589,9 @@ if test "$want_tools" = "yes" ; then
+ tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
+ if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
+ tools="qemu-nbd\$(EXESUF) $tools"
+- tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools"
++ if ["$shm_open" = "yes" ] ; then
++ tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools"
++ fi
+ fi
+ fi
+ if test "$softmmu" = yes ; then
+@@ -5049,6 +5072,9 @@ fi
+ if test "$fallocate_zero_range" = "yes" ; then
+ echo "CONFIG_FALLOCATE_ZERO_RANGE=y" >> $config_host_mak
+ fi
++if test "$shm_open" = "yes" ; then
++ echo "CONFIG_SHM_OPEN=y" >> $config_host_mak
++fi
+ if test "$posix_fallocate" = "yes" ; then
+ echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
+ fi
diff --git a/emulators/qemu/patches/patch-default-configs_pci.mak b/emulators/qemu/patches/patch-default-configs_pci.mak
new file mode 100644
index 00000000000..88e37d2e7f1
--- /dev/null
+++ b/emulators/qemu/patches/patch-default-configs_pci.mak
@@ -0,0 +1,11 @@
+$NetBSD: patch-default-configs_pci.mak,v 1.1 2015/12/21 12:10:22 ryoon Exp $
+
+--- default-configs/pci.mak.orig 2015-12-16 22:04:48.000000000 +0000
++++ default-configs/pci.mak
+@@ -35,5 +35,5 @@ CONFIG_SDHCI=y
+ CONFIG_EDU=y
+ CONFIG_VGA=y
+ CONFIG_VGA_PCI=y
+-CONFIG_IVSHMEM=$(CONFIG_POSIX)
++CONFIG_IVSHMEM=$(CONFIG_SHM_OPEN)
+ CONFIG_ROCKER=y