linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* build from RO source tree?
@ 2003-07-02  9:52 david nicol
  2003-07-02 10:05 ` Bernd Petrovitsch
  2003-07-02 14:15 ` Geert Uytterhoeven
  0 siblings, 2 replies; 5+ messages in thread
From: david nicol @ 2003-07-02  9:52 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Is there a make option for building from a read-only kernel source,
possibly by doing a pre-pass to create a mess of symlinks?

Something like

	(chdir $readonly_sourceroot && find . -type d ) \
	| xargs -n5 mkdir
	(chdir $readonly_sourceroot && find . -type f ) \
	| xargs -i ln -s $readonly_sourceroot/{} {}
	make


but as a configure option of some kind.









-- 
David Nicol, independent consultant, contractor, and food service worker


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

* Re: build from RO source tree?
  2003-07-02  9:52 build from RO source tree? david nicol
@ 2003-07-02 10:05 ` Bernd Petrovitsch
  2003-07-02 14:15 ` Geert Uytterhoeven
  1 sibling, 0 replies; 5+ messages in thread
From: Bernd Petrovitsch @ 2003-07-02 10:05 UTC (permalink / raw)
  To: david nicol; +Cc: Linux Kernel Mailing List

On Mit, 2003-07-02 at 11:52, david nicol wrote:
> Is there a make option for building from a read-only kernel source,
> possibly by doing a pre-pass to create a mess of symlinks?
> 
> Something like
> 
> 	(chdir $readonly_sourceroot && find . -type d ) \
> 	| xargs -n5 mkdir
> 	(chdir $readonly_sourceroot && find . -type f ) \
> 	| xargs -i ln -s $readonly_sourceroot/{} {}
> 	make
> 
> 
> but as a configure option of some kind.

man lndir

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
        Embedded Linux Development and Services

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

* Re: build from RO source tree?
  2003-07-02  9:52 build from RO source tree? david nicol
  2003-07-02 10:05 ` Bernd Petrovitsch
@ 2003-07-02 14:15 ` Geert Uytterhoeven
  2003-07-03  0:46   ` david nicol
  1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2003-07-02 14:15 UTC (permalink / raw)
  To: david nicol; +Cc: Linux Kernel Mailing List

On 2 Jul 2003, david nicol wrote:
> Is there a make option for building from a read-only kernel source,
> possibly by doing a pre-pass to create a mess of symlinks?
> 
> Something like
> 
> 	(chdir $readonly_sourceroot && find . -type d ) \
> 	| xargs -n5 mkdir
> 	(chdir $readonly_sourceroot && find . -type f ) \
> 	| xargs -i ln -s $readonly_sourceroot/{} {}
> 	make
> 
> 
> but as a configure option of some kind.

>From geert@linux-m68k.org Wed Jul  2 15:22:08 2003
Date: Fri, 23 May 2003 15:49:45 +0200 (MEST)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: [PATCH] touchless dependencies for 2.4.x

	Hi,

The 2.4.x dependency system depends on being able to `touch' include files in
case of recursive dependencies.  This fails when using a revision control
system (e.g. ClearCase) where non-checked out files are read-only and cannot be
touch'ed.

The patch below solves this by making object files depend on (recursive) lists,
containing the list of dependencies for each header file.

Example:
  - Dependencies:
      o file.c includes header.h
      o header.h includes header2.h

  - Old way:

      o .depend:

	    file.o:	file.c header.h

      o .hdepend:

	    header.h:	header2.h
			touch header.h

  - New way:

      o .depend:

	    file.o:	file.c header.h $(dep_header.h)

      o .hdepend:

	    dep_header.h += header2.h $(dep_header2.h)

Is this OK? So far I didn't notice any regressions.
    
--- linux-2.4.x/scripts/mkdep.c.orig	Tue Apr  1 17:04:24 2003
+++ linux-2.4.x/scripts/mkdep.c	Wed Apr  2 17:39:59 2003
@@ -45,8 +45,7 @@
 
 
 
