From 7735afa212034346f31baa6aee5466de74309541 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 23 Dec 2005 01:55:26 +0000 Subject: * Makeconfig: Define CXXFLAGS. Split out warnings from +gccwarn which are not understood by the C++ compiler. * Makerules: Add rules to build C++ code for test cases. * include/stdlib.h: Protect for inclusion in C++ code. * include/time.h: Likewise. * test-skeleton.c (timeout_handler): Rewrite ts initialization for C++ compatibility. --- Makerules | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Makerules') diff --git a/Makerules b/Makerules index 6f50950867..31939838d3 100644 --- a/Makerules +++ b/Makerules @@ -306,6 +306,12 @@ endef object-suffixes-left := $(all-object-suffixes) include $(o-iterator) +define o-iterator-doit +$(objpfx)%$o: %.cc $(before-compile); $$(compile-command.cc) +endef +object-suffixes-left := $(all-object-suffixes) +include $(o-iterator) + # Omit the objpfx rules when building in the source tree, because # objpfx is empty and so these rules just override the ones above. ifdef objpfx @@ -381,9 +387,11 @@ compile-mkdep-flags = -MD -MP -MF $@.dt -MT $@ compile-command.S = $(compile.S) $(OUTPUT_OPTION) $(compile-mkdep-flags) compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags) compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags) +compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags) # GCC can grok options after the file name, and it looks nicer that way. compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS) +compile.cc = $(CXX) $< -c $(CXXFLAGS) $(CPPFLAGS) compile.S = $(CC) $< -c $(CPPFLAGS) $(S-CPPFLAGS) \ $(ASFLAGS) $(ASFLAGS-$(suffix $@)) COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \ @@ -1180,9 +1188,9 @@ xcheck: xtests all-nonlib = $(strip $(tests) $(xtests) $(test-srcs) $(test-extras) $(others)) ifneq (,$(all-nonlib)) -cpp-srcs-left = $(all-nonlib:=.c) +cpp-srcs-left = $(all-nonlib:=.c) $(all-nonlib:=.cc) lib := nonlib -include $(patsubst %,$(..)cppflags-iterator.mk,$(all-nonlib)) +include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left)) endif # The include magic above causes those files to use this variable for flags. -- cgit v1.2.3