linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.4.2-pre1 mkdep and symlinked $TOPDIR
@ 2001-03-04  5:24 Andrew Morton
  2001-03-05  0:21 ` Keith Owens
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2001-03-04  5:24 UTC (permalink / raw)
  To: Keith Owens; +Cc: lkml

Keith,

I do builds in /usr/src/linux, which is a symlink
to /usr/src/linux-akpm.  The recent `mkdep' changes
have broken this practice most horridly.  When searching
.hdepend, `make' doesn't recognise that nested headers
have changed. This is because .hdepend has things like

/usr/src/linux/include/asm/byteorder.h: \
   /usr/src/linux-akpm/include/asm/types.h \

So when it looks for dependencies for
	/usr/src/linux-akpm/include/asm/byteorder.h

it doesn't find anything.  In earlier kernels, the
whole toolchain honoured the symlink form of the name.

The net effect of all this is that changes to included
headers are *not* causing recompiles, and use of a
symlinked $TOPDIR is not feasible.

The workaround at this time is to do a `cd' to the
real $TOPDIR directory before starting development, 
rather than a `cd' to the symlink.

If it is your intention that everything in the
build system use the "real" pathname then I suggest
we need to make it happen consistently.  Or can we
restore the old behaviour?



--- linux-2.4.3-pre1/scripts/mkdep.c	Sat Mar  3 20:52:24 2001
+++ linux-akpm/scripts/mkdep.c	Sun Mar  4 16:16:00 2001
@@ -218,19 +218,12 @@
 void add_path(const char * name)
 {
 	struct path_struct *path;
-	char resolved_path[PATH_MAX+1];
 	const char *name2;
 
-	if (strcmp(name, ".")) {
-		name2 = realpath(name, resolved_path);
-		if (!name2) {
-			fprintf(stderr, "realpath(%s) failed, %m\n", name);
-			exit(1);
-		}
-	}
-	else {
+	if (strcmp(name, "."))
+		name2 = name;
+	else
 		name2 = "";
-	}
 
 	path_array = realloc(path_array, (++paths)*sizeof(*path_array));
 	if (!path_array) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 2.4.2-pre1 mkdep and symlinked $TOPDIR
  2001-03-04  5:24 2.4.2-pre1 mkdep and symlinked $TOPDIR Andrew Morton
@ 2001-03-05  0:21 ` Keith Owens
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Owens @ 2001-03-05  0:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml

On Sun, 04 Mar 2001 16:24:57 +1100, 
Andrew Morton <andrewm@uow.edu.au> wrote:
>I do builds in /usr/src/linux, which is a symlink
>to /usr/src/linux-akpm.  The recent `mkdep' changes
>have broken this practice most horridly.  When searching
>.hdepend, `make' doesn't recognise that nested headers
>have changed. This is because .hdepend has things like
>
>/usr/src/linux/include/asm/byteorder.h: \
>   /usr/src/linux-akpm/include/asm/types.h \

I do not see this problem in 2.4.3-pre2.

# ls -l linux 
lrwxrwxrwx   1 kaos     ocs            10 Mar  5 10:47 linux -> 2.4.3-pre2
# cd linux
# make dep
make dep
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/mkdep scripts/mkdep.c
make[1]: Entering directory `/usr/src/2.4.3-pre2/arch/i386/boot'
make[1]: Nothing to be done for `dep'.
make[1]: Leaving directory `/usr/src/2.4.3-pre2/arch/i386/boot'
scripts/mkdep -- init/*.c > .depend
scripts/mkdep -- `find /usr/src/2.4.3-pre2/include/asm /usr/src/2.4.3-pre2/include/linux /usr/src/2.4.3-pre2/include/scsi /usr/src/2.4.3-pre2/include/net -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend

The find command is given the real pathname, not the symlink so the
.hdepend and .depend files all contain the real paths.  Your problem is
probably this line in the top level Makefile.

TOPDIR	:= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)

TOPDIR must be getting set to the symlink name instead of the real
pathname.  Can you confirm what TOPDIR is being set to and why?  This
may be a shell problem.

TOPDIR	:= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
dummy	:= $(shell echo PWD="$$PWD" pwd=$(shell pwd) TOPDIR=$(TOPDIR) >&2)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-03-05  0:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-04  5:24 2.4.2-pre1 mkdep and symlinked $TOPDIR Andrew Morton
2001-03-05  0:21 ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).