--- ./Makefile.in.orig	2004-09-23 19:12:52.000000000 +0200
+++ ./Makefile.in	2012-07-20 21:55:23.000000000 +0200
@@ -26,7 +26,7 @@
 #Rules: major  -- inc for incompatible change
 #     : minor  -- inc for bugfix or forward compatible change
 
-LIBVERSION=1.0
+LIBVERSION=1
 
 PATHS= 
 
@@ -35,7 +35,7 @@
 CFLAGS=@CFLAGS@
 CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
 LDFLAGS=@LDFLAGS@
-LIBS=@LIBS@
+LIBS=-L. @LIBS@
 THLDFLAGS=@THLDFLAGS@
 THLIBS=@THLIBS@
 AR=@AR@
@@ -52,8 +52,10 @@
 PERL=@PERL@
 ENT=@ENT@
 EXEEXT=@EXEEXT@
+SHLDSONAME=-Wl,-soname,libspread.so.$(LIBVERSION)
+TSHLDSONAME=-Wl,-soname,libtspread.so.$(LIBVERSION)
 
-TARGETS=spread$(EXEEXT) spuser$(EXEEXT) spflooder$(EXEEXT) spmonitor$(EXEEXT) sptuser${EXEEXT} @LIBSPSO@ @LIBTSPSO@
+TARGETS=spread$(EXEEXT) spuser$(EXEEXT) spflooder$(EXEEXT) spmonitor$(EXEEXT) sptuser${EXEEXT} @LIBSPSO@ @LIBTSPSO@ libspread.a libtspread.a
 
 LIBSP_OBJS= alarm.o events.o memory.o sp.o
 
@@ -127,8 +129,11 @@
 	$(INSTALL) -m 0755 libspread.$(LIBVERSION).dylib $(DESTDIR)$(libdir)/libspread.$(LIBVERSION).dylib
 	(cd $(DESTDIR)$(libdir); $(SOFTLINK) -f libspread.$(LIBVERSION).dylib libspread.dylib)
 
-libspread.so:	$(LIBSP_SHOBJS)
-	$(SHLD) -o $@ $(LIBSP_SHOBJS) $(SHLDFLAGS) $(SHLIBS)
+libspread.so:	$@.$(LIBVERSION)
+	$(SOFTLINK) $@.$(LIBVERSION) $@
+
+libspread.so.$(LIBVERSION):	$(LIBSP_SHOBJS)
+	$(SHLD) -o $@ $(LIBSP_SHOBJS) $(SHLDSONAME) $(SHLDFLAGS) $(SHLIBS)
 
 install-libspread.so:	libspread.so
 	$(INSTALL) -m 0755 libspread.so $(DESTDIR)$(libdir)/libspread.so.$(LIBVERSION)
@@ -146,8 +151,11 @@
 	$(INSTALL) -m 0755 libtspread.$(LIBVERSION).dylib $(DESTDIR)$(libdir)/libtspread.$(LIBVERSION).dylib
 	(cd $(DESTDIR)$(libdir); $(SOFTLINK) -f libtspread.$(LIBVERSION).dylib libtspread.dylib)
 
-libtspread.so:	$(LIBTSP_SHOBJS)
-	$(SHLD) -o $@ $(LIBTSP_SHOBJS) $(SHLDFLAGS) $(SHLIBS) $(THLIBS)
+libtspread.so:	$@.$(LIBVERSION)
+	$(SOFTLINK) $@.$(LIBVERSION) $@
+
+libtspread.so.$(LIBVERSION):	$(LIBTSP_SHOBJS)
+	$(SHLD) -o $@ $(LIBTSP_SHOBJS) $(TSHLDSONAME) $(SHLDFLAGS) $(SHLIBS) $(THLIBS)
 
 install-libtspread.so:	libtspread.so
 	$(INSTALL) -m 0755 libtspread.so $(DESTDIR)$(libdir)/libtspread.so.$(LIBVERSION)
@@ -156,11 +164,11 @@
 spread$(EXEEXT): $(SPREADOBJS)
 	$(LD) -o $@ $(SPREADOBJS) $(LDFLAGS) $(LIBS)
 
-spuser$(EXEEXT): libspread.a	user.o
-	$(LD) -o $@ user.o $(LDFLAGS) libspread.a $(LIBS)
+spuser$(EXEEXT): libspread.a user.o
+	$(LD) -o $@ user.o $(LDFLAGS) -lspread $(LIBS)
 
 spflooder$(EXEEXT): libspread.a flooder.o
-	$(LD) -o $@ flooder.o $(LDFLAGS) libspread.a $(LIBS)
+	$(LD) -o $@ flooder.o $(LDFLAGS) -lspread $(LIBS)
 
 spmonitor$(EXEEXT): $(MONITOR_OBJS)
 	$(LD) -o $@ $(MONITOR_OBJS) $(LDFLAGS) $(LIBS) 
@@ -169,7 +177,7 @@
 	$(LD) $(THLDFLAGS) -o $@ $(TMONITOR_OBJS) $(LDFLAGS) $(LIBS) $(THLIBS) 
 
 sptuser$(EXEEXT): user.to libtspread.a
-	$(LD) $(THLDFLAGS) -o $@ user.to libtspread.a $(LDFLAGS) $(LIBS) $(THLIBS)
+	$(LD) $(THLDFLAGS) -o $@ user.to -lspread $(LDFLAGS) $(LIBS) $(THLIBS)
 
 spsimple_user$(EXEEXT): simple_user.o libspread.a
 	$(LD) -o $@ simple_user.o $(LDFLAGS) libspread.a $(LIBS) 
@@ -198,7 +206,7 @@
 	fi
 
 clean:
-	rm -f *.lo *.tlo *.to *.o *.a *.dylib $(TARGETS) spsimple_user
+	rm -f *.lo *.tlo *.to *.o *.a *.dylib $(TARGETS) spsimple_user *.so.$(LIBVERSION)
 	rm -f config.cache config.log docs/*.out core
 	rm -rf autom4te.cache
 
@@ -255,11 +263,6 @@
 	if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \
 		$(buildtoolsdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \
 	fi
-	if [ ! -f $(DESTDIR)$(sysconfdir)/spread.conf ]; then \
-		$(INSTALL) -m 644 $(srcdir)/sample.spread.conf $(DESTDIR)$(sysconfdir)/spread.conf; \
-	else \
-		echo "$(DESTDIR)$(sysconfdir)/spread.conf already exists, install will not overwrite"; \
-	fi
 
 uninstallall:	uninstall
 	-rm -f $(DESTDIR)$(sysconfdir)/spread.conf
