summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1998-10-18 00:51:46 +0000
committerobrien <obrien@FreeBSD.org>1998-10-18 00:51:46 +0000
commit0c8a74dcaf35c7675c0900c6929c5cff4e470000 (patch)
treee4f65cc34c5bf1b50e2bcbd287bc12cd83325b59 /usr.bin/make
parent763d39061e90c895bd6f8760fb95c1307e8379e4 (diff)
downloadFreeBSD-src-0c8a74dcaf35c7675c0900c6929c5cff4e470000.zip
FreeBSD-src-0c8a74dcaf35c7675c0900c6929c5cff4e470000.tar.gz
Only process the ``PWD'' environmental var if built with "WANT_ENV_PWD"
defined. Bash v2 sets PWD and it creates major problems for those of us with /usr/src being a symlink. See the lists for examples of the problems.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/main.c14
-rw-r--r--usr.bin/make/make.15
2 files changed, 14 insertions, 5 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 63dbe1a..2df59ec 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -47,7 +47,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#endif
static const char rcsid[] =
- "$Id: main.c,v 1.25 1998/07/26 17:06:05 imp Exp $";
+ "$Id: main.c,v 1.26 1998/09/09 14:58:30 kato Exp $";
#endif /* not lint */
/*-
@@ -434,8 +434,12 @@ main(argc, argv)
{
Lst targs; /* target nodes to create -- passed to Make_Init */
Boolean outOfDate = TRUE; /* FALSE if all targets up to date */
- struct stat sb, sa;
- char *p, *p1, *path, *pathp, *pwd;
+ struct stat sa;
+ char *p, *p1, *path, *pathp;
+#ifdef WANT_ENV_PWD
+ struct stat sb;
+ char *pwd;
+#endif
char mdpath[MAXPATHLEN + 1];
char obpath[MAXPATHLEN + 1];
char cdpath[MAXPATHLEN + 1];
@@ -470,11 +474,13 @@ main(argc, argv)
if (stat(curdir, &sa) == -1)
err(2, "%s", curdir);
+#ifdef WANT_ENV_PWD
if ((pwd = getenv("PWD")) != NULL) {
if (stat(pwd, &sb) == 0 && sa.st_ino == sb.st_ino &&
sa.st_dev == sb.st_dev)
(void) strcpy(curdir, pwd);
}
+#endif
#if defined(__i386__)
/*
@@ -558,7 +564,9 @@ main(argc, argv)
objdir = curdir;
}
+#ifdef WANT_ENV_PWD
setenv("PWD", objdir, 1);
+#endif
create = Lst_Init(FALSE);
makefiles = Lst_Init(FALSE);
diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1
index 89a1e3f..9a15daa 100644
--- a/usr.bin/make/make.1
+++ b/usr.bin/make/make.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
-.\" $Id: make.1,v 1.11 1997/07/24 06:58:07 charnier Exp $
+.\" $Id: make.1,v 1.12 1998/05/25 03:28:37 steve Exp $
.\"
.Dd March 19, 1994
.Dt MAKE 1
@@ -428,7 +428,8 @@ entered into the environment for all programs which
.Nm make
executes.
.It Ev PWD
-Alternate path to the current directory.
+Alternate path to the current directory. Supported if built with WANT_ENV_PWD
+defined.
.Nm make
normally sets
.Ql Va .CURDIR
OpenPOWER on IntegriCloud