mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add C++ support to configure.
This is an optional dependency. It'll be used for the upcoming LLVM based just in time compilation support, which needs to wrap a few LLVM C++ APIs so they're accessible from C.. For now test for C++ compilers unconditionally, without failing if not present, to ensure wide buildfarm coverage. If we're bothered by the additional test times (which are quite short) or verbosity, we can later make the tests conditional on --with-llvm. Author: Andres Freund Discussion: https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de
This commit is contained 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
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user