qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: qemu-devel@nongnu.org
Cc: blauwirbel@gmail.com, geleman@gmail.com, Stefan Weil <sw@weilnetz.de>
Subject: [Qemu-devel] [PATCH] w32: Build windows and console executables
Date: Thu, 22 Dec 2011 09:03:53 +0100	[thread overview]
Message-ID: <1324541033-29004-1-git-send-email-sw@weilnetz.de> (raw)
In-Reply-To: <CAETRQWmKDepzK8e62EJ6-zyVa4uSBBCVXXndpGR=Uf4V=0bAEw@mail.gmail.com>

System emulation executables with SDL are typically windows
executables. Sometimes console executables are more useful,
so create both variants if linker option -mwindows was detected.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 Makefile.target |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/Makefile.target b/Makefile.target
index 3261383..489a80c 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -27,10 +27,19 @@ ifdef CONFIG_USER_ONLY
 QEMU_PROG=qemu-$(TARGET_ARCH2)
 else
 # system emulator name
+ifneq (,$(findstring -mwindows,$(LIBS)))
+# Terminate program name with a 'w' because the linker builds a windows executable.
+QEMU_PROG=qemu-system-$(TARGET_ARCH2)w$(EXESUF)
+QEMU_PROGC=qemu-system-$(TARGET_ARCH2)$(EXESUF)
+else # windows executable
 QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
+endif # windows executable
 endif
 
 PROGS=$(QEMU_PROG)
+ifdef QEMU_PROGC
+PROGS+=$(QEMU_PROGC)
+endif
 STPFILES=
 
 ifndef CONFIG_HAIKU
@@ -406,6 +415,11 @@ obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
 $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
 	$(call LINK,$^)
 
+ifdef QEMU_PROGC
+# The linker built a windows executable. Make also a console executable.
+$(QEMU_PROGC): $(QEMU_PROG)
+	$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROG) $(QEMU_PROGC),"  GEN   $(QEMU_PROGC)")
+endif
 
 gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
 	$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
-- 
1.7.0.4

  reply	other threads:[~2011-12-22  8:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-03 21:32 [Qemu-devel] [PATCH] w32: QEMU applications with SDL are always GUI applications Stefan Weil
2011-12-11 16:50 ` Blue Swirl
2011-12-16  3:24 ` TeLeMan
2011-12-16 23:12   ` Stefan Weil
2011-12-19  2:12     ` TeLeMan
2011-12-19  8:15       ` Stefan Weil
2011-12-19  9:31         ` TeLeMan
2011-12-19 10:17         ` Andreas Färber
2011-12-22  1:50         ` TeLeMan
2011-12-22  6:45           ` Stefan Weil
2011-12-22  7:26             ` TeLeMan
2011-12-22  8:03               ` Stefan Weil [this message]
2011-12-22  9:22                 ` [Qemu-devel] [PATCH] w32: Build windows and console executables TeLeMan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324541033-29004-1-git-send-email-sw@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=blauwirbel@gmail.com \
    --cc=geleman@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).