--- library/Makefile
+++ library/Makefile
@@ -34,6 +34,11 @@
 LDFLAGS += -lws2_32
 endif
 
+VERSION=0.0.0
+LIB_SO=libpolarssl.$(DLEXT)
+LIB_SO_VERSION=$(LIB_SO).$(VERSION)
+LIB_SO_MAJOR=$(LIB_SO).$(firstword $(subst ., ,$(VERSION)))
+
 OBJS=	aes.o		arc4.o		asn1parse.o		\
 		asn1write.o base64.o	bignum.o		\
 		blowfish.o	camellia.o					\
@@ -61,7 +66,7 @@
 
 static: libpolarssl.a
 
-shared: libpolarssl.$(DLEXT)
+shared: $(LIB_SO_VERSION)
 
 libpolarssl.a: $(OBJS)
 	echo "  AR    $@"
@@ -69,9 +74,11 @@
 	echo "  RL    $@"
 	$(AR) s $@
 
-libpolarssl.so: libpolarssl.a
+$(LIB_SO_VERSION): $(OBJS)
 	echo "  LD    $@"
-	$(CC) ${LDFLAGS} -shared -Wl,-soname,$(SONAME) -o $@ $(OBJS)
+	$(CC) ${LDFLAGS} -shared -Wl,-soname,$(LIB_SO_MAJOR) -o $@ $(OBJS) \
+	&& ln -fs $@ $(LIB_SO_MAJOR) \
+	&& ln -fs $(LIB_SO_MAJOR) $(LIB_SO)
 
 libpolarssl.dylib: libpolarssl.a
 	echo "  LD    $@"
