--- old/usr/src/cmd/make/bin/Makefile	2015-05-20 11:55:51.469820995 -0400
+++ new/usr/src/cmd/make/bin/Makefile	2015-05-20 11:55:51.481548248 -0400
@@ -14,7 +14,6 @@
 PROG=	make
 OBJS=	ar.o		\
 	depvar.o	\
-	dist.o		\
 	doname.o	\
 	dosys.o		\
 	files.o		\
--- old/usr/src/cmd/make/bin/dist.cc	2015-05-20 11:55:51.904154641 -0400
+++ /dev/null	2015-05-20 11:55:51.000000000 -0400
@@ -1,565 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifdef DISTRIBUTED
-/*
- *      dist.cc
- *
- *      Deal with the distributed processing
- */
-
-#include <avo/err.h>
-#include <avo/find_dir.h>
-#include <avo/util.h>
-#include <dm/Avo_AcknowledgeMsg.h>
-#include <dm/Avo_DoJobMsg.h>
-#include <dm/Avo_JobResultMsg.h>
-#include <mk/defs.h>
-#include <mksh/misc.h>		/* getmem() */
-#include <rw/pstream.h>
-#include <rw/queuecol.h>
-#include <rw/xdrstrea.h>
-#include <signal.h>
-#include <strstream.h>
-#include <sys/stat.h>		/* stat() */
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <errno.h>
-
-/*
- * Defined macros
- */
-
-#define AVO_BLOCK_INTERUPTS sigfillset(&newset) ; \
-        sigprocmask(SIG_SETMASK, &newset, &oldset)
- 
-#define AVO_UNBLOCK_INTERUPTS \
-        sigprocmask(SIG_SETMASK, &oldset, &newset)
-
-
-/*
- * typedefs & structs
- */
-
-/*
- * Static variables
- */
-int		dmake_ifd; 
-FILE*		dmake_ifp; 
-XDR 		xdrs_in;
-
-int		dmake_ofd;
-FILE*		dmake_ofp;
-XDR 		xdrs_out;
-
-// These instances are required for the RWfactory.
-static Avo_JobResultMsg dummyJobResultMsg;
-static Avo_AcknowledgeMsg dummyAcknowledgeMsg;
-static int firstAcknowledgeReceived = 0;
- 
-int		rxmPid = 0;
-
-/*
- * File table of contents
- */
-static void	set_dmake_env_vars(void);
-
-/*
- * void
- * startup_rxm(void)
- *
- * When startup_rxm() is called, read_command_options() and
- * read_files_and_state() have already been read, so DMake
- * will now know what options to pass to rxm.
- *
- * rxm
- *     [ -k ] [ -n ]
- *     [ -c <dmake_rcfile> ]
- *     [ -g <dmake_group> ]
- *     [ -j <dmake_max_jobs> ]
- *     [ -m <dmake_mode> ]
- *     [ -o <dmake_odir> ]
- *     <read_fd> <write_fd>
- *
- * rxm will, among other things, read the rc file.
- *
- */
-void
-startup_rxm(void)
-{
-	Name		dmake_name;
-	Name		dmake_value;
-	Avo_err		*find_run_dir_err;
-	int		pipe1[2], pipe2[2];
-	Property	prop;
-	char		*run_dir;
-	char		rxm_command[MAXPATHLEN];
-	int		rxm_debug = 0;
-
-	int 		length;
-	char *		env;
-
-	firstAcknowledgeReceived = 0;
-	/*
-	 * Create two pipes, one for dmake->rxm, and one for rxm->dmake.
-	 * pipe1 is dmake->rxm,
-	 * pipe2 is rxm->dmake.
-	 */
-	if ((pipe(pipe1) < 0) || (pipe(pipe2) < 0)) {
-		fatal(catgets(catd, 1, 245, "pipe() failed: %s"), errmsg(errno));
-	}
-
-	set_dmake_env_vars();
-
-	if ((rxmPid = fork()) < 0) {	/* error */
-		fatal(catgets(catd, 1, 246, "fork() failed: %s"), errmsg(errno));
-	} else if (rxmPid > 0) {	/* parent, dmake */
-		dmake_ofd = pipe1[1];	// write side of pipe
-		if (!(dmake_ofp = fdopen(dmake_ofd, "a"))) {
-			fatal(catgets(catd, 1, 247, "fdopen() failed: %s"), errmsg(errno));
-		}
-		xdrstdio_create(&xdrs_out, dmake_ofp, XDR_ENCODE);
-
-		dmake_ifd = pipe2[0];	// read side of pipe
-		if (!(dmake_ifp = fdopen(dmake_ifd, "r"))) {
-			fatal(catgets(catd, 1, 248, "fdopen() failed: %s"), errmsg(errno));
-		}
-		xdrstdio_create(&xdrs_in, dmake_ifp, XDR_DECODE);
-
-		close(pipe1[0]);	// read side
-		close(pipe2[1]);	// write side
-	} else {			/* child, rxm */
-		close(pipe1[1]);	// write side
-		close(pipe2[0]);	// read side
-
-		/* Find the run directory of dmake, for rxm. */
-		find_run_dir_err = avo_find_run_dir(&run_dir);
-		if (find_run_dir_err) {
-			delete find_run_dir_err;
-			/* Use the path to find rxm. */
-			(void) sprintf(rxm_command, NOCATGETS("rxm"));
-		} else {
-			/* Use the run dir of dmake for rxm. */
-			(void) sprintf(rxm_command, NOCATGETS("%s/rxm"), run_dir);
-		}
-
-		if (continue_after_error) {
-			(void) strcat(rxm_command, NOCATGETS(" -k"));
-		}
-		if (do_not_exec_rule) {
-			(void) strcat(rxm_command, NOCATGETS(" -n"));
-		}
-		if (rxm_debug) {
-			(void) strcat(rxm_command, NOCATGETS(" -S"));
-		}
-		if (send_mtool_msgs) {
-			(void) sprintf(&rxm_command[strlen(rxm_command)],
-			               NOCATGETS(" -O %d"),
-			               mtool_msgs_fd);
-		}
-		MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_RCFILE"));
-		dmake_name = GETNAME(wcs_buffer, FIND_LENGTH);
-		if (((prop = get_prop(dmake_name->prop, macro_prop)) != NULL) &&
-		    ((dmake_value = prop->body.macro.value) != NULL)) {
-			(void) sprintf(&rxm_command[strlen(rxm_command)],
-			               NOCATGETS(" -c %s"),
-			               dmake_value->string_mb);
-		} else {
-			length = 2 + strlen(NOCATGETS("DMAKE_RCFILE"));
-			env = getmem(length);
-			(void) sprintf(env,
-			               "%s=",
-			               NOCATGETS("DMAKE_RCFILE"));
-			(void) putenv(env);
-		}
-		MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_GROUP"));
-		dmake_name = GETNAME(wcs_buffer, FIND_LENGTH);
-		if (((prop = get_prop(dmake_name->prop, macro_prop)) != NULL) &&
-		    ((dmake_value = prop->body.macro.value) != NULL)) {
-			(void) sprintf(&rxm_command[strlen(rxm_command)],
-			               NOCATGETS(" -g %s"),
-			               dmake_value->string_mb);
-		} else {
-			length = 2 + strlen(NOCATGETS("DMAKE_GROUP"));
-			env = getmem(length);
-			(void) sprintf(env,
-			               "%s=",
-			               NOCATGETS("DMAKE_GROUP"));
-			(void) putenv(env);
-		}
-		MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_MAX_JOBS"));
-		dmake_name = GETNAME(wcs_buffer, FIND_LENGTH);
-		if (((prop = get_prop(dmake_name->prop, macro_prop)) != NULL) &&
-		    ((dmake_value = prop->body.macro.value) != NULL)) {
-			(void) sprintf(&rxm_command[strlen(rxm_command)],
-			               NOCATGETS(" -j %s"),
-			               dmake_value->string_mb);
-		} else {
-			length = 2 + strlen(NOCATGETS("DMAKE_MAX_JOBS"));
-			env = getmem(length);
-			(void) sprintf(env,
-			               "%s=",
-			               NOCATGETS("DMAKE_MAX_JOBS"));
-			(void) putenv(env);
-		}
-		MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_MODE"));
-		dmake_name = GETNAME(wcs_buffer, FIND_LENGTH);
-		if (((prop = get_prop(dmake_name->prop, macro_prop)) != NULL) &&
-		    ((dmake_value = prop->body.macro.value) != NULL)) {
-			(void) sprintf(&rxm_command[strlen(rxm_command)],
-			               NOCATGETS(" -m %s"),
-			               dmake_value->string_mb);
-		} else {
-			length = 2 + strlen(NOCATGETS("DMAKE_MODE"));
-			env = getmem(length);
-			(void) sprintf(env,
-			               "%s=",
-			               NOCATGETS("DMAKE_MODE"));
-			(void) putenv(env);
-		}
-		MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_ODIR"));
-		dmake_name = GETNAME(wcs_buffer, FIND_LENGTH);
-		if (((prop = get_prop(dmake_name->prop, macro_prop)) != NULL) &&
-		    ((dmake_value = prop->body.macro.value) != NULL)) {
-			(void) sprintf(&rxm_command[strlen(rxm_command)],
-			               NOCATGETS(" -o %s"),
-			               dmake_value->string_mb);
-		} else {
-			length = 2 + strlen(NOCATGETS("DMAKE_ODIR"));
-			env = getmem(length);
-			(void) sprintf(env,
-			               "%s=",
-			               NOCATGETS("DMAKE_ODIR"));
-			(void) putenv(env);
-		}
-
-		(void) sprintf(&rxm_command[strlen(rxm_command)],
-		               NOCATGETS(" %d %d"),
-		               pipe1[0], pipe2[1]);
-		execl(NOCATGETS("/usr/bin/sh"),
-		      NOCATGETS("sh"),
-		      NOCATGETS("-c"),
-		      rxm_command,
-		      (char *)NULL);
-		_exit(127);
-	}
-}
-
-/*
- * static void
- * set_dmake_env_vars()
- *
- * Sets the DMAKE_* environment variables for rxm and rxs.
- *	DMAKE_PWD
- *	DMAKE_NPWD
- *	DMAKE_UMASK
- *	DMAKE_SHELL
- */
-static void
-set_dmake_env_vars()
-{
-	char		*current_netpath;
-	char		*current_path;
-	static char	*env;
-	int		length;
-	char		netpath[MAXPATHLEN];
-	mode_t		um;
-	char		um_buf[MAXPATHLEN];
-	Name		dmake_name;
-	Name		dmake_value;
-	Property	prop;
-
-	/* Set __DMAKE_REDIRECT_STDERR */
-	length = 2 + strlen(NOCATGETS("__DMAKE_REDIRECT_STDERR")) + 1;
-	env = getmem(length);
-	(void) sprintf(env,
-	               "%s=%s",
-	               NOCATGETS("__DMAKE_REDIRECT_STDERR"),
-	               out_err_same ? NOCATGETS("0") : NOCATGETS("1"));
-	(void) putenv(env);
-
-	/* Set DMAKE_PWD to the current working directory */
-	current_path = get_current_path();
-	length = 2 + strlen(NOCATGETS("DMAKE_PWD")) + strlen(current_path);
-	env = getmem(length);
-	(void) sprintf(env,
-	               "%s=%s",
-	               NOCATGETS("DMAKE_PWD"),
-	               current_path);
-	(void) putenv(env);
-
-	/* Set DMAKE_NPWD to machine:pathname */
-	if (avo_path_to_netpath(current_path, netpath)) {
-		current_netpath = netpath;
-	} else {
-		current_netpath = current_path;
-	}
-	length = 2 + strlen(NOCATGETS("DMAKE_NPWD")) + strlen(current_netpath);
-	env = getmem(length);
-	(void) sprintf(env,
-	               "%s=%s",
-	               NOCATGETS("DMAKE_NPWD"),
-	               current_netpath);
-	(void) putenv(env);
-
-	/* Set DMAKE_UMASK to the value of umask */
-	um = umask(0);
-	umask(um);
-	(void) sprintf(um_buf, NOCATGETS("%ul"), um);
-	length = 2 + strlen(NOCATGETS("DMAKE_UMASK")) + strlen(um_buf);
-	env = getmem(length);
-	(void) sprintf(env,
-	               "%s=%s",
-	               NOCATGETS("DMAKE_UMASK"),
-	               um_buf);
-	(void) putenv(env);
-
-	if (((prop = get_prop(shell_name->prop, macro_prop)) != NULL) &&
-	    ((dmake_value = prop->body.macro.value) != NULL)) {
-		length = 2 + strlen(NOCATGETS("DMAKE_SHELL")) +
-		         strlen(dmake_value->string_mb);
-		env = getmem(length);
-		(void) sprintf(env,
-	    	           "%s=%s",
-	    	           NOCATGETS("DMAKE_SHELL"),
-	     	           dmake_value->string_mb);
-		(void) putenv(env);
-	}
-	MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_OUTPUT_MODE"));
-	dmake_name = GETNAME(wcs_buffer, FIND_LENGTH);
-	if (((prop = get_prop(dmake_name->prop, macro_prop)) != NULL) &&
-	    ((dmake_value = prop->body.macro.value) != NULL)) {
-		length = 2 + strlen(NOCATGETS("DMAKE_OUTPUT_MODE")) +
-		         strlen(dmake_value->string_mb);
-		env = getmem(length);
-		(void) sprintf(env,
-	    	           "%s=%s",
-	    	           NOCATGETS("DMAKE_OUTPUT_MODE"),
-	     	           dmake_value->string_mb);
-		(void) putenv(env);
-	}
-}
-
-/*
- * void
- * distribute_rxm(Avo_DoJobMsg *dmake_job_msg)
- *
- * Write the DMake rule to be distributed down the pipe to rxm.
- *
- */
-void
-distribute_rxm(Avo_DoJobMsg *dmake_job_msg)
-{
-	/* Add all dynamic env vars to the dmake_job_msg. */
-	setvar_envvar(dmake_job_msg);
-
-	/*
-	 * Copying dosys()...
-	 * Stat .make.state to see if we'll need to reread it later
-	 */
-	make_state->stat.time = file_no_time;
-	(void)exists(make_state);
-	make_state_before = make_state->stat.time;
-
-	// Wait for the first Acknowledge message from the rxm process
-	// before sending the first message.
-	if (!firstAcknowledgeReceived) {
-		firstAcknowledgeReceived++;
-		Avo_AcknowledgeMsg *msg = getAcknowledgeMsg();
-		if (msg) {
-			delete msg;
-		}
-	}
-
-	RWCollectable *doJobMsg = (RWCollectable *)dmake_job_msg;
-	sigset_t newset;
-        sigset_t oldset;
-
-	AVO_BLOCK_INTERUPTS;
-	int xdrResult = xdr(&xdrs_out, doJobMsg);
-
-	if (xdrResult) {
-		fflush(dmake_ofp);
-		AVO_UNBLOCK_INTERUPTS;
-	} else {
-		AVO_UNBLOCK_INTERUPTS;
-		fatal(catgets(catd, 1, 249, "Couldn't send the job request to rxm"));
-	}
-
-	delete dmake_job_msg;
-}
-
-// Queue for JobResult messages.
-static RWSlistCollectablesQueue jobResultQueue;
-
-// Queue for Acknowledge messages.
-static RWSlistCollectablesQueue acknowledgeQueue;
-
-// Read a message from the rxm process, and put it into a queue, by
-// message type. Return the message type.
-
-int
-getRxmMessage(void)
-{
-        RWCollectable	*msg = (RWCollectable *)0;
-	int		msgType = 0;
-//	sigset_t	newset;
-//	sigset_t	oldset;
-
-	// It seems unnecessarily to block interrupts here because
-	// any nonignored signal means exit for dmake in distributed mode.
-//	AVO_BLOCK_INTERUPTS;
-	int xdrResult = xdr(&xdrs_in, msg);
-//	AVO_UNBLOCK_INTERUPTS;
-
-	if (xdrResult) {
-		switch(msg->isA()) {
-		case __AVO_ACKNOWLEDGEMSG:
-			acknowledgeQueue.append(msg);
-			msgType = __AVO_ACKNOWLEDGEMSG;
-			break;
-		case __AVO_JOBRESULTMSG:
-			jobResultQueue.append(msg);
-			msgType = __AVO_JOBRESULTMSG;
-			break;
-		default:
-			warning(catgets(catd, 1, 291, "Unknown message on rxm input fd"));
-			msgType = 0;
-			break;
-		}
-	} else {
-		if (errno == EINTR) {
-			fputs(NOCATGETS("dmake: Internal error: xdr() has been interrupted by a signal.\n"), stderr);
-		}
-		fatal(catgets(catd, 1, 250, "Couldn't receive message from rxm"));
-	}
-
-	return msgType;
-}
-
-// Get a JobResult message from it's queue, and
-// if the queue is empty, call the getRxmMessage() function until
-// a JobResult message shows.
-
-Avo_JobResultMsg *
-getJobResultMsg(void)
-{
-	RWCollectable *msg = 0;
-
-	if (!(msg = jobResultQueue.get())) {
-		while (getRxmMessage() != __AVO_JOBRESULTMSG);
-		msg = jobResultQueue.get();
-	}
-
-	return (Avo_JobResultMsg *)msg;
-}
-
-// Get an Acknowledge message from it's queue, and
-// if the queue is empty, call the getRxmMessage() function until
-// a Acknowledge message shows.
-
-Avo_AcknowledgeMsg *
-getAcknowledgeMsg(void)
-{
-	RWCollectable *msg = 0;
-
-	if (!(msg = acknowledgeQueue.get())) {
-		while (getRxmMessage() != __AVO_ACKNOWLEDGEMSG);
-		msg = acknowledgeQueue.get();
-	}
-
-	return (Avo_AcknowledgeMsg *)msg;
-}
-
-
-/*
- * Doname
- * await_dist(Boolean waitflg)
- *
- * Waits for distributed children to exit and finishes their processing.
- * Rxm will send a msg down the pipe when a child is done.
- *
- */
-Doname
-await_dist(Boolean waitflg)
-{
-	Avo_JobResultMsg	*dmake_result_msg;
-	int			job_msg_id;
-	Doname			result = build_ok;
-	int			result_msg_cmd_status;
-	int			result_msg_job_status;
-	Running			rp;
-
-	while (!(dmake_result_msg = getJobResultMsg()));
-	job_msg_id = dmake_result_msg->getId();
-	result_msg_cmd_status = dmake_result_msg->getCmdStatus();
-	result_msg_job_status = dmake_result_msg->getJobStatus();
-
-	if (waitflg) {
-		result = (result_msg_cmd_status == 0) ? build_ok : build_failed;
-
-#ifdef PRINT_EXIT_STATUS
-		if (result == build_ok) {
-			warning(NOCATGETS("I'm in await_dist(), waitflg is true, and result is build_ok."));
-		} else {
-			warning(NOCATGETS("I'm in await_dist(), waitflg is true, and result is build_failed."));
-		}
-#endif
-
-	} else {
-		for (rp = running_list;
-		     (rp != NULL) && (job_msg_id != rp->job_msg_id);
-		     rp = rp->next) {
-		}
-		if (rp == NULL) {
-			fatal(catgets(catd, 1, 251, "Internal error: returned child job_msg_id not in running_list"));
-		} else {
-			/* XXX - This may not be correct! */
-			if (result_msg_job_status == RETURNED) {
-				rp->state = build_ok;
-			} else {
-				rp->state = (result_msg_cmd_status == 0) ? build_ok : build_failed;
-			}
-			result = rp->state;
-
-#ifdef PRINT_EXIT_STATUS
-			if (result == build_ok) {
-				warning(NOCATGETS("I'm in await_dist(), waitflg is false, and result is build_ok."));
-			} else {
-				warning(NOCATGETS("I'm in await_dist(), waitflg is false, and result is build_failed."));
-			}
-#endif
-
-		}
-		parallel_process_cnt--;
-	}
-	delete dmake_result_msg;
-	return result;
-}
-
-#endif
-
-
--- old/usr/src/cmd/make/bin/doname.cc	2015-05-20 11:55:52.065429381 -0400
+++ new/usr/src/cmd/make/bin/doname.cc	2015-05-20 11:55:52.078382929 -0400
@@ -34,16 +34,6 @@
  */
 #include <alloca.h>		/* alloca() */
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-#	include <avo/strings.h>	/* AVO_STRDUP() */
-#	include <dm/Avo_MToolJobResultMsg.h>
-#	include <dm/Avo_MToolJobStartMsg.h>
-#	include <dm/Avo_MToolRsrcInfoMsg.h>
-#	include <dm/Avo_macro_defs.h> /* AVO_BLOCK_INTERUPTS & AVO_UNBLOCK_INTERUPTS */
-#	include <dmthread/Avo_ServerState.h>
-#	include <rw/pstream.h>
-#	include <rw/xdrstrea.h>
-#endif
 
 #include <fcntl.h>
 #include <mk/defs.h>
@@ -71,14 +61,7 @@
 
 #define MAXRULES 100
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-#define SEND_MTOOL_MSG(cmds) \
-	if (send_mtool_msgs) { \
-		cmds \
-	}
-#else
 #define SEND_MTOOL_MSG(cmds) 
-#endif
 
 // Sleep for .1 seconds between stat()'s
 const int	STAT_RETRY_SLEEP_TIME = 100000;
@@ -93,11 +76,6 @@
 static char	hostName[MAXNAMELEN] = "";
 static char	userName[MAXNAMELEN] = "";
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-	static FILE	*mtool_msgs_fp;
-	static XDR 	xdrs;
-	static int	sent_rsrc_info_msg = 0;
-#endif
 
 static int	second_pass = 0;
 
@@ -130,14 +108,6 @@
 extern	Name		normalize_name(register wchar_t *name_string, register int length);
 
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-	static void		append_job_result_msg(Avo_MToolJobResultMsg *job_result_msg);
-	static int		pollResults(char *outFn, char *errFn, char *hostNm);
-	static void		pollResultsAction(char *outFn, char *errFn);
-	static void		rxmGetNextResultsBlock(int fd);
-	static int		us_sleep(unsigned int nusecs);
-	extern "C" void		Avo_PollResultsAction_Sigusr1Handler(int foo);
-#endif
 
 /*
  * DONE.
@@ -1019,16 +989,6 @@
 			if (dependencies_running) {
 				break;
 			}
-#ifdef DISTRIBUTED
-		} else if ((!parallel_ok(dependency->name, false)) &&
-			   (dependencies_running)) {
-			/*
-			 * If we can't execute the current dependency in
-			 * parallel, hold off the dependency processing
-			 * to preserve the order of the dependencies.
-			 */
-			break;
-#endif
 		} else {
 			timestruc_t	depe_time = file_doesnt_exist;
 
@@ -1844,10 +1804,6 @@
 execute_serial(Property line)
 {
 	int			child_pid = 0;
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-	Avo_MToolJobResultMsg	*job_result_msg;
-	RWCollectable		*xdr_msg;
-#endif
 	Boolean			printed_serial;
 	Doname			result = build_ok;
 	Cmd_line		rule, cmd_tail, command = NULL;
@@ -1930,11 +1886,7 @@
 				do_assign(rule->command_line, target);
 			} else if (report_dependencies_level == 0) {
 				/* Execute command line. */
-#ifdef DISTRIBUTED
-				setvar_envvar((Avo_DoJobMsg *)NULL);
-#else
 				setvar_envvar();
-#endif
 				result = dosys(rule->command_line,
 				               (Boolean) rule->ignore_error,
 				               (Boolean) rule->make_refd,
@@ -2038,130 +1990,6 @@
 }
 
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-
-/*
- * Create and send an Avo_MToolRsrcInfoMsg.
- */
-void
-send_rsrc_info_msg(int max_jobs, char *hostname, char *username)
-{
-	static int		first = 1;
-	Avo_MToolRsrcInfoMsg	*msg;
-	RWSlistCollectables	server_list;
-	Avo_ServerState		*server_state;
-	RWCollectable		*xdr_msg;
-
-	if (!first) {
-		return;
-	}
-	first = 0;
-
-	create_xdrs_ptr();
-
-	server_state = new Avo_ServerState(max_jobs, hostname, username);
-	server_list.append(server_state);
-	msg = new Avo_MToolRsrcInfoMsg(&server_list);
-
-	xdr_msg = (RWCollectable *)msg;
-	xdr(get_xdrs_ptr(), xdr_msg);
-	(void) fflush(get_mtool_msgs_fp());
-
-	delete server_state;
-	delete msg;
-}
-
-/*
- * Create and send an Avo_MToolJobStartMsg.
- */
-void
-send_job_start_msg(Property line)
-{
-	int			cmd_options = 0;
-	Avo_MToolJobStartMsg	*msg;
-	Cmd_line		rule;
-	Name			target = line->body.line.target;
-	RWCollectable		*xdr_msg;
-
-	if (userName[0] == '\0') {
-		avo_get_user(userName, NULL);
-	}
-	if (hostName[0] == '\0') {
-		strcpy(hostName, avo_hostname());
-	}
-
-	msg = new Avo_MToolJobStartMsg();
-	msg->setJobId(++job_msg_id);
-	msg->setTarget(AVO_STRDUP(target->string_mb));
-	msg->setHost(AVO_STRDUP(hostName));
-	msg->setUser(AVO_STRDUP(userName));
-
-        for (rule = line->body.line.command_used;
-             rule != NULL;
-             rule = rule->next) {
-		if (posix && (touch || quest) && !rule->always_exec) {
-			continue;
-		}
-                if (vpath_defined) {
-                        rule->command_line =
-                          vpath_translation(rule->command_line);
-                }
-		cmd_options = 0;
-		if (rule->ignore_error || ignore_errors) {
-			cmd_options |= ignore_mask;
-		}
-		if (rule->silent || silent) {
-			cmd_options |= silent_mask;
-		}
-		if (rule->command_line->meta) {
-			cmd_options |= meta_mask;
-		}
-                if (!touch && (rule->command_line->hash.length > 0)) {
-			msg->appendCmd(new Avo_DmakeCommand(rule->command_line->string_mb, cmd_options));
-                }
-        }
-
-	xdr_msg = (RWCollectable*) msg;
-	xdr(&xdrs, xdr_msg);
-	(void) fflush(mtool_msgs_fp);
-
-/* tolik, 08/39/2002.
-   I commented out this code because it causes using unallocated memory.
-	delete msg;
-*/
-}
-
-/*
- * Append the stdout/err to Avo_MToolJobResultMsg.
- */
-static void
-append_job_result_msg(Avo_MToolJobResultMsg *job_result_msg)
-{
-	FILE		*fp;
-	char		line[MAXPATHLEN];
-	char		stdout_file2[MAXPATHLEN];
-
-	if (stdout_file != NULL) {
-		fp = fopen(stdout_file, "r");
-		if (fp == NULL) {
-			/* Hmmm... what should we do here? */
-			warning(catgets(catd, 1, 326, "fopen() of stdout_file failed. Output may be lost"));
-			return;
-		}
-		while (fgets(line, MAXPATHLEN, fp) != NULL) {
-			if (line[strlen(line) - 1] == '\n') {
-				line[strlen(line) - 1] = '\0';
-			}
-			job_result_msg->appendOutput(AVO_STRDUP(line));
-		}
-		(void) fclose(fp);
-		us_sleep(STAT_RETRY_SLEEP_TIME);
-	} else {
-		/* Hmmm... stdout_file shouldn't be NULL */
-		warning(catgets(catd, 1, 327, "Internal stdout_file variable shouldn't be NULL. Output may be lost"));
-	}
-}
-#endif /* TEAMWARE_MAKE_CMN */
 
 /*
  *	vpath_translation(cmd)
@@ -2793,14 +2621,6 @@
 	Name			touch_cmd;
 	Cmd_line		rule;
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-	Avo_MToolJobResultMsg	*job_result_msg;
-	RWCollectable		*xdr_msg;
-	int			child_pid = 0;
-	wchar_t			string[MAXPATHLEN];
-	char			mbstring[MAXPATHLEN];
-	int			filed;
-#endif
 
 	SEND_MTOOL_MSG(
 		if (!sent_rsrc_info_msg) {
@@ -3460,164 +3280,6 @@
 	}
 }
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-void
-create_xdrs_ptr(void)
-{
-	static int	xdrs_init = 0;
-
-	if (!xdrs_init) {
-		xdrs_init = 1;
-		mtool_msgs_fp = fdopen(mtool_msgs_fd, "a");
-		xdrstdio_create(&xdrs,
-		                mtool_msgs_fp,
-		                XDR_ENCODE);
-	}
-}
-
-XDR *
-get_xdrs_ptr(void)
-{
-	return &xdrs;
-}
-
-FILE *
-get_mtool_msgs_fp(void)
-{
-	return mtool_msgs_fp;
-}
-
-int
-get_job_msg_id(void)
-{
-	return job_msg_id;
-}
-
-// Continuously poll and show the results of remotely executing a job,
-// i.e., output the stdout and stderr files.
-
-static int
-pollResults(char *outFn, char *errFn, char *hostNm)
-{
-	int		child;
-
-	child = fork();
-	switch (child) {
-	case -1:
-		break;
-	case 0:
-		enable_interrupt((void (*) (int))SIG_DFL);
-		(void) sigset(SIGUSR1, Avo_PollResultsAction_Sigusr1Handler);
-		pollResultsAction(outFn, errFn);
-
-		exit(0);
-		break;
-	default:
-		break;
-	}
-	return child;
-}
-
-// This is the PollResultsAction SIGUSR1 handler.
-
-static bool_t pollResultsActionTimeToFinish = FALSE;
-
-extern "C" void
-Avo_PollResultsAction_Sigusr1Handler(int foo)
-{
-	pollResultsActionTimeToFinish = TRUE;
-}
-
-static void
-pollResultsAction(char *outFn, char *errFn)
-{
-	int			fd;
-	time_t			file_time = 0;
-	long			file_time_nsec = 0;
-	struct stat		statbuf;
-	int			stat_rc;
-
-	// Keep stat'ing until file exists.
-	while (((stat_rc = stat(outFn, &statbuf)) != 0) &&
-	       (errno == ENOENT) && 
-	       !pollResultsActionTimeToFinish) {
-		us_sleep(STAT_RETRY_SLEEP_TIME);
-	}
-	// The previous stat() could be failed due to EINTR
-	// So one more try is needed
-	if (stat_rc != 0 && stat(outFn, &statbuf) != 0) {
-		// stat() failed
-		warning(NOCATGETS("Internal error: stat(\"%s\", ...) failed: %s\n"),
-			outFn, strerror(errno));
-		exit(1);
-	}
-
-	if ((fd = open(outFn, O_RDONLY)) < 0
-		&& (errno != EINTR || (fd = open(outFn, O_RDONLY)) < 0)) {
-		// open() failed
-		warning(NOCATGETS("Internal error: open(\"%s\", O_RDONLY) failed: %s\n"),
-			outFn, strerror(errno));
-		exit(1);
-	}
-
-	while (!pollResultsActionTimeToFinish && stat(outFn, &statbuf) == 0) {
-		if ((statbuf.st_mtim.tv_sec > file_time) ||
-		    ((statbuf.st_mtim.tv_sec == file_time) &&
-		    (statbuf.st_mtim.tv_nsec > file_time_nsec))
-		   ) {
-			file_time = statbuf.st_mtim.tv_sec;
-			file_time_nsec = statbuf.st_mtim.tv_nsec;
-			rxmGetNextResultsBlock(fd);
-		}
-		us_sleep(STAT_RETRY_SLEEP_TIME);
-	}
-	// Check for the rest of output
-	rxmGetNextResultsBlock(fd);
-
-	(void) close(fd);
-}
-
-static void
-rxmGetNextResultsBlock(int fd)
-{
-	size_t			to_read = 8 * 1024;
-	ssize_t			bytes_read;
-	ssize_t			bytes_written;
-	char			results_buf[8 * 1024];
-	sigset_t		newset;
-	sigset_t		oldset;
-
-	// Read some more from the output/results file.
-	// Hopefully the kernel managed to prefetch the stuff.
-	bytes_read = read(fd, results_buf, to_read);
-	while (bytes_read > 0) {
-		AVO_BLOCK_INTERUPTS;
-		bytes_written = write(1, results_buf, bytes_read);
-		AVO_UNBLOCK_INTERUPTS;
-		if (bytes_written != bytes_read) {
-			// write() failed
-			warning(NOCATGETS("Internal error: write(1, ...) failed: %s\n"),
-				strerror(errno));
-			exit(1);
-		}
-		bytes_read = read(fd, results_buf, to_read);
-	}
-}
-
-// Generic, interruptable microsecond resolution sleep member function.
-
-static int
-us_sleep(unsigned int nusecs)
-{
-	struct pollfd dummy;
-	int timeout;
-
-	if ((timeout = nusecs/1000) <= 0) {
-		timeout = 1;
-	}
-	return poll(&dummy, 0, timeout);
-}
-#endif /* TEAMWARE_MAKE_CMN */
 
 // Recursively delete each of the Chain struct on the chain.
 
--- old/usr/src/cmd/make/bin/dosys.cc	2015-05-20 11:55:52.749207937 -0400
+++ new/usr/src/cmd/make/bin/dosys.cc	2015-05-20 11:55:52.760838552 -0400
@@ -130,13 +130,8 @@
 		 	   stdout_file, stderr_file,
 	                   vroot_path, 0),
 	          send_mtool_msgs,
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-                  get_xdrs_ptr(),
-                  get_job_msg_id()
-#else
                   NULL,
                   -1
-#endif
 	          )) {
 		result = build_ok;
 	} else {
--- old/usr/src/cmd/make/bin/globals.cc	2015-05-20 11:55:53.925247066 -0400
+++ new/usr/src/cmd/make/bin/globals.cc	2015-05-20 11:55:53.937433135 -0400
@@ -60,14 +60,8 @@
 	Boolean		assign_done;
 	int foo;	
 	Boolean		build_failed_seen;
-#ifdef DISTRIBUTED
-	Boolean		building_serial;
-#endif
 	Name		built_last_make_run;
 	Name		c_at;
-#ifdef DISTRIBUTED
-	Boolean		called_make = false;
-#endif
 	Boolean		cleanup;
 	Boolean		close_report;
 	Boolean		command_changed;
--- old/usr/src/cmd/make/bin/macro.cc	2015-05-20 11:55:55.215425397 -0400
+++ new/usr/src/cmd/make/bin/macro.cc	2015-05-20 11:55:55.227136847 -0400
@@ -32,10 +32,6 @@
 /*
  * Included files
  */
-#ifdef DISTRIBUTED
-#include <avo/strings.h>	/* AVO_STRDUP() */
-#include <dm/Avo_DoJobMsg.h>
-#endif
 #include <mk/defs.h>
 #include <mksh/macro.h>		/* getvar(), expand_value() */
 #include <mksh/misc.h>		/* getmem() */
@@ -113,17 +109,10 @@
  *		envvar		A list of environment vars with $ in value
  */
 void
-#ifdef DISTRIBUTED
-setvar_envvar(Avo_DoJobMsg *dmake_job_msg)
-#else
 setvar_envvar(void)
-#endif
 {
 	wchar_t			buffer[STRING_BUFFER_LENGTH];
 	int			length;
-#ifdef DISTRIBUTED
-	Property		macro;
-#endif
 	register	char	*mbs, *tmp_mbs_buffer = NULL;
 	register	char	*env, *tmp_mbs_buffer2 = NULL;
 	Envvar			p;
@@ -131,9 +120,6 @@
 
 	for (p = envvar; p != NULL; p = p->next) {
 		if (p->already_put
-#ifdef DISTRIBUTED
-		    && !dmake_job_msg
-#endif
 		    ) {
 			continue;
 		}
@@ -167,11 +153,6 @@
 			p->env_string = env;
 			tmp_mbs_buffer2 = NULL; // We should not return this memory now
 		}
-#ifdef DISTRIBUTED
-		if (dmake_job_msg) {
-			dmake_job_msg->appendVar(env);
-		}
-#endif
 		if (tmp_mbs_buffer2) {
 			retmem_mb(tmp_mbs_buffer2);
 			tmp_mbs_buffer2 = NULL;
@@ -181,29 +162,6 @@
 			tmp_mbs_buffer = NULL;
 		}
 	}
-#ifdef DISTRIBUTED
-	/* Append SUNPRO_DEPENDENCIES to the dmake_job_msg. */
-	if (keep_state && dmake_job_msg) {
-		macro = get_prop(sunpro_dependencies->prop, macro_prop);
-		length = 2 +
-		         strlen(sunpro_dependencies->string_mb) +
-		         strlen(macro->body.macro.value->string_mb);
-		if (length > (MAXPATHLEN * MB_LEN_MAX)) {
-			env = tmp_mbs_buffer2 = getmem(length);
-		} else {
-			env = mbs_buffer2;
-		}
-		(void) sprintf(env,
-			       "%s=%s",
-			       sunpro_dependencies->string_mb,
-			       macro->body.macro.value->string_mb);
-		dmake_job_msg->appendVar(env);
-		if (tmp_mbs_buffer2) {
-			retmem_mb(tmp_mbs_buffer2);
-			tmp_mbs_buffer2 = NULL;
-		}
-	}
-#endif
 }
 
 
