From 2cb203c1e99441172052f63afedd501ee2cedb65 Mon Sep 17 00:00:00 2001 From: Michael Grunder Date: Thu, 23 Apr 2020 14:15:59 -0700 Subject: [PATCH] Attempt to fix compilation on Solaris (#796) See #757 --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c11c9a9..40e59d2 100644 --- a/Makefile +++ b/Makefile @@ -80,8 +80,14 @@ else endif ifeq ($(uname_S),SunOS) + IS_SUN_CC=$(shell sh -c '$(CC) -V 2>&1 |egrep -i -c "sun|studio"') + ifeq ($(IS_SUN_CC),1) + SUN_SHARED_FLAG=-G + else + SUN_SHARED_FLAG=-shared + endif REAL_LDFLAGS+= -ldl -lnsl -lsocket - DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS) + DYLIB_MAKE_CMD=$(CC) $(SUN_SHARED_FLAG) -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS) endif ifeq ($(uname_S),Darwin) DYLIBSUFFIX=dylib