275 * Sets the DMAKE_* environment variables for rxm and rxs.
276 * DMAKE_PWD
277 * DMAKE_NPWD
278 * DMAKE_UMASK
279 * DMAKE_SHELL
280 */
281 static void
282 set_dmake_env_vars()
283 {
284 char *current_netpath;
285 char *current_path;
286 static char *env;
287 int length;
288 char netpath[MAXPATHLEN];
289 mode_t um;
290 char um_buf[MAXPATHLEN];
291 Name dmake_name;
292 Name dmake_value;
293 Property prop;
294
295 #ifdef REDIRECT_ERR
296 /* Set __DMAKE_REDIRECT_STDERR */
297 length = 2 + strlen(NOCATGETS("__DMAKE_REDIRECT_STDERR")) + 1;
298 env = getmem(length);
299 (void) sprintf(env,
300 "%s=%s",
301 NOCATGETS("__DMAKE_REDIRECT_STDERR"),
302 out_err_same ? NOCATGETS("0") : NOCATGETS("1"));
303 (void) putenv(env);
304 #endif
305
306 /* Set DMAKE_PWD to the current working directory */
307 current_path = get_current_path();
308 length = 2 + strlen(NOCATGETS("DMAKE_PWD")) + strlen(current_path);
309 env = getmem(length);
310 (void) sprintf(env,
311 "%s=%s",
312 NOCATGETS("DMAKE_PWD"),
313 current_path);
314 (void) putenv(env);
315
316 /* Set DMAKE_NPWD to machine:pathname */
317 if (avo_path_to_netpath(current_path, netpath)) {
318 current_netpath = netpath;
319 } else {
320 current_netpath = current_path;
321 }
322 length = 2 + strlen(NOCATGETS("DMAKE_NPWD")) + strlen(current_netpath);
323 env = getmem(length);
324 (void) sprintf(env,
|
275 * Sets the DMAKE_* environment variables for rxm and rxs.
276 * DMAKE_PWD
277 * DMAKE_NPWD
278 * DMAKE_UMASK
279 * DMAKE_SHELL
280 */
281 static void
282 set_dmake_env_vars()
283 {
284 char *current_netpath;
285 char *current_path;
286 static char *env;
287 int length;
288 char netpath[MAXPATHLEN];
289 mode_t um;
290 char um_buf[MAXPATHLEN];
291 Name dmake_name;
292 Name dmake_value;
293 Property prop;
294
295 /* Set __DMAKE_REDIRECT_STDERR */
296 length = 2 + strlen(NOCATGETS("__DMAKE_REDIRECT_STDERR")) + 1;
297 env = getmem(length);
298 (void) sprintf(env,
299 "%s=%s",
300 NOCATGETS("__DMAKE_REDIRECT_STDERR"),
301 out_err_same ? NOCATGETS("0") : NOCATGETS("1"));
302 (void) putenv(env);
303
304 /* Set DMAKE_PWD to the current working directory */
305 current_path = get_current_path();
306 length = 2 + strlen(NOCATGETS("DMAKE_PWD")) + strlen(current_path);
307 env = getmem(length);
308 (void) sprintf(env,
309 "%s=%s",
310 NOCATGETS("DMAKE_PWD"),
311 current_path);
312 (void) putenv(env);
313
314 /* Set DMAKE_NPWD to machine:pathname */
315 if (avo_path_to_netpath(current_path, netpath)) {
316 current_netpath = netpath;
317 } else {
318 current_netpath = current_path;
319 }
320 length = 2 + strlen(NOCATGETS("DMAKE_NPWD")) + strlen(current_netpath);
321 env = getmem(length);
322 (void) sprintf(env,
|