summary refs log tree commit diff
path: root/Makerules
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-12-23 01:55:26 +0000
committerUlrich Drepper <drepper@redhat.com>2005-12-23 01:55:26 +0000
commit7735afa212034346f31baa6aee5466de74309541 (patch)
treeeaabd29135191d9edf4f6c2f5fcd75e2a57e69a9 /Makerules
parent331926097f7dd22ef585d75c16bc5d992b991ee4 (diff)
downloadglibc-7735afa212034346f31baa6aee5466de74309541.tar.gz
glibc-7735afa212034346f31baa6aee5466de74309541.tar.xz
glibc-7735afa212034346f31baa6aee5466de74309541.zip
* 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.
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules12
1 files changed, 10 insertions, 2 deletions
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.