diff --git a/configure.in b/configure.in index 107bb293b..add6653e9 100644 --- a/configure.in +++ b/configure.in @@ -69,6 +69,7 @@ dnl -- Checks for programs. AC_PROG_SED AC_PROG_AWK AC_PROG_CC +AC_PROG_CXX dnl probably no longer needed in 2008, but... AC_PROG_GCC_TRADITIONAL diff --git a/make.tmpl.in b/make.tmpl.in index 7efe46b9c..2a2107fd5 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -106,6 +106,7 @@ DEFAULT_MANGLING = @MANGLING@ # Setup vpath search paths for some suffixes vpath %.c $(srcdir) +vpath %.cpp $(srcdir) vpath %.in $(srcdir) vpath %.po $(srcdir) vpath %.exported_symbols $(srcdir) @@ -136,7 +137,7 @@ INSTALL_ROOT_DIR = $(INSTALL) -m 700 -d INSTALL_ROOT_DATA = $(INSTALL) -m 600 INSTALL_SCRIPT = $(INSTALL) -p $(M_INSTALL_PROGRAM) -.SUFFIXES: .c .d .o .so .a .po .pot .mo .dylib +.SUFFIXES: .c .cpp .d .o .so .a .po .pot .mo .dylib WFLAGS += -Wall -Wundef -Wshadow -Wcast-align -Wwrite-strings \ -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \ @@ -239,7 +240,7 @@ INC_LNS = $(top_builddir)/include/.symlinks_created DEPS = $(top_builddir)/make.tmpl $(top_srcdir)/VERSION \ $(top_builddir)/Makefile $(INC_LNS) -OBJECTS = $(SOURCES:%.c=%.o) +OBJECTS = $(SOURCES:%.c=%.o) $(CXXSOURCES:%.cpp=%.o) POTFILES = $(SOURCES:%.c=%.pot) .PHONY: all pofile distclean clean cleandir cflow device-mapper @@ -366,6 +367,9 @@ $(TARGETS): $(OBJECTS) %.o: %.c $(CC) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CFLAGS) $(CFLAGS_$@) $< -o $@ +%.o: %.cpp + $(CXX) -c $(INCLUDES) $(DEFS) $(WFLAGS) $(CXXFLAGS) $(CXXFLAGS_$@) $< -o $@ + %.pot: %.c Makefile $(CC) -E $(INCLUDES) -include $(top_builddir)/include/pogen.h \ $(DEFS) $(WFLAGS) $(CFLAGS) $< > $@ @@ -454,7 +458,7 @@ distclean: cleandir $(SUBDIRS.distclean) ifeq (,$(findstring $(MAKECMDGOALS),cscope.out cflow clean distclean lcov \ help check check_local check_cluster check_lvmetad)) ifdef SOURCES - -include $(SOURCES:.c=.d) + -include $(SOURCES:.c=.d) $(CXXSOURCES:.cpp=.d) endif ifdef SOURCES2 -include $(SOURCES2:.c=.d)