--- old/usr/src/cmd/make/bin/main.cc	2015-05-20 11:55:55.673453448 -0400
+++ new/usr/src/cmd/make/bin/main.cc	2015-05-20 11:55:55.686178908 -0400
@@ -38,11 +38,6 @@
 
 #include <bsd/bsd.h>		/* bsd_signal() */
 
-#ifdef DISTRIBUTED
-#	include <dm/Avo_AcknowledgeMsg.h>
-#	include <rw/xdrstrea.h>
-#	include <dmrc/dmrc.h> /* dmakerc file processing */
-#endif
 
 #include <locale.h>		/* setlocale() */
 #include <mk/defs.h>
@@ -165,12 +160,6 @@
 
 extern void expand_value(Name, register String , Boolean);
 
-#ifdef DISTRIBUTED
-	extern	int		dmake_ofd;
-	extern	FILE*		dmake_ofp;
-	extern	int		rxmPid;
-	extern	XDR 		xdrs_out;
-#endif
 #ifdef TEAMWARE_MAKE_CMN
 	static const char	verstring[] = "illumos make";
 #endif
@@ -245,7 +234,7 @@
 // ---> fprintf(stderr, catgets(catd, 15, 666, "--- SUN make ---\n"));
 
 
-#if defined(TEAMWARE_MAKE_CMN) || defined(MAKETOOL)
+#if defined(TEAMWARE_MAKE_CMN)
 /*
  * I put libmksdmsi18n_init() under #ifdef because it requires avo_i18n_init()
  * from avo_util library. 
@@ -476,47 +465,10 @@
 		 * If neither is defined, and $(HOME)/.dmakerc does not exists,
 		 * then print a message, and default to parallel mode.
 		 */
