--- Makefile.in	2005-08-28 20:09:28.000000000 +0200
+++ Makefile.in	2005-10-19 00:39:21.000000000 +0200
@@ -28,15 +28,15 @@
 libdir = @libdir@
 includedir = @includedir@
 
-LIBS = libconfig.$(AREXT) libconfig.$(SHOBJEXT)
+LIBS = libconfig.$(AREXT) libconfig.$(PKGVERS).$(SHOBJEXT)
 BINS =
 # The following two lines need to be kept syncronised.
 OBJS = libconfig.o conf_space.o conf_section.o conf_apache.o conf_colon.o conf_equal.o conf_xml.o @LIBOBJS@
 SHOBJS = libconfig_shr.o conf_space_shr.o conf_section_shr.o conf_apache_shr.o conf_colon_shr.o conf_equal_shr.o conf_xml_shr.o @SHLIBOBJS@
 
 all: $(LIBS) $(BINS)
-libconfig.$(SHOBJEXT): $(SHOBJS)
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) $(SHOBJLDFLAGS) -o $@ $^ $(LDFLAGS)
+libconfig.$(PKGVERS).$(SHOBJEXT): $(SHOBJS)
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) $(SHOBJLDFLAGS) -o $@ $^ $(LDFLAGS) -install_name $(libdir)/$@ -current_version $(PKGVERS)
 
 libconfig.$(AREXT): $(OBJS)
 	$(AR) rcu $@ $^
@@ -69,7 +69,7 @@
 	-$(INSTALL) -d $(includedir)
 	-$(INSTALL) -m 644 libconfig.$(SHOBJEXT).def $(libdir)/libconfig.$(SHOBJEXT).def
 	-$(INSTALL) -m 644 libconfig.$(SHOBJEXT).a $(libdir)/libconfig.$(SHOBJEXT).a
-	$(INSTALL) -m 755 libconfig.$(SHOBJEXT) $(libdir)/libconfig.$(SHOBJEXT).$(PKGVERS)
+	$(INSTALL) -m 755 libconfig.$(PKGVERS).$(SHOBJEXT) $(libdir)/
 	$(INSTALL) -m 644 libconfig.$(AREXT) $(libdir)/libconfig.$(AREXT)
 	$(INSTALL) -m 644 lc_register_callback.3 $(mandir)/man3/lc_register_callback.3
 	$(INSTALL) -m 644 lc_register_var.3 $(mandir)/man3/lc_register_var.3
@@ -80,5 +80,5 @@
 	$(INSTALL) -m 644 lc_cleanup.3 $(mandir)/man3/lc_cleanup.3
 	$(INSTALL) -m 644 libconfig.3 $(mandir)/man3/libconfig.3
 	$(INSTALL) -m 644 libconfig.h $(includedir)/libconfig.h
-	-( cd $(libdir) && rm -f libconfig.$(SHOBJEXT).$(PKGVERSMAJOR) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT).$(PKGVERSMAJOR) )
-	-( cd $(libdir) && rm -f libconfig.$(SHOBJEXT) && $(LN_S) libconfig.$(SHOBJEXT).$(PKGVERS) libconfig.$(SHOBJEXT) )
+	-( cd $(libdir) && rm -f libconfig.$(SHOBJEXT).$(PKGVERSMAJOR) && $(LN_S) libconfig..$(PKGVERS).$(SHOBJEXT) libconfig.$(PKGVERSMAJOR).$(SHOBJEXT) )
+	-( cd $(libdir) && rm -f libconfig.$(SHOBJEXT) && $(LN_S) libconfig.$(PKGVERS).$(SHOBJEXT) libconfig.$(SHOBJEXT) )
