Only use static libgcc/libstdc++ if they're present

This commit is contained in:
Keith Bowes 2021-02-07 15:08:01 -05:00 committed by Stephen Anthony
parent 87bbf20c11
commit 7199ab7feb
1 changed files with 2 additions and 1 deletions

View File

@ -54,10 +54,11 @@ ifneq ($(GIT_VERSION)," unknown")
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif endif
GET_STATIC_ARG=$(if $(filter $(shell $(CXX) -print-file-name=$1.a),$1.a),,-static-$1)
# Unix # Unix
ifneq (,$(findstring unix,$(platform))) ifneq (,$(findstring unix,$(platform)))
CXXFLAGS += $(LTO) CXXFLAGS += $(LTO)
LDFLAGS += $(LTO) $(PTHREAD_FLAGS) -static-libgcc -static-libstdc++ LDFLAGS += $(LTO) $(PTHREAD_FLAGS) $(call GET_STATIC_ARG,libgcc) $(call GET_STATIC_ARG,libstdc++)
TARGET := $(TARGET_NAME)_libretro.so TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC fpic := -fPIC
ifneq ($(findstring SunOS,$(shell uname -a)),) ifneq ($(findstring SunOS,$(shell uname -a)),)