-#ifdef DISTRIBUTED
-		MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_RCFILE"));
-		dmake_name = GETNAME(wcs_buffer, FIND_LENGTH);
-		MBSTOWCS(wcs_buffer, NOCATGETS("DMAKE_MODE"));
-		dmake_name2 = GETNAME(wcs_buffer, FIND_LENGTH);
-		if ((((prop = get_prop(dmake_name->prop, macro_prop)) == NULL) ||
-		     ((dmake_value = prop->body.macro.value) == NULL)) &&
-		    (((prop2 = get_prop(dmake_name2->prop, macro_prop)) == NULL) ||
-		     ((dmake_value2 = prop2->body.macro.value) == NULL))) {
-			Boolean empty_dmakerc = true;
-			char *homedir = getenv(NOCATGETS("HOME"));
-			if ((homedir != NULL) && (strlen(homedir) < (sizeof(def_dmakerc_path) - 16))) {
-				sprintf(def_dmakerc_path, NOCATGETS("%s/.dmakerc"), homedir);
-				if ((((statval = stat(def_dmakerc_path, &statbuf)) != 0) && (errno == ENOENT)) ||
-					((statval == 0) && (statbuf.st_size == 0))) {
-				} else {
-					Avo_dmakerc	*rcfile = new Avo_dmakerc();
-					Avo_err		*err = rcfile->read(def_dmakerc_path, NULL, TRUE);
-					if (err) {
-						fatal(err->str);
-					}
-					empty_dmakerc = rcfile->was_empty();
-					delete rcfile;
-				}
-			}
-			if (empty_dmakerc) {
-				if (getenv(NOCATGETS("DMAKE_DEF_PRINTED")) == NULL) {
-					putenv(NOCATGETS("DMAKE_DEF_PRINTED=TRUE"));
-					(void) fprintf(stdout, catgets(catd, 1, 302, "dmake: defaulting to parallel mode.\n"));
-					(void) fprintf(stdout, catgets(catd, 1, 303, "See the man page dmake(1) for more information on setting up the .dmakerc file.\n"));
-				}
-				dmake_mode_type = parallel_mode;
-				no_parallel = false;
-			}
-		}
-#else
 		if(dmake_mode_type == distributed_mode) {
 			dmake_mode_type = parallel_mode;
 			no_parallel = false;
 		}
