diff -Nur OpenPBS_2_3_16/buildutils/mkincludes/head.mk.in OpenPBS_2_3_16-patched/buildutils/mkincludes/head.mk.in
--- OpenPBS_2_3_16/buildutils/mkincludes/head.mk.in	Wed Mar 31 18:47:57 1999
+++ OpenPBS_2_3_16-patched/buildutils/mkincludes/head.mk.in	Wed Feb 13 12:46:26 2002
@@ -16,12 +16,14 @@
 
 prefix =       @prefix@
 exec_prefix =  @exec_prefix@
-bindir =       @bindir@
-sbindir =      @sbindir@
-datadir =      @datadir@
-includedir =   @includedir@
-libdir =       @libdir@
-mandir =       @mandir@
+bindir =       ${DESTDIR}@bindir@
+realbindir =   @bindir@
+sbindir =      ${DESTDIR}@sbindir@
+datadir =      ${DESTDIR}@datadir@
+includedir =   ${DESTDIR}@includedir@
+libdir =       ${DESTDIR}@libdir@
+reallibdir =   @libdir@
+mandir =       ${DESTDIR}@mandir@
 
 pbs_os_version =  @pbs_os_version@
 pbs_os_type =     @pbs_os_type@
@@ -60,7 +62,7 @@
 DEMUX_PATH	= $(sbindir)/pbs_demux
 
 # Absolute path of file holding default server name (for clients)
-PBS_DEFAULT_FILE = @PBS_DEFAULT_FILE@
+PBS_DEFAULT_FILE = ${DESTDIR}@PBS_DEFAULT_FILE@
 
 # Name of the default server, typically this is the same as the host name.
 # The name is written into PBS_DEFAULT_FILE for the clients.
@@ -68,7 +70,7 @@
 
 # Home working directory for the PBS Server (where it keeps it queues/jobs)
 # when it is running
-PBS_SERVER_HOME	= @PBS_SERVER_HOME@
+PBS_SERVER_HOME	= ${DESTDIR}@PBS_SERVER_HOME@
 
 
 # A section of machine dependent defines.
diff -Nur OpenPBS_2_3_16/buildutils/pbs_mkdirs.in OpenPBS_2_3_16-patched/buildutils/pbs_mkdirs.in
--- OpenPBS_2_3_16/buildutils/pbs_mkdirs.in	Wed Dec  5 00:37:34 2001
+++ OpenPBS_2_3_16-patched/buildutils/pbs_mkdirs.in	Wed Feb 13 12:46:26 2002
@@ -106,21 +106,21 @@
 #
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-CHK_TREE=@bindir@/chk_tree
+CHK_TREE=${DESTDIR}@bindir@/chk_tree
 
-PBS_SERVER_HOME=@PBS_SERVER_HOME@
-PBS_DEFAULT_FILE=@PBS_DEFAULT_FILE@
+PBS_SERVER_HOME=${DESTDIR}@PBS_SERVER_HOME@
+PBS_DEFAULT_FILE=${DESTDIR}@PBS_DEFAULT_FILE@
 PBS_DEFAULT_SERVER=@PBS_DEFAULT_SERVER@
 
-PBS_ENVIRON=@PBS_ENVIRON@
+PBS_ENVIRON=${DESTDIR}@PBS_ENVIRON@
 
 #
 # manual page directories are created by doc/ers/Makefile
 #
-PBS_UBIN=@bindir@
-PBS_SBIN=@sbindir@
-PBS_LIB=@libdir@
-PBS_UINC=@includedir@
+PBS_UBIN=${DESTDIR}@bindir@
+PBS_SBIN=${DESTDIR}@sbindir@
+PBS_LIB=${DESTDIR}@libdir@
+PBS_UINC=${DESTDIR}@includedir@
 
 verbose=""
 
