defs-cpp.mk: Some improvements for LIBTYPE=static

Still doesn't compile valdi statically against regular glibc

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-03-12 12:47:49 +00:00
commit 3b75db2867

View file

@ -100,7 +100,12 @@ ifneq ($(TARGET_TRIPLET),$(HOST_TRIPLET)) # we're cross-compiling
else # we're not cross-compiling
TC_SYS_ROOT ?= /usr
LIBFLAGS += -ldl -lpthread
ifeq ($(LIBTYPE),shared)
LIBFLAGS += -ldl
else
LIBFLAGS += -l:libdl.a
endif
LIBFLAGS += -pthread
endif
@ -257,12 +262,6 @@ ifeq ($(TARGET),mingw)
BUILD_LDFLAGS += -fstack-protector
endif
ifeq ($(LIBTYPE),shared)
ifneq ($(TARGET),mingw)
BUILD_LDFLAGS += -rdynamic
endif
endif
# TODO: this shoud be only conditional, but breaks, because not all headers
# do a conditional include of timer headers, yet
GENERATE_FUNC_TIMERS = $(MODDIR)/YStopWatchThreadList/generate_func_timers.sh
@ -451,7 +450,9 @@ endif
ifeq ($(USE_EXCEPTIONS_IN_C),true)
BUILD_CFLAGS += -fexceptions
GCC_LDFLAGS += -shared-libgcc
ifeq ($(LIBTYPE),shared)
GCC_LDFLAGS += -shared-libgcc
endif
endif
ifeq ($(STRIP_SYMBOLS),true)
@ -533,9 +534,18 @@ ifeq ($(TARGET),mingw)
endif
endif
LIBTYPE ?= shared
INSTALL_LIBDIR ?= $(EXE_PREFIX)/lib
LIBTYPE ?= shared
ifeq ($(LIBTYPE),shared)
ifneq ($(TARGET),mingw)
BUILD_LDFLAGS += -rdynamic
endif
else
LIB_SO ?=
BUILD_LDFLAGS += -static
endif
ifeq ($(USE_PROJECT_LIB),true)
LIBNAME ?= $(PROJECT)
MEMBERS += $(LIB_A)($(OBJ))