-#endif	/* DISTRIBUTED */
 	}
     }
 #endif
@@ -564,18 +516,6 @@
 	}
 #endif
 
-#ifdef DISTRIBUTED
-	/*
-	 * At this point, DMake should startup an rxm with any and all
-	 * DMake command line options. Rxm will, among other things,
-	 * read the rc file.
-	 */
-	if ((!list_all_targets) &&
-	    (report_dependencies_level == 0) &&
-	    (dmake_mode_type == distributed_mode)) {
-		startup_rxm();
-	}
-#endif
 		
 /*
  *	Enable interrupt handler for alarms
@@ -653,9 +593,6 @@
  		}
  	}
 
-#ifdef DISTRIBUTED
-	building_serial = false;
-#endif
 
 	report_dir_enter_leave(true);
 
@@ -744,12 +681,6 @@
 }
 #endif
 
-/*
-#ifdef DISTRIBUTED
-    if (get_parent() == TRUE) {
-#endif
- */
-
 	parallel = false;
 	/* If we used the SVR4_MAKE, don't build .DONE or .FAILED */
 	if (!getenv(USE_SVR4_MAKE)){
@@ -831,11 +762,6 @@
 	}
 	/* Write .make.state */
 	write_state_file(1, (Boolean) 1);
-/*
-#ifdef DISTRIBUTED
-    }
-#endif
- */
 
 #if defined (TEAMWARE_MAKE_CMN) && defined (MAXJOBS_ADJUST_RFE4694000)
 	job_adjust_fini();
@@ -844,27 +770,6 @@
 #ifdef TEAMWARE_MAKE_CMN
 	catclose(catd);
 #endif
-#ifdef DISTRIBUTED
-	if (rxmPid > 0) {
-		// Tell rxm to exit by sending it an Avo_AcknowledgeMsg
-		Avo_AcknowledgeMsg acknowledgeMsg;
-		RWCollectable *msg = (RWCollectable *)&acknowledgeMsg;
-
-		int xdrResult = xdr(&xdrs_out, msg);
-
-		if (xdrResult) {
-			fflush(dmake_ofp);
-		} else {
-/*
-			fatal(catgets(catd, 1, 266, "couldn't tell rxm to exit"));
- */
-			kill(rxmPid, SIGTERM);
-		}
-
-		waitpid(rxmPid, NULL, 0);
-		rxmPid = 0;
-	}
-#endif
 }
 
 /*
@@ -888,22 +793,6 @@
 	Running			rp;
 
 	(void) fflush(stdout);
-#ifdef DISTRIBUTED
-	if (rxmPid > 0) {
-		// Tell rxm to exit by sending it an Avo_AcknowledgeMsg
-		Avo_AcknowledgeMsg acknowledgeMsg;
-		RWCollectable *msg = (RWCollectable *)&acknowledgeMsg;
-
-		int xdrResult = xdr(&xdrs_out, msg);
-
-		if (xdrResult) {
-			fflush(dmake_ofp);
-		} else {
-			kill(rxmPid, SIGTERM);
-			rxmPid = 0;
-		}
-	}
-#endif
 	if (childPid > 0) {
 		kill(childPid, SIGTERM);
 		childPid = -1;
@@ -1619,9 +1508,6 @@
 		if (invert_this) {
 			send_mtool_msgs = false;
 		} else {
-#ifdef DISTRIBUTED
-			send_mtool_msgs = true;
-#endif
 		}
 		return 128;
 	case 'o':			 /* Use alternative dmake output dir */
@@ -3409,53 +3295,6 @@
 }
 #endif
 
-#ifdef DISTRIBUTED
-/*
- * Returns whether -c is set or not.
- */
-Boolean
-get_dmake_rcfile_specified(void)
-{
-	return(dmake_rcfile_specified);
-}
-
-/*
- * Returns whether -g is set or not.
- */
-Boolean
-get_dmake_group_specified(void)
-{
-	return(dmake_group_specified);
-}
-
-/*
- * Returns whether -j is set or not.
- */
-Boolean
-get_dmake_max_jobs_specified(void)
-{
-	return(dmake_max_jobs_specified);
-}
-
-/*
- * Returns whether -m is set or not.
- */
-Boolean
-get_dmake_mode_specified(void)
-{
-	return(dmake_mode_specified);
-}
-
-/*
- * Returns whether -o is set or not.
- */
-Boolean
-get_dmake_odir_specified(void)
-{
-	return(dmake_odir_specified);
-}
-
-#endif
 
 static void
 report_dir_enter_leave(Boolean entering)
--- old/usr/src/cmd/make/bin/misc.cc	2015-05-20 11:55:56.338473706 -0400
+++ new/usr/src/cmd/make/bin/misc.cc	2015-05-20 11:55:56.350171012 -0400
@@ -143,11 +143,7 @@
 
 	va_start(args, message);
 	(void) fflush(stdout);
-#ifdef DISTRIBUTED
-	(void) fprintf(stderr, catgets(catd, 1, 262, "dmake: Fatal error: "));
-#else
 	(void) fprintf(stderr, catgets(catd, 1, 263, "make: Fatal error: "));
-#endif
 	(void) vfprintf(stderr, message, args);
 	(void) fprintf(stderr, "\n");
 	va_end(args);
@@ -175,15 +171,7 @@
 	}
 
 	while (parallel_process_cnt > 0) {
-#ifdef DISTRIBUTED
-		if (dmake_mode_type == distributed_mode) {
-			(void) await_dist(false);
-		} else {
-			await_parallel(true);
-		}
-#else
 		await_parallel(true);
-#endif
 		finish_children(false);
 	}
 #endif
@@ -216,11 +204,7 @@
 
 	va_start(args, message);
 	(void) fflush(stdout);
-#ifdef DISTRIBUTED
-	(void) fprintf(stderr, catgets(catd, 1, 264, "dmake: Warning: "));
-#else
 	(void) fprintf(stderr, catgets(catd, 1, 265, "make: Warning: "));
-#endif
 	(void) vfprintf(stderr, message, args);
 	(void) fprintf(stderr, "\n");
 	va_end(args);
@@ -284,17 +268,8 @@
 		if (pwd[0] == (int) nul_char) {
 			pwd[0] = (int) slash_char;
 			pwd[1] = (int) nul_char;
-#ifdef DISTRIBUTED
-			current_path = strdup(pwd);
-		} else if (IS_EQUALN(pwd, NOCATGETS("/tmp_mnt"), 8)) {
-			current_path = strdup(pwd + 8);
-		} else {
-			current_path = strdup(pwd);
-		}
-#else
 		}
 		current_path = strdup(pwd);
-#endif
 	}
 	return current_path;
 }
