--- Makefile.orig	Mon Aug 21 13:59:52 2000
+++ Makefile	Mon Oct  7 17:50:50 2002
@@ -44,7 +44,7 @@
 #REAL_DAEMON_DIR=/usr/etc
 #
 # SysV.4 Solaris 2.x OSF AIX
-#REAL_DAEMON_DIR=/usr/sbin
+REAL_DAEMON_DIR=/usr/sbin
 #
 # BSD 4.4
 #REAL_DAEMON_DIR=/usr/libexec
@@ -144,7 +144,7 @@
 linux:
 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
 	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
-	NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
+	NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER -DSYS_ERRLIST_DEFINED" all
 
 # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
 hpux hpux8 hpux9 hpux10:
@@ -669,7 +669,7 @@
 # Protection against weird shells or weird make programs.
 
 SHELL	= /bin/sh
-.c.o:;	$(CC) $(CFLAGS) -c $*.c
+.c.o:;	$(LIBTOOL) $(CC) $(CFLAGS) -c $*.c
 
 CFLAGS	= -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
 	$(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
@@ -696,7 +696,7 @@
 	refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
 	scaffold.h tcpdmatch.8 README.NIS
 
-LIB	= libwrap.a
+LIB	= libwrap.la
 
 all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
 
@@ -713,31 +713,29 @@
 cflags: config-check
 
 $(LIB):	$(LIB_OBJ)
-	rm -f $(LIB)
-	$(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
-	-$(RANLIB) $(LIB)
+	${LIBTOOL} --mode=link $(CC) -o $@ $(LIB_OBJ:.o=.lo) -rpath $(PREFIX)/lib -version-info 7:6
 
 tcpd:	tcpd.o $(LIB)
-	$(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
+	$(LIBTOOL) $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
 
 miscd:	miscd.o $(LIB)
-	$(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
+	$(LIBTOOL) $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
 
 safe_finger: safe_finger.o $(LIB)
-	$(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
+	$(LIBTOOL) $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIBS)
 
 TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
 
 tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
-	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
+	$(LIBTOOL) $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
 
 try-from: try-from.o fakelog.o $(LIB)
-	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
+	$(LIBTOOL) $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
 
 TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
 
 tcpdchk: $(TCPDCHK_OBJ) $(LIB)
-	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
+	$(LIBTOOL) $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
 
 shar:	$(KIT)
 	@shar $(KIT)