summaryrefslogtreecommitdiff
path: root/emulators/qemu-devel
diff options
context:
space:
mode:
authorShaun Amott <shaun@FreeBSD.org>2006-08-21 23:02:01 +0000
committerShaun Amott <shaun@FreeBSD.org>2006-08-21 23:02:01 +0000
commitdaf9bed6c4571dbe6481411363257bb1d3655830 (patch)
tree00a8ba4f2cb05c72f7f5e74220c430131298e3b7 /emulators/qemu-devel
parentUpdates to 0.9. This release introduces multitag viewing. (diff)
- Fix build on 4.x [1]
- Respect CFLAGS [2] - Support parallel port under FreeBSD [3] PR: ports/102154 [1], ports/102188 [2] Submitted by: Juergen Lock <nox@jelal.kn-bremen.de> [1], Stanislav Sedov <ssedov@mbsd.msk.ru> [2], Robert Jenssen (via freebsd-ports) [3] Approved by: Juergen Lock <nox@jelal.kn-bremen.de> (maintainer) [2] [3]
Notes
Notes: svn path=/head/; revision=171135
Diffstat (limited to 'emulators/qemu-devel')
-rw-r--r--emulators/qemu-devel/Makefile13
-rw-r--r--emulators/qemu-devel/files/patch-PRId64113
-rw-r--r--emulators/qemu-devel/files/patch-be4
-rw-r--r--emulators/qemu-devel/files/patch-libmath34
-rw-r--r--emulators/qemu-devel/files/patch-vl.c-ppbus92
5 files changed, 236 insertions, 20 deletions
diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile
index 9efe2446d401..09f4b2cd1121 100644
--- a/emulators/qemu-devel/Makefile
+++ b/emulators/qemu-devel/Makefile
@@ -7,6 +7,7 @@
PORTNAME= qemu
PORTVERSION= 0.8.2
+PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= http://www.qemu.org/:release \
http://people.fruitsalad.org/nox/qemu/:snapshot \
@@ -39,9 +40,11 @@ USE_SDL= sdl
USE_PERL5= yes
PATCH_STRIP= -p1
CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC}
-MAKE_ENV+= BSD_MAKE=${MAKE}
+MAKE_ENV+= BSD_MAKE="${MAKE}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
MAN1= qemu.1 qemu-img.1
ONLY_FOR_ARCHS= amd64 i386
+WITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation
+
.if defined(WITH_KQEMU)
CONFIGURE_ARGS+= --enable-kqemu
.else
@@ -98,6 +101,14 @@ post-patch:
.if defined(WITH_RTL8139_TIMER)
@cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/rtl8139-re-patch
.endif
+ @${REINPLACE_CMD} -E \
+ -e "s,^(CFLAGS=).*,\1${CFLAGS} -fno-strict-aliasing," \
+ -e "s,^(LDFLAGS=).*,\1${LDFLAGS}," \
+ ${WRKSRC}/Makefile.target
+ @${REINPLACE_CMD} -E \
+ -e "s,^(CFLAGS=).*,\1${CFLAGS} -fno-strict-aliasing -I.," \
+ -e "s,^(LDFLAGS=).*,\1${LDFLAGS}," \
+ ${WRKSRC}/Makefile
post-install:
@${CAT} ${PKGMESSAGE}
diff --git a/emulators/qemu-devel/files/patch-PRId64 b/emulators/qemu-devel/files/patch-PRId64
new file mode 100644
index 000000000000..3d559d3be61b
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-PRId64
@@ -0,0 +1,113 @@
+Index: qemu/vl.h
+@@ -30,6 +30,12 @@
+ #include <stdarg.h>
+ #include <string.h>
+ #include <inttypes.h>
++#ifndef PRId64
++#define PRId64 "lld" /* int64_t */
++#define PRIo64 "llo" /* int64_t */
++#define PRIx64 "llx" /* int64_t */
++#define PRIu64 "llu" /* int64_t */
++#endif
+ #include <limits.h>
+ #include <time.h>
+ #include <ctype.h>
+Index: qemu/dis-asm.h
+@@ -13,6 +13,12 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <inttypes.h>
++#ifndef PRId64
++#define PRId64 "lld" /* int64_t */
++#define PRIo64 "llo" /* int64_t */
++#define PRIx64 "llx" /* int64_t */
++#define PRIu64 "llu" /* int64_t */
++#endif
+
+ #define PARAMS(x) x
+ typedef void *PTR;
+Index: qemu/kqemu.c
+@@ -33,6 +33,12 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <inttypes.h>
++#ifndef PRId64
++#define PRId64 "lld" /* int64_t */
++#define PRIo64 "llo" /* int64_t */
++#define PRIx64 "llx" /* int64_t */
++#define PRIu64 "llu" /* int64_t */
++#endif
+
+ #include "cpu.h"
+ #include "exec-all.h"
+Index: qemu/translate-all.c
+@@ -22,6 +22,12 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <inttypes.h>
++#ifndef PRId64
++#define PRId64 "lld" /* int64_t */
++#define PRIo64 "llo" /* int64_t */
++#define PRIx64 "llx" /* int64_t */
++#define PRIu64 "llu" /* int64_t */
++#endif
+
+ #include "config.h"
+
+Index: qemu/target-i386/helper.c
+@@ -21,6 +21,13 @@
+
+ //#define DEBUG_PCALL
+
++#ifndef PRId64
++#define PRId64 "lld" /* int64_t */
++#define PRIo64 "llo" /* int64_t */
++#define PRIx64 "llx" /* int64_t */
++#define PRIu64 "llu" /* int64_t */
++#endif
++
+ #if 0
+ #define raise_exception_err(a, b)\
+ do {\
+Index: qemu/target-i386/helper2.c
+@@ -22,6 +22,12 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <inttypes.h>
++#ifndef PRId64
++#define PRId64 "lld" /* int64_t */
++#define PRIo64 "llo" /* int64_t */
++#define PRIx64 "llx" /* int64_t */
++#define PRIu64 "llu" /* int64_t */
++#endif
+ #include <signal.h>
+ #include <assert.h>
+
+Index: qemu/target-ppc/translate.c
+@@ -22,6 +22,12 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <inttypes.h>
++#ifndef PRId64
++#define PRId64 "lld" /* int64_t */
++#define PRIo64 "llo" /* int64_t */
++#define PRIx64 "llx" /* int64_t */
++#define PRIu64 "llu" /* int64_t */
++#endif
+
+ #include "cpu.h"
+ #include "exec-all.h"
+Index: qemu/target-sparc/helper.c
+@@ -22,6 +22,12 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <inttypes.h>
++#ifndef PRId64
++#define PRId64 "lld" /* int64_t */
++#define PRIo64 "llo" /* int64_t */
++#define PRIx64 "llx" /* int64_t */
++#define PRIu64 "llu" /* int64_t */
++#endif
+ #include <signal.h>
+ #include <assert.h>
+
diff --git a/emulators/qemu-devel/files/patch-be b/emulators/qemu-devel/files/patch-be
index 95877801237d..71753fa84dfe 100644
--- a/emulators/qemu-devel/files/patch-be
+++ b/emulators/qemu-devel/files/patch-be
@@ -16,7 +16,7 @@ Index: qemu/vl.c
{
use_rt_clock = 0;
-#if defined(__linux__)
-+#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
{
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
@@ -25,7 +25,7 @@ Index: qemu/vl.c
static int64_t get_clock(void)
{
-#if defined(__linux__)
-+#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
if (use_rt_clock) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
diff --git a/emulators/qemu-devel/files/patch-libmath b/emulators/qemu-devel/files/patch-libmath
index 9bcf5af02449..e7e5cfb64034 100644
--- a/emulators/qemu-devel/files/patch-libmath
+++ b/emulators/qemu-devel/files/patch-libmath
@@ -24,7 +24,7 @@ diff -Nru qemu-0.7.0/bsd.orig/Makefile qemu-0.7.0/bsd/Makefile
+
+OBJS= ${SRCS:R:S/$/.o/}
+
-+CFLAGS= -O2 -Wall -I.
++CFLAGS+= -I.
+
+all: libmath.a
+
@@ -537,7 +537,7 @@ diff -Nru qemu-0.7.0/bsd.orig/amd64/s_ceill.S qemu-0.7.0/bsd/amd64/s_ceill.S
+
+#include <machine/asm.h>
+
-+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+
+ .file "s_ceill.c"
+ .section .rodata.cst8,"aM",@progbits,8
@@ -824,7 +824,7 @@ diff -Nru qemu-0.7.0/bsd.orig/amd64/s_floorl.S qemu-0.7.0/bsd/amd64/s_floorl.S
+
+#include <machine/asm.h>
+
-+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+
+ .file "s_floorl.c"
+ .section .rodata.cst8,"aM",@progbits,8
@@ -1085,7 +1085,7 @@ diff -Nru qemu-0.7.0/bsd.orig/amd64/s_isnormal.c qemu-0.7.0/bsd/amd64/s_isnormal
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
-+ * $FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $
++ * $FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $
+ */
+
+union IEEEf2bits {
@@ -1149,7 +1149,7 @@ diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrint.S qemu-0.7.0/bsd/amd64/s_llrint.S
+++ qemu-0.7.0/bsd/amd64/s_llrint.S Fri Apr 29 02:11:27 2005
@@ -0,0 +1,6 @@
+#include <machine/asm.h>
-+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+
+/* sizeof(long) == sizeof(long long) */
+#define fn llrint
@@ -1159,7 +1159,7 @@ diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrintf.S qemu-0.7.0/bsd/amd64/s_llrintf.S
+++ qemu-0.7.0/bsd/amd64/s_llrintf.S Fri Apr 29 02:11:27 2005
@@ -0,0 +1,6 @@
+#include <machine/asm.h>
-+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+
+/* sizeof(long) == sizeof(long long) */
+#define fn llrintf
@@ -1236,7 +1236,7 @@ diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrint.S qemu-0.7.0/bsd/amd64/s_lrint.S
+#include <machine/asm.h>
+
+#ifndef fn
-+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+#define fn lrint
+#endif
+
@@ -1276,7 +1276,7 @@ diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrintf.S qemu-0.7.0/bsd/amd64/s_lrintf.S
+#include <machine/asm.h>
+
+#ifndef fn
-+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+#define fn lrintf
+#endif
+
@@ -1341,7 +1341,7 @@ diff -Nru qemu-0.7.0/bsd.orig/amd64/s_round.c qemu-0.7.0/bsd/amd64/s_round.c
+ */
+
+#include <sys/cdefs.h>
-+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $");
++__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $");
+
+#include <math.h>
+
@@ -1936,7 +1936,7 @@ diff -Nru qemu-0.7.0/bsd.orig/i386/s_ceill.S qemu-0.7.0/bsd/i386/s_ceill.S
+ */
+
+#include <machine/asm.h>
-+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+
+ENTRY(ceill)
+ pushl %ebp
@@ -2003,7 +2003,7 @@ diff -Nru qemu-0.7.0/bsd.orig/i386/s_floorl.S qemu-0.7.0/bsd/i386/s_floorl.S
+ */
+
+#include <machine/asm.h>
-+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+
+ENTRY(floorl)
+ pushl %ebp
@@ -2054,7 +2054,7 @@ diff -Nru qemu-0.7.0/bsd.orig/i386/s_isnormal.c qemu-0.7.0/bsd/i386/s_isnormal.c
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
-+ * $FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $
++ * $FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $
+ */
+
+union IEEEf2bits {
@@ -2144,7 +2144,7 @@ diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrint.S qemu-0.7.0/bsd/i386/s_llrint.S
+ */
+
+#include <machine/asm.h>
-+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $");
++RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $");
+
+ENTRY(llrint)
+ fldl 4(%esp)
@@ -2184,7 +2184,7 @@ diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrintf.S qemu-0.7.0/bsd/i386/s_llrintf.S
+ */
+
+#include <machine/asm.h>
-+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+
+ENTRY(llrintf)
+ flds 4(%esp)
@@ -2263,7 +2263,7 @@ diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrint.S qemu-0.7.0/bsd/i386/s_lrint.S
+ */
+
+#include <machine/asm.h>
-+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $");
++RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $");
+
+ENTRY(lrint)
+ fldl 4(%esp)
@@ -2302,7 +2302,7 @@ diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrintf.S qemu-0.7.0/bsd/i386/s_lrintf.S
+ */
+
+#include <machine/asm.h>
-+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $")
++RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $")
+
+ENTRY(lrintf)
+ flds 4(%esp)
@@ -2401,7 +2401,7 @@ diff -Nru qemu-0.7.0/bsd.orig/i386/s_round.c qemu-0.7.0/bsd/i386/s_round.c
+ */
+
+#include <sys/cdefs.h>
-+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.2 2006-04-16 02:38:02 nork Exp $");
++__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $");
+
+#include <math.h>
+
diff --git a/emulators/qemu-devel/files/patch-vl.c-ppbus b/emulators/qemu-devel/files/patch-vl.c-ppbus
new file mode 100644
index 000000000000..fc06147d8f5a
--- /dev/null
+++ b/emulators/qemu-devel/files/patch-vl.c-ppbus
@@ -0,0 +1,92 @@
+--- vl.c.orig Mon Aug 21 23:06:11 2006
++++ vl.c Mon Aug 21 23:04:49 2006
+@@ -48,6 +48,8 @@
+ #endif
+ #ifdef __FreeBSD__
+ #include <sys/module.h>
++#include <dev/ppbus/ppi.h>
++#include <dev/ppbus/ppbconf.h>
+ #endif
+ #else
+ #ifndef __sun__
+@@ -1728,7 +1730,65 @@
+ chr->chr_ioctl = pp_ioctl;
+ return chr;
+ }
+-#endif /* defined(__linux__) */
++#elif defined(__FreeBSD__)
++static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
++{
++ int fd = (int)chr->opaque;
++ uint8_t b;
++
++ switch(cmd) {
++ case CHR_IOCTL_PP_READ_DATA:
++ if (ioctl(fd, PPIGDATA, &b) < 0)
++ return -ENOTSUP;
++ *(uint8_t *)arg = b;
++ break;
++ case CHR_IOCTL_PP_WRITE_DATA:
++ b = *(uint8_t *)arg;
++ if (ioctl(fd, PPISDATA, &b) < 0)
++ return -ENOTSUP;
++ break;
++ case CHR_IOCTL_PP_READ_CONTROL:
++ if (ioctl(fd, PPIGCTRL, &b) < 0)
++ return -ENOTSUP;
++ *(uint8_t *)arg = b;
++ break;
++ case CHR_IOCTL_PP_WRITE_CONTROL:
++ b = *(uint8_t *)arg;
++ if (ioctl(fd, PPISCTRL, &b) < 0)
++ return -ENOTSUP;
++ break;
++ case CHR_IOCTL_PP_READ_STATUS:
++ if (ioctl(fd, PPIGSTATUS, &b) < 0)
++ return -ENOTSUP;
++ *(uint8_t *)arg = b;
++ break;
++ default:
++ return -ENOTSUP;
++ }
++ return 0;
++}
++
++CharDriverState *qemu_chr_open_pp(const char *filename)
++{
++ CharDriverState *chr;
++ int fd;
++
++ fd = open(filename, O_RDWR);
++ if (fd < 0)
++ return NULL;
++
++ chr = qemu_mallocz(sizeof(CharDriverState));
++ if (!chr) {
++ close(fd);
++ return NULL;
++ }
++ chr->opaque = (void *)fd;
++ chr->chr_write = null_chr_write;
++ chr->chr_add_read_handler = null_chr_add_read_handler;
++ chr->chr_ioctl = pp_ioctl;
++ return chr;
++}
++#endif
+
+ #else
+ CharDriverState *qemu_chr_open_pty(void)
+@@ -2562,6 +2622,13 @@
+ #endif
+ #if defined(__linux__)
+ if (strstart(filename, "/dev/parport", NULL)) {
++ return qemu_chr_open_pp(filename);
++ } else
++ if (strstart(filename, "/dev/", NULL)) {
++ return qemu_chr_open_tty(filename);
++ } else
++#elif defined(__FreeBSD__)
++ if (strstart(filename, "/dev/ppi", NULL)) {
+ return qemu_chr_open_pp(filename);
+ } else
+ if (strstart(filename, "/dev/", NULL)) {