--- old/usr/src/cmd/make/bin/parallel.cc	2015-05-20 11:55:56.802272699 -0400
+++ new/usr/src/cmd/make/bin/parallel.cc	2015-05-20 11:55:56.814917300 -0400
@@ -34,11 +34,6 @@
 /*
  * Included files
  */
-#ifdef DISTRIBUTED
-#include <avo/strings.h>	/* AVO_STRDUP() */
-#include <dm/Avo_DoJobMsg.h>
-#include <dm/Avo_MToolJobResultMsg.h>
-#endif
 #include <errno.h>		/* errno */
 #include <fcntl.h>
 #include <mk/defs.h>
@@ -89,11 +84,6 @@
 /*
  * File table of contents
  */
-#ifdef DISTRIBUTED
-static	void		append_dmake_cmd(Avo_DoJobMsg *dmake_job_msg, char *orig_cmd_line, int cmd_options);
-static	void		append_job_result_msg(Avo_MToolJobResultMsg *msg, char *outFn, char *errFn);
-static	void		send_job_result_msg(Running rp);
-#endif
 static	void		delete_running_struct(Running rp);
 static	Boolean		dependency_conflict(Name target);
 static	Doname		distribute_process(char **commands, Property line);
@@ -128,9 +118,6 @@
 	int			cmd_options = 0;
 	char			*commands[MAXRULES + 5];
 	char			*cp;
-#ifdef DISTRIBUTED
-	Avo_DoJobMsg		*dmake_job_msg = NULL;
-#endif
 	Name			dmake_name;
 	Name			dmake_value;
 	int			ignore;
@@ -177,11 +164,6 @@
 				pmake_max_jobs = PMAKE_DEF_MAX_JOBS;
 			}
 		}
-#ifdef DISTRIBUTED
-		if (send_mtool_msgs) {
-			send_rsrc_info_msg(pmake_max_jobs, local_host, user_name);
-		}
-#endif
 	}
 
 	if ((dmake_mode_type == serial_mode) ||
@@ -189,19 +171,6 @@
 		return (execute_serial(line));
 	}
 
-#ifdef DISTRIBUTED
-	if (dmake_mode_type == distributed_mode) {
-		if(local) {
-//			return (execute_serial(line));
-			waitflg = true;
-		}
-		dmake_job_msg = new Avo_DoJobMsg();
-		dmake_job_msg->setJobId(++job_msg_id);
-		dmake_job_msg->setTarget(target->string_mb);
-		dmake_job_msg->setImmediateOutput(0);
-		called_make = false;
-	} else
-#endif
 	{
 		p = commands;
 	}
@@ -236,52 +205,6 @@
 					return build_serial;
 				}
 			}
-#ifdef DISTRIBUTED
-			if (dmake_mode_type == distributed_mode) {
-				/*
-				 * XXX - set assign_mask to tell rxm
-				 * to do the following.
-				 */
-/* From execute_serial():
-				if (rule->assign) {
-					result = build_ok;
-					do_assign(rule->command_line, target);
- */
-				if (0) {
-				} else if (report_dependencies_level == 0) {
-					if (rule->ignore_error) {
-						cmd_options |= ignore_mask;
-					}
-					if (rule->silent) {
-						cmd_options |= silent_mask;
-					}
-					if (rule->command_line->meta) {
-						cmd_options |= meta_mask;
-					}
-					if (rule->make_refd) {
-						cmd_options |= make_refd_mask;
-					}
-					if (do_not_exec_rule) {
-						cmd_options |= do_not_exec_mask;
-					}
-					append_dmake_cmd(dmake_job_msg,
-					                 rule->command_line->string_mb,
-					                 cmd_options);
-					/* Copying dosys()... */
-					if (rule->make_refd) {
-						if (waitflg) {
-							dmake_job_msg->setImmediateOutput(1);
-						}
-						called_make = true;
-						if (command_changed &&
-						    !wrote_state_file) {
-							write_state_file(0, false);
-							wrote_state_file = true;
-						}
-					}
-				}
-			} else
-#endif
 			{
 				if (rule->silent && !silent) {
 					silent_flag = true;
@@ -313,74 +236,8 @@
 	}
 	if ((argcnt == 0) ||
 	    (report_dependencies_level > 0)) {
-#ifdef DISTRIBUTED
-		if (dmake_job_msg) {
-			delete dmake_job_msg;
-		}
-#endif
 		return build_ok;
 	}
-#ifdef DISTRIBUTED
-	if (dmake_mode_type == distributed_mode) {
-		// Send  a DoJob message to the rxm process.
-		distribute_rxm(dmake_job_msg);
-
-		// Wait for an acknowledgement.
-		Avo_AcknowledgeMsg *ackMsg = getAcknowledgeMsg();
-		if (ackMsg) {
-			delete ackMsg;
-		}
-
-		if (waitflg) {
-			// Wait for, and process a job result.
-			result = await_dist(waitflg);
-			if (called_make) {
-				maybe_reread_make_state();
-			}
-			check_state(temp_file_name);
-			if (result == build_failed) {
-				if (!continue_after_error) {
-
-#ifdef PRINT_EXIT_STATUS
-					warning(NOCATGETS("I'm in execute_parallel. await_dist() returned build_failed"));
-#endif
-
-					fatal(catgets(catd, 1, 252, "Command failed for target `%s'"),
-					      target->string_mb);
-				}
-				/*
-				 * Make sure a failing command is not
-				 * saved in .make.state.
-				 */
-				line->body.line.command_used = NULL;
-			}
-			if (temp_file_name != NULL) {
-				free_name(temp_file_name);
-			}
-			temp_file_name = NULL;
-			Property spro = get_prop(sunpro_dependencies->prop, macro_prop);
-			if(spro != NULL) {
-				Name val = spro->body.macro.value;
-				if(val != NULL) {
-					free_name(val);
-					spro->body.macro.value = NULL;
-				}
-			}
-			spro = get_prop(sunpro_dependencies->prop, env_mem_prop);
-			if(spro) {
-				char *val = spro->body.env_mem.value;
-				if(val != NULL) {
-					retmem_mb(val);
-					spro->body.env_mem.value = NULL;
-				}
-			}
-			return result;
-		} else {
-			parallel_process_cnt++;
-			return build_running;
-		}
-	} else
-#endif
 	{
 		*p = NULL;
 
@@ -403,29 +260,6 @@
 	}
 }
 
-#ifdef DISTRIBUTED
-/*
- *	append_dmake_cmd()
- *
- *	Replaces all escaped newline's (\<cr>)
- *	  in the original command line with space's,
- *	  then append the new command line to the DoJobMsg object.
- */
-static void
-append_dmake_cmd(Avo_DoJobMsg *dmake_job_msg,
-                 char *orig_cmd_line,
-                 int cmd_options)
-{
-/*
-	Avo_DmakeCommand	*tmp_dmake_command;
-
-	tmp_dmake_command = new Avo_DmakeCommand(orig_cmd_line, cmd_options);
-	dmake_job_msg->appendCmd(tmp_dmake_command);
-	delete tmp_dmake_command;
- */
-	dmake_job_msg->appendCmd(new Avo_DmakeCommand(orig_cmd_line, cmd_options));
-}
-#endif
 
 #ifdef TEAMWARE_MAKE_CMN
 #define MAXJOBS_ADJUST_RFE4694000
@@ -795,16 +629,7 @@
 		}
 	}
 #endif /* TEAMWARE_MAKE_CMN && MAXJOBS_ADJUST_RFE4694000 */
-#ifdef DISTRIBUTED
-	if (send_mtool_msgs) {
-		send_job_start_msg(line);
-	}
-#endif
-#ifdef DISTRIBUTED
-	setvar_envvar((Avo_DoJobMsg *)NULL);
-#else
 	setvar_envvar();
-#endif
 	/*
 	 * Tell the user what DMake is doing.
 	 */
@@ -945,17 +770,6 @@
 finish_running(void)
 {
 	while (running_list != NULL) {
-#ifdef DISTRIBUTED
-		if (dmake_mode_type == distributed_mode) {
-			if ((just_did_subtree) ||
-			    (parallel_process_cnt == 0)) {
-				just_did_subtree = false;
-			} else {
-				(void) await_dist(false);
-				finish_children(true);
-			}
-		} else
-#endif
 		{
 			await_parallel(false);
 			finish_children(true);
@@ -1119,9 +933,6 @@
 					doname_subtree(rp->target,
 						       rp->do_get,
 						       rp->implicit);
-#ifdef DISTRIBUTED
-					just_did_subtree = true;
-#endif
 					quiescent = false;
 					delete_running_struct(rp);
 					goto start_loop_3;
@@ -1156,9 +967,6 @@
 			}
 			recursion_level = rp->recursion_level;
 			doname_subtree(rp->target, rp->do_get, rp->implicit);
-#ifdef DISTRIBUTED
-			just_did_subtree = true;
-#endif
 			delete_running_struct(rp);
 		}
 	}
@@ -1430,14 +1238,6 @@
 				}
 			} else {
 				/*
-				 * Send an Avo_MToolJobResultMsg to maketool.
-				 */
-#ifdef DISTRIBUTED
-				if (send_mtool_msgs) {
-					send_job_result_msg(rp);
-				}
-#endif
-				/*
 				 * Check if there were any job output
 				 * from the parallel build.
 				 */
@@ -1745,12 +1545,6 @@
 	} else {
 		rp->automatics = NULL;
 	}
-#ifdef DISTRIBUTED
-	if (dmake_mode_type == distributed_mode) {
-		rp->make_refd = called_make;
-		called_make = false;
-	} else
-#endif
 	{
 		rp->pid = process_running;
 		process_running = -1;
@@ -2109,54 +1903,6 @@
 	}
 }
 
