--- Makefile.in.orig	Tue Nov 14 19:32:08 2000
+++ Makefile.in	Mon Dec 18 22:28:07 2000
@@ -19,6 +19,7 @@
 SHELL=/bin/sh
 
 INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 
 INCLUDEDIR = @includedir@
@@ -36,7 +37,7 @@
 
 SHELL = /bin/sh
 
-.SUFFIXES: .C .o
+.SUFFIXES: .c .o .so
 
 WMFLIBOBJECTS =	\
 	wmfapi.o \
@@ -58,42 +59,77 @@
 	Xtext.o \
 	rotated.o
 
-TARGETS = wmftopng wmftofig wmftoeps xwmf
+LIBRARIES = 	\
+	LIBXGD \
+	LIBDIB \
+	LIBXFIG \
+	libwmf.a \
+	libgdwmf.a \
+	libxfwmf.a \
+	libXwmf.a \
+	libepswmf.a \
+	libwmf.so.1 \
+	libgdwmf.so.1 \
+	libxfwmf.so.1 \
+	libXwmf.so.1 \
+	libepswmf.so.1
+
+TARGETS = $(LIBRARIES) wmftopng wmftofig wmftoeps xwmf
 
 all: $(TARGETS)
 
-xwmf: libwmf.a libXwmf.a xwmf.o LIBDIB
+xwmf: libwmf.so.1 libXwmf.so.1 xwmf.o LIBDIB
 	$(CC) $(LDFLAGS) -o xwmf xwmf.o -L. -lXwmf -lwmf $(LIBS)
 
-wmftopng:	libwmf.a libgdwmf.a wmftopng.o LIBXGD LIBDIB
+wmftopng:	libwmf.so.1 libgdwmf.so.1 wmftopng.o LIBXGD LIBDIB
 	$(CC) $(LDFLAGS) -o wmftopng wmftopng.o -L. -lgdwmf -lwmf $(GDLIBS)
 
-wmftofig: libwmf.a libxfwmf.a wmftofig.o LIBXFIG
+wmftofig: libwmf.so.1 libxfwmf.so.1 wmftofig.o LIBXFIG
 	$(CC) $(LDFLAGS) -o wmftofig wmftofig.o -L. -lxfwmf -lwmf $(XFLIBS)
 
-wmftoeps: libwmf.a libepswmf.a wmftoeps.o LIBXFIG
+wmftoeps: libwmf.so.1 libepswmf.so.1 wmftoeps.o LIBXFIG
 	$(CC) $(LDFLAGS) -o wmftoeps wmftoeps.o -L. -lepswmf -lwmf $(EPSLIBS)
 
 libwmf.a:	$(WMFLIBOBJECTS)
 	 $(AR) rc libwmf.a $(WMFLIBOBJECTS) 
 	 $(RANLIB) libwmf.a 
 
+libwmf.so.1:	$(WMFLIBOBJECTS:.o=.so)
+	$(CC) -shared -Wl,-soname,$@ -o $@ $(WMFLIBOBJECTS:.o=.so) $(LIBS)
+	ln -sf libwmf.so.1 libwmf.so
+
 libgdwmf.a:	$(GDLIBOBJECTS)
 	 $(AR) rc libgdwmf.a $(GDLIBOBJECTS) 
 	 $(RANLIB) libgdwmf.a
+ 
+libgdwmf.so.1: $(GDLIBOBJECTS:.o=.so)
+	$(CC) -shared -Wl,-soname,$@ -o $@ $(GDLIBOBJECTS:.o=.so) $(LIBS)
+	ln -sf libgdwmf.so.1 libgdwmf.so
 
 libxfwmf.a:	$(XFLIBOBJECTS)
 	 $(AR) rc libxfwmf.a $(XFLIBOBJECTS) 
 	 $(RANLIB) libxfwmf.a
+ 
+libxfwmf.so.1: $(XFLIBOBJECTS:.o=.so)
+	$(CC) -shared -Wl,-soname,$@ -o $@ $(XFLIBOBJECTS:.o=.so) $(LIBS)
+	ln -sf libxfwmf.so.1 libxfwmf.so
 
 libepswmf.a:	$(EPSLIBOBJECTS)
 	 $(AR) rc libepswmf.a $(EPSLIBOBJECTS) 
 	 $(RANLIB) libepswmf.a
 