diff -Nur OpenPBS_2_3_16/src/gui/Makefile.in OpenPBS_2_3_16-patched/src/gui/Makefile.in
--- OpenPBS_2_3_16/src/gui/Makefile.in	Wed Dec  5 00:38:00 2001
+++ OpenPBS_2_3_16-patched/src/gui/Makefile.in	Wed Feb 13 12:46:30 2002
@@ -96,6 +96,7 @@
 @mk_tcl@
 
 XPBS_LIB = $(libdir)/xpbs
+REALXPBS_LIB = $(reallibdir)/xpbs
 XPBS_SCRIPTS = $(PBS_SRC)/gui
 
 TARGETS = xpbs xpbsrc buildindex
@@ -156,15 +157,15 @@
 	# install xpbs changing the location of libdir and appdefdir
 	#
 	@echo Install xpbs
-	@sed -e 's,set  *libdir.*$$,set libdir ${XPBS_LIB},' \
-	    -e 's,set  *appdefdir.*$$,set appdefdir ${XPBS_LIB},' \
+	@sed -e 's,set  *libdir.*$$,set libdir ${REALXPBS_LIB},' \
+	    -e 's,set  *appdefdir.*$$,set appdefdir ${REALXPBS_LIB},' \
 	    xpbs > $(bindir)/xpbs
 	@chmod 755 $(bindir)/xpbs 2> /dev/null
 	#
 	$(INSTALL) -m 755 buildindex $(XPBS_LIB)
 	$(INSTALL) -m 644 xpbsrc $(XPBS_LIB)
 	#
-	cd $(XPBS_LIB) && ./buildindex $(XPBS_LIB) && chmod 644 tclIndex
+	touch $(XPBS_LIB)/tclIndex
 
 
 distclean clean::
diff -Nur OpenPBS_2_3_16/src/tools/xpbsmon/Makefile.in OpenPBS_2_3_16-patched/src/tools/xpbsmon/Makefile.in
--- OpenPBS_2_3_16/src/tools/xpbsmon/Makefile.in	Wed Dec  5 00:39:25 2001
+++ OpenPBS_2_3_16-patched/src/tools/xpbsmon/Makefile.in	Wed Feb 13 12:46:26 2002
@@ -96,6 +96,7 @@
 @mk_tcl@
 
 XPBSMON_LIB = $(libdir)/xpbsmon
+REALXPBSMON_LIB = $(reallibdir)/xpbsmon
 XPBSMON_SCRIPTS = $(PBS_SRC)/tools/xpbsmon
 
 TARGETS = xpbsmon xpbsmonrc buildindex
@@ -151,16 +152,16 @@
 	#
 	# install xpbsmon changing the location of pbs_tclsh and libdir
 	#
-	sed -e 's,#\!.*pbs_wish.*$$,#\!$(PBS_UBIN)/pbs_wish -f,' \
-	    -e 's,set  *libdir.*$$,set libdir ${XPBSMON_LIB},' \
-	    -e 's,set  *appdefdir.*$$,set appdefdir ${XPBSMON_LIB},' \
+	sed -e 's,#\!.*pbs_wish.*$$,#\!$(realbindir)/pbs_wish -f,' \
+	    -e 's,set  *libdir.*$$,set libdir ${REALXPBSMON_LIB},' \
+	    -e 's,set  *appdefdir.*$$,set appdefdir ${REALXPBSMON_LIB},' \
 	    xpbsmon > $(bindir)/xpbsmon
 	chmod 755 $(bindir)/xpbsmon 2> /dev/null
 	#
 	$(INSTALL) -m 755 buildindex $(XPBSMON_LIB)
 	$(INSTALL) -m 644 xpbsmonrc $(XPBSMON_LIB)
 	#
-	cd $(XPBSMON_LIB) && ./buildindex $(XPBSMON_LIB) && chmod 644 tclIndex
+	touch $(XPBSMON_LIB)/tclIndex
 
 clean::
 	$(RM) tclIndex; exit 0
