aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in10
-rw-r--r--src/Makefile.shlib1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 15c14951e86..1ac18e45936 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -249,9 +249,11 @@ endif # not PGXS
CC = @CC@
GCC = @GCC@
SUN_STUDIO_CC = @SUN_STUDIO_CC@
+CXX = @CXX@
CFLAGS = @CFLAGS@
CFLAGS_VECTOR = @CFLAGS_VECTOR@
CFLAGS_SSE42 = @CFLAGS_SSE42@
+CXXFLAGS = @CXXFLAGS@
# Kind-of compilers
@@ -813,6 +815,10 @@ ifndef COMPILE.c
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
endif
+ifndef COMPILE.cc
+COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
+endif
+
DEPDIR = .deps
ifeq ($(GCC), yes)
@@ -822,6 +828,10 @@ ifeq ($(GCC), yes)
@if test ! -d $(DEPDIR); then mkdir -p $(DEPDIR); fi
$(COMPILE.c) -o $@ $< -MMD -MP -MF $(DEPDIR)/$(*F).Po
+%.o : %.cpp
+ @if test ! -d $(DEPDIR); then mkdir -p $(DEPDIR); fi
+ $(COMPILE.cc) -o $@ $< -MMD -MP -MF $(DEPDIR)/$(*F).Po
+
endif # GCC
# Include all the dependency files generated for the current
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index 0ce6d2a145d..0839f37e0f5 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -100,6 +100,7 @@ endif
# Try to keep the sections in some kind of order, folks...
override CFLAGS += $(CFLAGS_SL)
+override CXXFLAGS += $(CFLAGS_SL)
ifdef SO_MAJOR_VERSION
# libraries ought to use this to refer to versioned gettext domain names
override CPPFLAGS += -DSO_MAJOR_VERSION=$(SO_MAJOR_VERSION)