summaryrefslogtreecommitdiff
path: root/rules.mak
diff options
context:
space:
mode:
authorTomoki Sekiyama <tomoki.sekiyama@hds.com>2013-08-07 11:39:36 -0400
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-09-09 14:17:56 -0500
commit83f73fce4cf18cf36e99f0e78e8e87dfb6b12a71 (patch)
tree0f149fecacd012b13e02130bcd9f35def91bf6e2 /rules.mak
parent94c2b6aff43cdfcfdfb552773a6b6b973a72ef0b (diff)
downloadqemu-83f73fce4cf18cf36e99f0e78e8e87dfb6b12a71.tar.gz
qemu-83f73fce4cf18cf36e99f0e78e8e87dfb6b12a71.tar.bz2
qemu-83f73fce4cf18cf36e99f0e78e8e87dfb6b12a71.zip
configure: Support configuring C++ compiler
Add configuration for C++ compiler in configure and Makefiles. The C++ compiler is choosed as following: - ${CXX}, if it is specified. - ${cross_prefix}g++, if ${cross_prefix} is specified. - Otherwise, c++ is used. Currently, usage of C++ language is only for access to Windows VSS using COM+ services in qemu-guest-agent for Windows. Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Micael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'rules.mak')
-rw-r--r--rules.mak9
1 files changed, 8 insertions, 1 deletions
diff --git a/rules.mak b/rules.mak
index 44997458da..abc2e846b3 100644
--- a/rules.mak
+++ b/rules.mak
@@ -8,9 +8,13 @@ MAKEFLAGS += -rR
%.d:
%.h:
%.c:
+%.cpp:
%.m:
%.mak:
+# Flags for C++ compilation
+QEMU_CXXFLAGS = -D__STDC_LIMIT_MACROS $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls, $(QEMU_CFLAGS))
+
# Flags for dependency generation
QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
@@ -50,6 +54,9 @@ endif
%.o: %.asm
$(call quiet-command,$(AS) $(ASFLAGS) -o $@ $<," AS $(TARGET_DIR)$@")
+%.o: %.cpp
+ $(call quiet-command,$(CXX) $(QEMU_INCLUDES) $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CXX $(TARGET_DIR)$@")
+
%.o: %.m
$(call quiet-command,$(OBJCC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
@@ -70,7 +77,7 @@ quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))
cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \
>/dev/null 2>&1 && echo OK), $2, $3)
-VPATH_SUFFIXES = %.c %.h %.S %.m %.mak %.texi %.sh %.rc
+VPATH_SUFFIXES = %.c %.h %.S %.cpp %.m %.mak %.texi %.sh %.rc
set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1)))
# find-in-path