-#ifdef DISTRIBUTED
-/*
- * Create and send an Avo_MToolJobResultMsg.
- */
-static void
-send_job_result_msg(Running rp)
-{
-	Avo_MToolJobResultMsg	*msg;
-	RWCollectable		*xdr_msg;
-
-	msg = new Avo_MToolJobResultMsg();
-	msg->setResult(rp->job_msg_id,
-	               (rp->state == build_ok) ? 0 : 1,
-	               DONE);
-	append_job_result_msg(msg,
-				rp->stdout_file,
-				rp->stderr_file);
-
-	xdr_msg = (RWCollectable *)msg;
-	xdr(get_xdrs_ptr(), xdr_msg);
-	(void) fflush(get_mtool_msgs_fp());
-
-	delete msg;
-}
-
-/*
- * Append the stdout/err to Avo_MToolJobResultMsg.
- */
-static void
-append_job_result_msg(Avo_MToolJobResultMsg *msg, char *outFn, char *errFn)
-{
-	FILE		*fp;
-	char		line[MAXPATHLEN];
-
-	fp = fopen(outFn, "r");
-	if (fp == NULL) {
-		/* Hmmm... what should we do here? */
-		return;
-	}
-	while (fgets(line, MAXPATHLEN, fp) != NULL) {
-		if (line[strlen(line) - 1] == '\n') {
-			line[strlen(line) - 1] = '\0';
-		}
-		msg->appendOutput(AVO_STRDUP(line));
-	}
-	(void) fclose(fp);
-}
-#endif
 
 static void
 delete_running_struct(Running rp)
--- old/usr/src/cmd/make/bin/read.cc	2015-05-20 11:55:57.426187553 -0400
+++ new/usr/src/cmd/make/bin/read.cc	2015-05-20 11:55:57.438634962 -0400
@@ -210,11 +210,7 @@
 			    (doname(makefile_name, true, false) == build_failed)) {
 				if (complain) {
 					(void) fprintf(stderr,
-#ifdef DISTRIBUTED
-						       catgets(catd, 1, 67, "dmake: Couldn't dmake `%s'\n"),
-#else
 						       catgets(catd, 1, 237, "make: Couldn't make `%s'\n"),
-#endif
 						       makefile_name->string_mb);
 				}
 				max_include_depth--;
--- old/usr/src/cmd/make/bin/read2.cc	2015-05-20 11:55:58.005507546 -0400
+++ new/usr/src/cmd/make/bin/read2.cc	2015-05-20 11:55:58.019825141 -0400
@@ -1871,22 +1871,14 @@
 	}
 
 	(void) fflush(stdout);
-#ifdef DISTRIBUTED
-	(void) fprintf(stderr, catgets(catd, 1, 113, "dmake: Fatal error in reader: "));
-#else
 	(void) fprintf(stderr, catgets(catd, 1, 238, "make: Fatal error in reader: "));
-#endif
 	(void) vfprintf(stderr, pattern, args);
 	(void) fprintf(stderr, "\n");
 	va_end(args);
 
 	if (temp_file_name != NULL) {
 		(void) fprintf(stderr,
-#ifdef DISTRIBUTED
-			       catgets(catd, 1, 114, "dmake: Temp-file %s not removed\n"),
-#else
 			       catgets(catd, 1, 239, "make: Temp-file %s not removed\n"),
-#endif
 			       temp_file_name->string_mb);
 		temp_file_name = NULL;
 	}
--- old/usr/src/cmd/make/include/avo/intl.h	2015-05-20 11:55:59.040522384 -0400
+++ new/usr/src/cmd/make/include/avo/intl.h	2015-05-20 11:55:59.052763628 -0400
@@ -45,12 +45,6 @@
 /*
  * Define the various text domains
  */
-#define	AVO_DOMAIN_CODEMGR	"codemgr"
-#define AVO_DOMAIN_VERTOOL	"vertool"
-#define AVO_DOMAIN_FILEMERGE	"filemerge"
 #define AVO_DOMAIN_DMAKE	"dmake"
-#define AVO_DOMAIN_PMAKE	"pmake"
-#define AVO_DOMAIN_FREEZEPOINT	"freezept"
-#define AVO_DOMAIN_MAKETOOL	"maketool"
 
 #endif
--- old/usr/src/cmd/make/include/mk/defs.h	2015-05-20 11:55:59.445214643 -0400
+++ new/usr/src/cmd/make/include/mk/defs.h	2015-05-20 11:55:59.456996495 -0400
@@ -28,17 +28,9 @@
 /*
  * Included files
  */
-#ifdef DISTRIBUTED
-#	include <dm/Avo_AcknowledgeMsg.h>
-#	include <dm/Avo_DoJobMsg.h>
-#	include <dm/Avo_JobResultMsg.h>
-#endif
 
 #include <mksh/defs.h>
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-#	include <rw/xdrstrea.h>
-#endif
 
 
 /*
@@ -198,14 +190,8 @@
 extern	Boolean		all_parallel;
 extern	Boolean		assign_done;
 extern	Boolean		build_failed_seen;
-#ifdef DISTRIBUTED
-extern	Boolean		building_serial;
-#endif
 extern	Name		built_last_make_run;
 extern	Name		c_at;
-#ifdef DISTRIBUTED
-extern	Boolean		called_make;
-#endif
 extern	Boolean		command_changed;
 extern	Boolean		commands_done;
 extern	Chain		conditional_targets;
@@ -335,9 +321,6 @@
 extern	void		add_serial(Name target, int recursion_level, Boolean do_get, Boolean implicit);
 extern	void		add_subtree(Name target, int recursion_level, Boolean do_get, Boolean implicit);
 extern  void 		append_or_replace_macro_in_dyn_array(ASCII_Dyn_Array *Ar, char *macro);
-#ifdef DISTRIBUTED
-extern	Doname		await_dist(Boolean waitflg);
-#endif
 #ifdef TEAMWARE_MAKE_CMN
 extern	void		await_parallel(Boolean waitflg);
 #endif
@@ -348,12 +331,6 @@
 extern	void		construct_target_string();
 extern	void		create_xdrs_ptr(void);
 extern	void		depvar_add_to_list (Name name, Boolean cmdline);
-#ifdef DISTRIBUTED
-extern	void		distribute_rxm(Avo_DoJobMsg *dmake_job_msg);
-extern	int 		getRxmMessage(void);
-extern	Avo_JobResultMsg* getJobResultMsg(void);
-extern	Avo_AcknowledgeMsg* getAcknowledgeMsg(void);
-#endif
 extern	Doname		doname(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic = false);
 extern	Doname		doname_check(register Name target, register Boolean do_get, register Boolean implicit, register Boolean automatic);
 extern	Doname		doname_parallel(Name target, Boolean do_get, Boolean implicit);
@@ -386,17 +363,6 @@
 extern	char		*get_current_path(void);
 extern	int		get_job_msg_id(void);
 extern	FILE		*get_mtool_msgs_fp(void);
-#ifdef DISTRIBUTED
-extern	Boolean		get_dmake_group_specified(void);
-extern	Boolean		get_dmake_max_jobs_specified(void);
-extern	Boolean		get_dmake_mode_specified(void);
-extern	Boolean		get_dmake_odir_specified(void);
-extern	Boolean		get_dmake_rcfile_specified(void);
-extern	Boolean		get_pmake_machinesfile_specified(void);
-#endif
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-extern	XDR		*get_xdrs_ptr(void);
-#endif
 extern	wchar_t		*getmem_wc(register int size);
 /* On linux getwd(char *) is defined in 'unistd.h' */
 #ifdef __cplusplus
@@ -427,11 +393,7 @@
 extern	void		reset_locals(register Name target, register Property old_locals, register Property conditional, register int index);
 extern	void		set_locals(register Name target, register Property old_locals);
 extern	void		setvar_append(register Name name, register Name value);
-#ifdef DISTRIBUTED
-extern	void		setvar_envvar(Avo_DoJobMsg *dmake_job_msg);
-#else
 extern	void		setvar_envvar(void);
-#endif
 extern	void		special_reader(Name target, register Name_vector depes, Cmd_line command);
 extern	void		startup_rxm();
 extern	Doname		target_can_be_built(register Name target);
--- old/usr/src/cmd/make/include/mksh/dosys.h	2015-05-20 11:55:59.875224909 -0400
+++ new/usr/src/cmd/make/include/mksh/dosys.h	2015-05-20 11:55:59.887032648 -0400
@@ -26,16 +26,9 @@
  */
 
 #include <mksh/defs.h>
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-#	include <rw/xdrstrea.h>
-#endif
 #include <vroot/vroot.h>
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-extern Boolean	await(register Boolean ignore_error, register Boolean silent_error, Name target, wchar_t *command, pid_t running_pid, Boolean send_mtool_msgs, XDR *xdrs, int job_msg_id);
-#else
 extern Boolean	await(register Boolean ignore_error, register Boolean silent_error, Name target, wchar_t *command, pid_t running_pid, Boolean send_mtool_msgs, void *xdrs, int job_msg_id);
-#endif
 extern int	doexec(register wchar_t *command, register Boolean ignore_error, Boolean redirect_out_err, char *stdout_file, char *stderr_file, pathpt vroot_path, int nice_prio);
 extern int	doshell(wchar_t *command, register Boolean ignore_error, Boolean redirect_out_err, char *stdout_file, char *stderr_file, int nice_prio);
 extern Doname	dosys_mksh(register Name command, register Boolean ignore_error, register Boolean call_make, Boolean silent_error, Boolean always_exec, Name target, Boolean redirect_out_err, char *stdout_file, char *stderr_file, pathpt vroot_path, int nice_prio);
