Add support for statically linking stdc++ to libfdbc_c on Centos while using custom hack for Ubuntu
Set compilationn flag to c++17
This commit is contained in:
parent
b0362a654e
commit
2ed1176d6a
13
Makefile
13
Makefile
|
@ -1,14 +1,13 @@
|
||||||
export
|
export
|
||||||
PLATFORM := $(shell uname)
|
PLATFORM := $(shell uname)
|
||||||
ARCH := $(shell uname -m)
|
ARCH := $(shell uname -m)
|
||||||
ifeq ("$(wildcard /etc/centos-release)", "")
|
|
||||||
LIBSTDCPP_HACK = 1
|
|
||||||
else
|
|
||||||
LIBSTDCPP_HACK = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
TOPDIR := $(shell pwd)
|
TOPDIR := $(shell pwd)
|
||||||
|
|
||||||
|
# Allow custom libc++ hack for Ubuntu
|
||||||
|
ifeq ("$(wildcard /etc/centos-release)", "")
|
||||||
|
LIBSTDCPP_HACK ?= 1
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),x86_64)
|
ifeq ($(ARCH),x86_64)
|
||||||
ARCH := x64
|
ARCH := x64
|
||||||
else
|
else
|
||||||
|
@ -43,7 +42,7 @@ ifeq ($(PLATFORM),Linux)
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
|
|
||||||
CXXFLAGS += -std=c++0x
|
CXXFLAGS += -std=c++17
|
||||||
|
|
||||||
BOOST_BASEDIR ?= /opt
|
BOOST_BASEDIR ?= /opt
|
||||||
TLS_LIBDIR ?= /usr/local/lib
|
TLS_LIBDIR ?= /usr/local/lib
|
||||||
|
|
|
@ -31,8 +31,14 @@ CLEAN_TARGETS += fdb_c_tests_clean
|
||||||
|
|
||||||
ifeq ($(PLATFORM),linux)
|
ifeq ($(PLATFORM),linux)
|
||||||
fdb_c_LDFLAGS += -Wl,--version-script=bindings/c/fdb_c.map -static-libgcc -Wl,-z,nodelete -lm -lpthread -lrt -ldl
|
fdb_c_LDFLAGS += -Wl,--version-script=bindings/c/fdb_c.map -static-libgcc -Wl,-z,nodelete -lm -lpthread -lrt -ldl
|
||||||
ifeq ($(LIBSTDCPP_HACK),1)
|
# Link our custom libstdc++ statically in Ubuntu, if hacking
|
||||||
fdb_c_LIBS += lib/libstdc++.a
|
ifeq ("$(wildcard /etc/centos-release)", "")
|
||||||
|
ifeq ($(LIBSTDCPP_HACK),1)
|
||||||
|
fdb_c_LIBS += lib/libstdc++.a
|
||||||
|
endif
|
||||||
|
# Link stdc++ statically in Centos, if not hacking
|
||||||
|
else
|
||||||
|
fdb_c_STATIC_LIBS += -static-libstdc++
|
||||||
endif
|
endif
|
||||||
fdb_c_tests_LIBS += -lpthread
|
fdb_c_tests_LIBS += -lpthread
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -35,7 +35,7 @@ _fdb_flow_tester_clean:
|
||||||
@rm -rf bindings/flow/bin
|
@rm -rf bindings/flow/bin
|
||||||
|
|
||||||
ifeq ($(PLATFORM),linux)
|
ifeq ($(PLATFORM),linux)
|
||||||
fdb_flow_tester_LDFLAGS += -static-libstdc++ -static-libgcc -ldl -lpthread -lrt
|
fdb_flow_tester_LDFLAGS += -static-libstdc++ -static-libgcc -ldl -lpthread -lrt -lm
|
||||||
else ifeq ($(PLATFORM),osx)
|
else ifeq ($(PLATFORM),osx)
|
||||||
fdb_flow_tester_LDFLAGS += -lc++
|
fdb_flow_tester_LDFLAGS += -lc++
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue