Subject: toolchain/17313: fails with bash and symbolic links
To: None <>
From: Ian Dall <>
List: netbsd-bugs
Date: 06/19/2002 16:25:05
>Number:         17313
>Category:       toolchain
>Synopsis: fails with bash and symbolic links
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 19 00:05:00 PDT 2002
>Originator:     Ian Dall
>Release:        NetBSD 1.5ZC
System: Linux 2.4.7-10custom #3 Sun Nov 4 21:08:55 CST 2001 i686 unknown
Architecture: unknown
Machine: i686
>Description: sets MAKEOBJDIR to "\${.CURDIR:C,^$cwd,$OPTARG,}". So make tests
if ${.CURDIR} starts with $cwd. When /bin/sh is bash (as on linux) the built
in pwd returns PWD, if set and pointing to the current working directory.
The path in PWD need not be the cannonical path and may include symbolic links.
This causes the test to fail and for the object directories to not be made.
create a symbolic link eg

  ln -s /foo .../netbsd
  cd /foo/src
  bash ./ -O <object dirs>


Index: netbsd/src/
diff -c netbsd/src/ netbsd/src/
*** netbsd/src/	Wed Jun 12 11:46:22 2002
--- netbsd/src/	Wed Jun 19 00:48:51 2002
*** 16,21 ****
--- 16,23 ----
  [ -d usr.bin/make ] || bomb " must be run from the top source level"
  [ -f share/mk/ ] || bomb "src/share/mk is missing; please re-fetch the source tree"
+ # Eliminate confusion if PWD has symbolic links in the path.
+ unset PWD
  getarch () {