$NetBSD: patch-ak,v 1.1 1999/11/22 11:11:33 agc Exp $

--- lib/makefile.src	Wed Mar  4 16:32:53 1992
+++ lib/makefile.src	Sat Sep 16 10:44:35 1995
@@ -26,7 +26,10 @@
 	vaxshort.o \
 	$(OPT_OBJS)
 
-LIBNAME = librle.a
+SOOBJS = $(OBJS:.o=.so)
+
+LIBANAME = librle.a
+LIBSONAME = librle.so.1.0
 
 # Just rebuild the object files.
 objs: $(OBJS)
@@ -37,23 +40,13 @@
 # Do nothing if $(DEST) is empty (or not defined)
 install: buildlib
 	@sh -c "if test '$(DEST)x' != x ; then \
-		echo cp $(LIBNAME) $(DEST)/$(LIBNAME) ; \
-		cp $(LIBNAME) $(DEST)/$(LIBNAME) ; \
+		echo cp $(LIBANAME) $(DEST)/$(LIBANAME) ; \
+		cp $(LIBANAME) $(DEST)/$(LIBANAME) ; \
+		echo cp $(LIBSONAME) $(DEST)/$(LIBSONAME) ; \
+		cp $(LIBSONAME) $(DEST)/$(LIBSONAME) ; \
 		if test x$(RANLIB) != x ; then \
-			echo ranlib $(DEST)/$(LIBNAME) ; \
-			ranlib $(DEST)/$(LIBNAME) ; \
-		else \
-			true ; \
-		fi ; \
-		if test -d $(DEST)/debug ; then \
-			echo cp $(LIBNAME) $(DEST)/debug/$(LIBNAME) ; \
-			if test x$(RANLIB) != x ; then \
-				cp $(LIBNAME) $(DEST)/debug/$(LIBNAME) ; \
-				echo ranlib $(DEST)/debug/$(LIBNAME) ; \
-			else \
-				true ; \
-			fi ; \
-			ranlib $(DEST)/debug/$(LIBNAME) ; \
+			echo ranlib $(DEST)/$(LIBANAME) ; \
+			ranlib $(DEST)/$(LIBANAME) ; \
 		else \
 			true ; \
 		fi ; \
@@ -63,14 +56,24 @@
 	touch install
 
 # Rebuild the library from all the .o files.
-buildlib: $(OBJS)
-	-rm -f $(LIBNAME)
-	ar rc $(LIBNAME)
-	ar q $(LIBNAME) $(OBJS)
+buildlib: $(LIBANAME) $(LIBSONAME)
+
+$(LIBANAME): $(OBJS)
+	-rm -f $@
+	ar rc $@ $?
 #ifndef NO_RANLIB
-	ranlib $(LIBNAME)
+	ranlib $@
 #endif
-	touch buildlib
+
+.SUFFIXES: .so .o
+
+.c.so:
+	$(CC) -fPIC -DPIC $(CFLAGS) -c $*.c -o $*.so
+	$(LD) -X -r $*.so
+
+$(LIBSONAME): $(SOOBJS)
+	-rm -f $@
+	ld -Bshareable -o $@ $>
 
 # Clean up installed stuff and binaries
 pristine: clean
@@ -86,9 +89,12 @@
 # Get rid of everything which must be recompiled on a different computer.
 clean:
 	-rm -f *.o
+	-rm -f *.so
 	-@if test x$(DEST) != x ; then \
-		echo rm -f $(LIBNAME) ; \
-		rm -f $(LIBNAME) ; \
+		echo rm -f $(LIBANAME) ; \
+		rm -f $(LIBANAME) ; \
+		echo rm -f $(LIBSONAME) ; \
+		rm -f $(LIBSONAME) ; \
 	else \
 		true ; \
 	fi
