diff options
author | ryoon <ryoon@pkgsrc.org> | 2015-12-21 12:10:22 +0000 |
---|---|---|
committer | ryoon <ryoon@pkgsrc.org> | 2015-12-21 12:10:22 +0000 |
commit | 9bc7ccaf16ef8884172cc78ed9945226e2ebbed4 (patch) | |
tree | 74ca1407c4f7369b5fcce8e9fd34c1a76bac6070 /emulators/qemu/patches | |
parent | a18f3316918334836ab28241263ad1e46ec26092 (diff) | |
download | pkgsrc-9bc7ccaf16ef8884172cc78ed9945226e2ebbed4.tar.gz |
Fix build under NetBSD 6 or other platform that has no shm_open()
Fix PR pkg/50572.
Diffstat (limited to 'emulators/qemu/patches')
-rw-r--r-- | emulators/qemu/patches/patch-Makefile.objs | 12 | ||||
-rw-r--r-- | emulators/qemu/patches/patch-configure | 52 | ||||
-rw-r--r-- | emulators/qemu/patches/patch-default-configs_pci.mak | 11 |
3 files changed, 72 insertions, 3 deletions
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 |