-char __depname[512] = "\n\t@touch ";
-#define depname (__depname+9)
+char depname[512];
 int hasdep;
 
 struct path_struct {
@@ -75,9 +74,14 @@
 {
 	if (!hasdep) {
 		hasdep = 1;
-		printf("%s:", depname);
-		if (g_filename)
+		if (g_filename) {
+			/* Source file (*.[cS]) */
+			printf("%s:", depname);
 			printf(" %s", g_filename);
+		} else {
+			/* header file (*.h) */
+			printf("dep_%s +=", depname);
+		}
 	}
 }
 
@@ -203,7 +207,8 @@
 		path->buffer[path->len+len] = '\0';
 		if (access(path->buffer, F_OK) == 0) {
 			do_depname();
-			printf(" \\\n   %s", path->buffer);
+			printf(" \\\n   %s $(dep_%s)", path->buffer,
+			       path->buffer);
 			return;
 		}
 	}
@@ -520,7 +525,7 @@
 /*
  * Generate dependencies for one file.
  */
-void do_depend(const char * filename, const char * command)
+void do_depend(const char * filename)
 {
 	int mapsize;
 	int pagesizem1 = getpagesize()-1;
@@ -559,9 +564,7 @@
 	clear_config();
 	state_machine(map, map+st.st_size);
 	if (hasdep) {
-		puts(command);
-		if (*command)
-			define_precious(filename);
+		puts("");
 	}
 
 	munmap(map, mapsize);
@@ -607,7 +610,6 @@
 
 	while (--argc > 0) {
 		const char * filename = *++argv;
-		const char * command  = __depname;
 		g_filename = 0;
 		len = strlen(filename);
 		memcpy(depname, filename, len+1);
@@ -615,10 +617,9 @@
 			if (filename[len-1] == 'c' || filename[len-1] == 'S') {
 			    depname[len-1] = 'o';
 			    g_filename = filename;
-			    command = "";
 			}
 		}
-		do_depend(filename, command);
+		do_depend(filename);
 	}
 	if (len_precious) {
 		*(str_precious+len_precious) = '\0';

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


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

* Re: build from RO source tree?
  2003-07-02 14:15 ` Geert Uytterhoeven
@ 2003-07-03  0:46   ` david nicol
  2003-07-03  8:21     ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: david nicol @ 2003-07-03  0:46 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux Kernel Mailing List

On Wed, 2003-07-02 at 09:15, Geert Uytterhoeven wrote:

> Subject: [PATCH] touchless dependencies for 2.4.x
> 
> 	Hi,
> 
> The 2.4.x dependency system depends on being able to `touch' include files in
> case of recursive dependencies.  This fails when using a revision control
> system (e.g. ClearCase) where non-checked out files are read-only and cannot be
> touch'ed.
> 
> The patch below solves this by making object files depend on (recursive) lists,
> containing the list of dependencies for each header file.

So with this patch applied you can safely build in a lndir against
a RO media. but without it you can't?  



-- 
David Nicol, independent consultant, contractor, and food service worker


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

* Re: build from RO source tree?
  2003-07-03  0:46   ` david nicol
@ 2003-07-03  8:21     ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2003-07-03  8:21 UTC (permalink / raw)
  To: david nicol; +Cc: Linux Kernel Mailing List

On 2 Jul 2003, david nicol wrote:
> On Wed, 2003-07-02 at 09:15, Geert Uytterhoeven wrote:
> > Subject: [PATCH] touchless dependencies for 2.4.x
> > The 2.4.x dependency system depends on being able to `touch' include files in
> > case of recursive dependencies.  This fails when using a revision control
> > system (e.g. ClearCase) where non-checked out files are read-only and cannot be
> > touch'ed.
> > 
> > The patch below solves this by making object files depend on (recursive) lists,
> > containing the list of dependencies for each header file.
> 
> So with this patch applied you can safely build in a lndir against
> a RO media. but without it you can't?  

The current 2.4 build system always touches includes files. If your source tree
is RO, the touches will fail.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


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

end of thread, other threads:[~2003-07-03  8:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-02  9:52 build from RO source tree? david nicol
2003-07-02 10:05 ` Bernd Petrovitsch
2003-07-02 14:15 ` Geert Uytterhoeven
2003-07-03  0:46   ` david nicol
2003-07-03  8:21     ` Geert Uytterhoeven

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).