summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMichael Grunder <michael.grunder@gmail.com>2020-04-23 14:15:59 -0700
committerGitHub <noreply@github.com>2020-04-23 14:15:59 -0700
commit2cb203c1e99441172052f63afedd501ee2cedb65 (patch)
tree5aa3f32af08b7ba5b9f6392793b5da2ae2f406c9 /Makefile
parent7e2ee7c38b42345eeb0aa787824219e622434ae7 (diff)
Attempt to fix compilation on Solaris (#796)
See #757
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
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