+libepswmf.so.1:	$(EPSLIBOBJECTS:.o=.so)
+	$(CC) -shared -Wl,-soname,$@ -o $@ $(EPSLIBOBJECTS:.o=.so) $(LIBS)
+	ln -sf libepswmf.so.1 libepswmf.so
+
 libXwmf.a:	$(XLIBOBJECTS)
 	 $(AR) rc libXwmf.a $(XLIBOBJECTS) 
 	 $(RANLIB) libXwmf.a
 
+libXwmf.so.1:  $(XLIBOBJECTS:.o=.so)
+	$(CC) -shared -Wl,-soname,$@ -o $@ $(XLIBOBJECTS:.o=.so) $(LIBS)
+	ln -sf libXwmf.so.1 libXwmf.so
+
 LIBDIB:
 	@echo making libdib in libdib
 	@(cd libdib && $(MAKE)) || exit 1
@@ -106,8 +142,8 @@
 	@echo making libxfig, libeps in libxfig
 	@(cd libxfig && $(MAKE)) || exit 1
 
-%.o: %.c 
-	$(CC) $(CFLAGS) -c $*.c 
+.c.so:
+	$(CC) $(CFLAGS) -fPIC -DPIC -o $@ -c $<
 
 clean: cleansub
 	rm -rf *.o wmftopng wmftofig wmftoeps xwmf a.out core *.a .pure
@@ -146,17 +182,28 @@
 	$(libdir)
 
 install: all installdirs installsub
-	$(INSTALL) $(srcdir)/xwmf $(bindir)/xwmf
-	$(INSTALL) $(srcdir)/wmftopng $(bindir)/wmftopng
-	$(INSTALL) $(srcdir)/wmftofig $(bindir)/wmftofig
-	$(INSTALL) $(srcdir)/wmftoeps $(bindir)/wmftoeps
+	$(INSTALL_PROGRAM) $(srcdir)/xwmf $(bindir)/xwmf
+	$(INSTALL_PROGRAM) $(srcdir)/wmftopng $(bindir)/wmftopng
+	$(INSTALL_PROGRAM) $(srcdir)/wmftofig $(bindir)/wmftofig
+	$(INSTALL_PROGRAM) $(srcdir)/wmftoeps $(bindir)/wmftoeps
 	$(INSTALL_DATA) $(srcdir)/libwmf.a $(libdir)/libwmf.a
 	$(INSTALL_DATA) $(srcdir)/libgdwmf.a $(libdir)/libgdwmf.a
 	$(INSTALL_DATA) $(srcdir)/libXwmf.a $(libdir)/libXwmf.a
 	$(INSTALL_DATA) $(srcdir)/libxfwmf.a $(libdir)/libxfwmf.a
 	$(INSTALL_DATA) $(srcdir)/libepswmf.a $(libdir)/libepswmf.a
+	$(INSTALL_DATA) $(srcdir)/libwmf.so.1 $(libdir)/libwmf.so.1
+	ln -sf libwmf.so.1 $(libdir)/libwmf.so
+	$(INSTALL_DATA) $(srcdir)/libgdwmf.so.1 $(libdir)/libgdwmf.so.1
+	ln -sf libgdwmf.so.1 $(libdir)/libgdwmf.so
+	$(INSTALL_DATA) $(srcdir)/libXwmf.so.1 $(libdir)/libXwmf.so.1
+	ln -sf libXwmf.so.1 $(libdir)/libXwmf.so
+	$(INSTALL_DATA) $(srcdir)/libxfwmf.so.1 $(libdir)/libxfwmf.so.1
+	ln -sf libxfwmf.so.1 $(libdir)/libxfwmf.so
+	$(INSTALL_DATA) $(srcdir)/libepswmf.so.1 $(libdir)/libepswmf.so.1
+	ln -sf libepswmf.so.1 $(libdir)/libepswmf.so
 	$(INSTALL_DATA) wmfapi.h $(INCLUDEDIR)/wmfapi.h
 	$(INSTALL_DATA) gdwmfapi.h $(INCLUDEDIR)/gdwmfapi.h
 	$(INSTALL_DATA) Xwmfapi.h $(INCLUDEDIR)/Xwmfapi.h
+	$(INSTALL_DATA) xgdttf.h $(INCLUDEDIR)/xgdttf.h
 
 #  DO  NOT  DELETE THIS LINE -- make depend depends on it.
