--- unix/Makefile.in.orig	2003-06-03 14:44:59.000000000 -0500
+++ unix/Makefile.in	2012-11-05 15:34:16.000000000 -0600
@@ -43,7 +43,7 @@
 TKI_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/lib/tkined$(TKI_VERSION)
 
 # Top-level directory for manual entries:
-MAN_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/man
+MAN_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/share/man
 
 # Directory in which to install the manual entries:
 MAN1_INSTALL_DIR =	$(MAN_INSTALL_DIR)/man1
@@ -56,7 +56,7 @@
 
 # To change the compiler switches, for example to change from -O
 # to -g, change the following line:
-CFLAGS = -O # -DINET6
+CFLAGS = @CFLAGS@
 
 # NMICMPD should contain the full path to the installed nmicmpd binary.
 NMICMPD = $(BIN_INSTALL_DIR)/nmicmpd
@@ -122,7 +122,7 @@
 # Linker switch(es) to link platform depended library archives (the
 # configure script will try to set this value automatically, but you
 # can override it).
-LIBS = @LIBS@ # -lresolv
+LIBS = @LIBS@ -lresolv
 
 # Linker switch(s) to link platform depended library archives for
 # package utilities (the configure script will try to set this value
@@ -175,7 +175,7 @@
 
 # Base command to use for combining object files into a shared
 # library:
-SHLIB_LD = @SHLIB_LD@
+SHLIB_LD = ${CC} -dynamiclib ${CFLAGS} ${LDFLAGS} ${TCL_LIB_SPEC} ${TK_LIB_SPEC} -Wl,-single_module
 
 # Suffix to use for the name of the shared library.  An empty string
 # means we don't know how to use shared libraries on this platform.
@@ -485,7 +485,7 @@
 	$(LD) $(LD_FLAGS) $(LD_SEARCH_FLAGS) -o scotty scotty.o $(TCL_LIB_SPEC) $(LIBS) $(DL_LIBS) -lm
 
 tnm$(SHLIB_SUFFIX): $(TNM_OBJS)
-	$(SHLIB_LD) $(TNM_OBJS) -o tnm$(SHLIB_SUFFIX) $(LIBS)
+	$(SHLIB_LD) $(TNM_OBJS) -o tnm$(SHLIB_SUFFIX) $(LIBS) $(X11_LIBS)
 
 tkined: tkined$(SHLIB_SUFFIX) $(UNIX_DIR)/tkined.in
 	@sed -e 's+%WISH%+$(TK_WISH)+' \
@@ -495,7 +495,7 @@
 	    $(UNIX_DIR)/tkined.in > tkined
 
 tkined$(SHLIB_SUFFIX): $(TKI_GENERIC_OBJS)
-	$(SHLIB_LD) $(TKI_GENERIC_OBJS) -o tkined$(SHLIB_SUFFIX) $(LIBS)
+	$(SHLIB_LD) $(TKI_GENERIC_OBJS) -o tkined$(SHLIB_SUFFIX) $(LIBS) $(X11_LIBS)
 
 test:
 	@echo