--- old/usr/src/cmd/make/include/mksh/mksh.h	2015-05-20 11:56:00.279816386 -0400
+++ new/usr/src/cmd/make/include/mksh/mksh.h	2015-05-20 11:56:00.291861013 -0400
@@ -29,17 +29,9 @@
 /*
  * Included files
  */
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-#	include <dm/Avo_DmakeCommand.h>
-#endif
 
 #include <mksh/defs.h>
 #include <unistd.h>
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-
-extern int	do_job(Avo_DmakeCommand *cmd_list[], char *env_list[], char *stdout_file, char *stderr_file, char *cwd, char *cnwd, int ignore, int silent, pathpt vroot_path, char *shell, int nice_prio);
-
-#endif /* TEAMWARE_MAKE_CMN */
 
 #endif
--- old/usr/src/cmd/make/lib/mksh/dosys.cc	2015-05-20 11:56:00.679802270 -0400
+++ new/usr/src/cmd/make/lib/mksh/dosys.cc	2015-05-20 11:56:00.691846661 -0400
@@ -36,13 +36,6 @@
 #include <sys/wait.h>			/* WIFEXITED(status) */
 #include <alloca.h>		/* alloca() */
 
-#if defined(TEAMWARE_MAKE_CMN) || defined(MAKETOOL) /* tolik */
-#if defined(DISTRIBUTED)
-#	include <dm/Avo_CmdOutput.h>
-#	include <rw/xdrstrea.h>
-#endif
-#endif
-
 #include <stdio.h>		/* errno */
 #include <errno.h>		/* errno */
 #include <fcntl.h>		/* open() */
@@ -61,14 +54,7 @@
 /*
  * Defined macros
  */
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-#define SEND_MTOOL_MSG(cmds) \
-	if (send_mtool_msgs) { \
-		cmds \
-	}
-#else
 #define SEND_MTOOL_MSG(cmds)
-#endif
 
 /*
  * typedefs & structs
@@ -572,29 +558,18 @@
  *	Global variables used:
  *		filter_stderr	Set if -X is on
  */
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-Boolean
-await(register Boolean ignore_error, register Boolean silent_error, Name target, wchar_t *command, pid_t running_pid, Boolean send_mtool_msgs, XDR *xdrs_p, int job_msg_id)
-#else
 Boolean
 await(register Boolean ignore_error, register Boolean silent_error, Name target, wchar_t *command, pid_t running_pid, Boolean send_mtool_msgs, void *xdrs_p, int job_msg_id)
-#endif
 {
         int                     status;
 	char			*buffer;
 	int			core_dumped;
 	int			exit_status;
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-	Avo_CmdOutput		*make_output_msg;
-#endif
 	FILE			*outfp;
 	register pid_t		pid;
 	struct stat		stat_buff;
 	int			termination_signal;
 	char			tmp_buf[MAXPATHLEN];
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-	RWCollectable		*xdr_msg;
-#endif
 
 	while ((pid = wait(&status)) != running_pid) {
 		if (pid == -1) {
--- old/usr/src/cmd/make/lib/mksh/macro.cc	2015-05-20 11:56:01.133774862 -0400
+++ new/usr/src/cmd/make/lib/mksh/macro.cc	2015-05-20 11:56:01.145897456 -0400
@@ -1224,11 +1224,7 @@
 	if (macro->body.macro.exported) {
 		static char	*env;
 
-#ifdef DISTRIBUTED
-		if (!reading_environment && (value != NULL)) {
-#else
 		if (!reading_environment && (value != NULL) && value->dollar) {
-#endif
 			Envvar	p;
 
 			for (p = envvar; p != NULL; p = p->next) {
@@ -1246,12 +1242,7 @@
 			p->already_put = false;
 			envvar = p;
 found_it:;
-#ifdef DISTRIBUTED
-		}
-		if (reading_environment || (value == NULL) || !value->dollar) {
-#else
 		} else {
-#endif
 			length = 2 + strlen(name->string_mb);
 			if (value != NULL) {
 				length += strlen(value->string_mb);
--- old/usr/src/cmd/make/lib/mksh/mksh.cc	2015-05-20 11:56:01.638308800 -0400
+++ new/usr/src/cmd/make/lib/mksh/mksh.cc	2015-05-20 11:56:01.650306304 -0400
@@ -64,149 +64,6 @@
 static void	init_mksh_globals(char *shell);
 static void	set_env_vars(char *env_list[]);
 
-#if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
-/*
- *	Execute the command(s) of one Make or DMake rule
- */
-int
-do_job(Avo_DmakeCommand *cmd_list[], char *env_list[], char *stdout_file, char *stderr_file, char *cwd, char *cnwd, int ignore, int silent, pathpt vroot_path, char *shell, int nice_prio)
-{
-	Boolean			always_exec_flag;
-	char			*cmd;
-	Avo_DmakeCommand	**cmd_list_p;
-	Name			command;
-	Boolean			do_not_exec_flag;
-	Boolean			ignore_flag;
-	int			length;
-	Boolean			make_refd_flag;
-	Boolean			meta_flag;
-	char			pathname[MAXPATHLEN];
-	Doname			result;
-	Boolean			silent_flag;
-	wchar_t			*tmp_wcs_buffer;
-
-	if ((childPid = fork()) < 0) {	/* error */
-		;
-	} else if (childPid > 0) {		/* parent */
-		;
-	} else {			/* child, mksh */
-		(void) sigset(SIGCHLD, SIG_DFL);
-		enable_interrupt(handle_interrupt_mksh);
-		/* set environment variables */
-		set_env_vars(env_list);
-		/* redirect stdout and stderr to temp files */
-		dup2(1, 2);	// Because fatal_mksh() prints error messages into
-				// stderr but dmake uses stderr for XDR communications
-				// and stdout for errors messages.
-		redirect_io(stdout_file, stderr_file);
-		/* try cd'ing to cwd */
-		if (my_chdir(cwd) != 0) {
-			/* try the netpath machine:pathname */
-			if (!avo_netpath_to_path(cnwd, pathname)) {
-				fatal_mksh(catgets(libmksdmsi18n_catd, 1, 137, "`cd %s' failed, and conversion of %s to automounter pathname also failed: %s"), cwd, cnwd, strerror(errno));
-			} else if (my_chdir(pathname) != 0) {
-				fatal_mksh(catgets(libmksdmsi18n_catd, 1, 138, "`cd %s' and `cd %s' both failed: %s"), cwd, pathname, strerror(errno));
-			}
-			/*
-			 * change the value of SUNPRO_DEPENDENCIES
-			 * to the new path.
-			 */
-			change_sunpro_dependencies_value(cwd, pathname);
-		}
-		init_mksh_globals(shell);
-		for (cmd_list_p = cmd_list;
-		     *cmd_list_p != (Avo_DmakeCommand *) NULL;
-		     cmd_list_p++) {
-			if ((*cmd_list_p)->ignore()) {
-				ignore_flag = true;
-			} else {
-				ignore_flag = false;
-			}
-			if ((*cmd_list_p)->silent()) {
-				silent_flag = true;
-			} else {
-				silent_flag = false;
-			}
-/*
-			if ((*cmd_list_p)->always_exec()) {
-				always_exec_flag = true;
-			} else {
-				always_exec_flag = false;
-			}
- */
-			always_exec_flag = false;
-			if ((*cmd_list_p)->meta()) {
-				meta_flag = true;
-			} else {
-				meta_flag = false;
-			}
-			if ((*cmd_list_p)->make_refd()) {
-				make_refd_flag = true;
-			} else {
-				make_refd_flag = false;
-			}
-			if ((*cmd_list_p)->do_not_exec()) {
-				do_not_exec_flag = true;
-			} else {
-				do_not_exec_flag = false;
-			}
-			do_not_exec_rule = do_not_exec_flag;
-			cmd = (*cmd_list_p)->getCmd();
-			if ((length = strlen(cmd)) >= MAXPATHLEN) {
-				tmp_wcs_buffer = ALLOC_WC(length + 1);
-				(void) mbstowcs(tmp_wcs_buffer, cmd, length + 1);
-				command = GETNAME(tmp_wcs_buffer, FIND_LENGTH);
-				retmem(tmp_wcs_buffer);
-			} else {
-				MBSTOWCS(wcs_buffer, cmd);
-				command = GETNAME(wcs_buffer, FIND_LENGTH);
-			}
-			if ((command->hash.length > 0) &&
-			    (!silent_flag || do_not_exec_flag)) {
-				(void) printf("%s\n", command->string_mb);
-			}
-			result = dosys_mksh(command,
-					    ignore_flag,
-					    make_refd_flag,
-					    false, /* bugs #4085164 & #4990057 */
-					    /* BOOLEAN(silent_flag && ignore_flag), */
-					    always_exec_flag,
-					    (Name) NULL,
-					    false,
-					    NULL,
-					    NULL,
-					    vroot_path,
-					    nice_prio);
-			if (result == build_failed) {
-
-#ifdef PRINT_EXIT_STATUS
-				warning_mksh(NOCATGETS("I'm in do_job(), and dosys_mksh() returned result of build_failed."));
-#endif
-
-				if (silent_flag) {
-					(void) printf(catgets(libmksdmsi18n_catd, 1, 139, "The following command caused the error:\n%s\n"),
-						      command->string_mb);
-				}
-				if (!ignore_flag && !ignore) {
-
-#ifdef PRINT_EXIT_STATUS
-					warning_mksh(NOCATGETS("I'm in do_job(), and dosys_mksh() returned result of build_failed, exiting 1."));
-#endif
-
-					exit(1);
-				}
-			}
-		}
-
-#ifdef PRINT_EXIT_STATUS
-		warning_mksh(NOCATGETS("I'm in do_job(), exiting 0."));
-#endif
-
-	        exit(0);
-	}
-        return childPid;
-}
-#endif /* TEAMWARE_MAKE_CMN */
 
 static void
 set_env_vars(char *env_list[])
