--- a/src/lib/Makefile
+++ b/src/lib/Makefile
@@ -2,21 +2,25 @@
 depth = ..
 include $(depth)/mk/sysconf
 
-LIBS = librcl.a
+LIBRECOLL=librecoll.so.$(RCLLIBVERSION)
+LIBS = librecoll.a $(LIBRECOLL)
 
 all: $(LIBS) 
 
 OBJS =  rclaspell.o beaglequeuecache.o cstr.o rclconfig.o rclinit.o textsplit.o unacpp.o beaglequeue.o bglfetcher.o fetcher.o fsfetcher.o fsindexer.o indexer.o mimetype.o subtreelist.o htmlparse.o internfile.o mh_exec.o mh_execm.o mh_html.o mh_mail.o mh_mbox.o mh_text.o mimehandler.o myhtmlparse.o txtdcode.o docseq.o docseqdb.o docseqhist.o filtseq.o dynconf.o plaintorich.o recollq.o reslistpager.o sortseq.o wasastringtoquery.o wasatorcl.o daterange.o expansiondbs.o rclabstract.o rcldb.o rcldoc.o rclquery.o searchdata.o searchdataxml.o stemdb.o stoplist.o synfamily.o unac.o base64.o circache.o closefrom.o conftree.o copyfile.o debuglog.o ecrontab.o execmd.o fstreewalk.o idfile.o fileudi.o md5.o mimeparse.o netcon.o pathut.o pxattr.o rclionice.o readfile.o smallut.o transcode.o wipedir.o x11mon.o mime-parsefull.o mime-parseonlyheader.o mime-printbody.o mime.o convert.o iodevice.o iofactory.o
 DEPS =  rclaspell.dep.stamp beaglequeuecache.dep.stamp cstr.dep.stamp rclconfig.dep.stamp rclinit.dep.stamp textsplit.dep.stamp unacpp.dep.stamp beaglequeue.dep.stamp bglfetcher.dep.stamp fetcher.dep.stamp fsfetcher.dep.stamp fsindexer.dep.stamp indexer.dep.stamp mimetype.dep.stamp subtreelist.dep.stamp htmlparse.dep.stamp internfile.dep.stamp mh_exec.dep.stamp mh_execm.dep.stamp mh_html.dep.stamp mh_mail.dep.stamp mh_mbox.dep.stamp mh_text.dep.stamp mimehandler.dep.stamp myhtmlparse.dep.stamp txtdcode.dep.stamp docseq.dep.stamp docseqdb.dep.stamp docseqhist.dep.stamp filtseq.dep.stamp dynconf.dep.stamp plaintorich.dep.stamp recollq.dep.stamp reslistpager.dep.stamp sortseq.dep.stamp wasastringtoquery.dep.stamp wasatorcl.dep.stamp daterange.dep.stamp expansiondbs.dep.stamp rclabstract.dep.stamp rcldb.dep.stamp rcldoc.dep.stamp rclquery.dep.stamp searchdata.dep.stamp searchdataxml.dep.stamp stemdb.dep.stamp stoplist.dep.stamp synfamily.dep.stamp unac.dep.stamp base64.dep.stamp circache.dep.stamp closefrom.dep.stamp conftree.dep.stamp copyfile.dep.stamp debuglog.dep.stamp ecrontab.dep.stamp execmd.dep.stamp fstreewalk.dep.stamp idfile.dep.stamp fileudi.dep.stamp md5.dep.stamp mimeparse.dep.stamp netcon.dep.stamp pathut.dep.stamp pxattr.dep.stamp rclionice.dep.stamp readfile.dep.stamp smallut.dep.stamp transcode.dep.stamp wipedir.dep.stamp x11mon.dep.stamp mime-parsefull.dep.stamp mime-parseonlyheader.dep.stamp mime-printbody.dep.stamp mime.dep.stamp convert.dep.stamp iodevice.dep.stamp iofactory.dep.stamp
 
-librcl.a : $(DEPS) $(OBJS)
-	ar ru librcl.a $(OBJS)
-	$(RANLIB) librcl.a
-
-# Future 
-#all: librecoll.so
-#librecoll.so : $(DEPS) $(OBJS)
-#	g++ -shared -Wl,--no-undefined #          -Wl,-soname=librecoll.so.1 -o librecoll.so $(OBJS) #           -lxapian -lz -lX11 -lpthread -ldl
+librecoll.a : $(DEPS) $(OBJS)
+	ar ru librecoll.a $(OBJS)
+	$(RANLIB) librecoll.a
+
+# Note that we are using the Recoll release number in the soname. There is
+# no effort whatsoever to maintain any kind of ABI compat in this lib. Only
+# programs or modules from the same Recoll release can be compatible.
+$(LIBRECOLL): $(DEPS) $(OBJS)
+	g++ -shared -Wl,--no-undefined -Wl,-rpath=$(libdir)           -Wl,-soname=$(LIBRECOLL) -o $(LIBRECOLL) $(OBJS)            -lxapian -lz -lX11 -lpthread -ldl
+	rm -f librecoll.so
+	ln -s $(LIBRECOLL) librecoll.so
 
 rclaspell.o : ../aspell/rclaspell.cpp $(depth)/mk/localdefs
 	$(CXX) $(ALL_CXXFLAGS) -c ../aspell/rclaspell.cpp