public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Have split-include take another argument
@ 2002-11-11 17:06 Tom Rini
  2002-11-11 23:37 ` Peter Samuelson
  2002-11-14 21:01 ` Kai Germaschewski
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Rini @ 2002-11-11 17:06 UTC (permalink / raw)
  To: kbuild-devel, linux-kernel; +Cc: Kai Germaschewski

Hello.  The following patch makes split-include take another argument,
which is the prefix of what is being split up.  This is needed since I'm
working on a system which will allow for various params in the kernel to
be tweaked at compile-time, without offering numerous CONFIG options
(see http://marc.theaimsgroup.com/?l=linux-kernel&m=103669658505842&w=2).
I'm sending this out for two reasons.  First, does anyone see any
problems with the patch itself?  Second, Kai, would you be willing to
apply this patch now, or would should I wait until the system is ready?

-- 
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

===== Makefile 1.320 vs edited =====
--- 1.320/Makefile	Mon Nov 11 08:08:41 2002
+++ edited/Makefile	Mon Nov 11 09:30:45 2002
@@ -413,7 +413,7 @@
 
 include/config/MARKER: scripts/split-include include/linux/autoconf.h
 	@echo '  SPLIT  include/linux/autoconf.h -> include/config/*'
-	@scripts/split-include include/linux/autoconf.h include/config
+	@scripts/split-include include/linux/autoconf.h include/config CONFIG_
 	@touch $@
 
 # 	if .config is newer than include/linux/autoconf.h, someone tinkered
===== scripts/split-include.c 1.3 vs edited =====
--- 1.3/scripts/split-include.c	Sun Jun  2 18:34:13 2002
+++ edited/scripts/split-include.c	Mon Nov 11 09:29:55 2002
@@ -46,6 +46,7 @@
     const char * str_my_name;
     const char * str_file_autoconf;
     const char * str_dir_config;
+    const char * str_split_token;
 
     FILE * fp_config;
     FILE * fp_target;
@@ -61,7 +62,7 @@
     struct stat stat_buf;
 
     /* Check arg count. */
-    if (argc != 3)
+    if (argc != 4)
     {
 	fprintf(stderr, "%s: wrong number of arguments.\n", argv[0]);
 	exit(1);
@@ -70,6 +71,7 @@
     str_my_name       = argv[0];
     str_file_autoconf = argv[1];
     str_dir_config    = argv[2];
+    str_split_token   = argv[3];
 
     /* Find a buffer size. */
     if (stat(str_file_autoconf, &stat_buf) != 0)
@@ -110,11 +112,11 @@
 
 	if (line[0] != '#')
 	    continue;
-	if ((str_config = strstr(line, "CONFIG_")) == NULL)
+	if ((str_config = strstr(line, str_split_token)) == NULL)
 	    continue;
 
 	/* Make the output file name. */
-	str_config += sizeof("CONFIG_") - 1;
+	str_config += strlen(str_split_token);
 	for (itarget = 0; !isspace(str_config[itarget]); itarget++)
 	{
 	    int c = (unsigned char) str_config[itarget];

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

end of thread, other threads:[~2002-11-14 23:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-11 17:06 [PATCH] Have split-include take another argument Tom Rini
2002-11-11 23:37 ` Peter Samuelson
2002-11-12 15:09   ` Tom Rini
2002-11-14 21:01 ` Kai Germaschewski
2002-11-14 23:17   ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox