Subject: misc/26072: Request: an option to build.sh, to build kernels without running "config" and "make depend"
To: None <gnats-bugs@gnats.NetBSD.org>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-bugs
Date: 06/26/2004 10:45:04
>Number:         26072
>Category:       misc
>Synopsis:       Request: an option to build.sh, to build kernels without running "config" and "make depend"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 26 15:46:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Frederick Bruckman
>Release:        NetBSD 2.0_BETA
>Organization:
>Environment:
	
	
System: NetBSD seduction.immanent.net 2.0_BETA NetBSD 2.0_BETA (SEDUCTION) #4: Fri Jun 25 22:14:46 CDT 2004 fredb@seduction.immanent.net:/p/i386--netbsd2/obj/usr/src/sys/arch/i386/compile/SEDUCTION i386
Architecture: i386
Machine: i386
>Description:
	
	Impatient kernel hackers would like to be able to build kernels using
	build.sh without running "config" and "make depend". The "make depend"
	part takes an especially long time, and it often happens that you've
	changed one source file in a way that you know that "make depend" isn't
	needed. It is always possible, of course, to build kernels directly in
	the build directory using the correct "nbmake-<MACHINE>", but it's
	inconvenient to type the tediously long path.
>How-To-Repeat:
	
>Fix:
	
	In the patch below, I'm lumping the "config" and "depend" together,
	even though "config" by itself isn't the burden, partly because "-M"
	is already taken. This is most useful when used with "-u". Perhaps it
	should imply "-u"? (It won't work at all with a clean build.)

Index: build.sh
===================================================================
RCS file: /cvsroot/src/build.sh,v
retrieving revision 1.129
diff -u -r1.129 build.sh
--- build.sh	25 Jun 2004 15:03:39 -0000	1.129
+++ build.sh	25 Jun 2004 23:54:25 -0000
@@ -111,6 +111,7 @@
 	runcmd=
 	operations=
 	removedirs=
+	do_config=true
 	do_expertmode=false
 	do_rebuildmake=false
 	do_removedirs=false
@@ -354,7 +355,7 @@
 	fi
 	cat <<_usage_
 
-Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-D dest] [-j njob]
+Usage: ${progname} [-CEnorUux] [-a arch] [-B buildid] [-D dest] [-j njob]
 		[-M obj] [-m mach] [-N noisy] [-O obj] [-R release] [-T tools]
 		[-V var=[value]] [-w wrapper] [-X x11src] [-Z var]
 		operation [...]
@@ -382,6 +383,7 @@
  Options:
     -a arch     Set MACHINE_ARCH to arch.  [Default: deduced from MACHINE]
     -B buildId  Set BUILDID to buildId.
+    -C          Build kernels without running "configure" and "make depend".
     -D dest     Set DESTDIR to dest.  [Default: destdir.MACHINE]
     -E          Set "expert" mode; disables various safety checks.
                 Should not be used without expert knowledge of the build system.
@@ -420,7 +422,7 @@
 
 parseoptions()
 {
-	opts='a:B:bD:dEhi:j:k:M:m:N:nO:oR:rT:tUuV:w:xX:Z:'
+	opts='a:B:bCD:dEhi:j:k:M:m:N:nO:oR:rT:tUuV:w:xX:Z:'
 	opt_a=no
 
 	if type getopts >/dev/null 2>&1; then
@@ -464,6 +466,10 @@
 			usage "'-b' has been replaced by 'makewrapper'"
 			;;
 
+		-C)
+			do_config=false
+			;;
+
 		-D)
 			eval ${optargcmd}; resolvepath
 			setmakeenv DESTDIR "${OPTARG}"
@@ -950,12 +956,17 @@
 		    bomb "Failed to make cleandir in ${kernelbuildpath}"
 		${runcmd} cd "${TOP}"
 	fi
-	${runcmd} "${TOOLDIR}/bin/${toolprefix}config" -b "${kernelbuildpath}" \
-		-s "${TOP}/sys" "${kernelconfpath}" ||
-	    bomb "${toolprefix}config failed for ${kernelconf}"
+	if $do_config; then
+		${runcmd} "${TOOLDIR}/bin/${toolprefix}config" \
+			-b "${kernelbuildpath}" \
+			-s "${TOP}/sys" "${kernelconfpath}" ||
+		    bomb "${toolprefix}config failed for ${kernelconf}"
+	fi
 	${runcmd} cd "${kernelbuildpath}"
-	${runcmd} "${makewrapper}" depend ||
-	    bomb "Failed to make depend in ${kernelbuildpath}"
+	if $do_config; then
+		${runcmd} "${makewrapper}" depend ||
+		    bomb "Failed to make depend in ${kernelbuildpath}"
+	fi
 	${runcmd} "${makewrapper}" ${parallel} all ||
 	    bomb "Failed to make all in ${kernelbuildpath}"
 	${runcmd} cd "${TOP}"

>Release-Note:
>Audit-Trail:
>Unformatted: