From owner-svn-src-projects@FreeBSD.ORG Sun Mar 8 16:30:00 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 013C4106564A; Sun, 8 Mar 2009 16:30:00 +0000 (UTC) (envelope-from jb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3B038FC17; Sun, 8 Mar 2009 16:29:59 +0000 (UTC) (envelope-from jb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n28GTxoN087776; Sun, 8 Mar 2009 16:29:59 GMT (envelope-from jb@svn.freebsd.org) Received: (from jb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n28GTxBH087773; Sun, 8 Mar 2009 16:29:59 GMT (envelope-from jb@svn.freebsd.org) Message-Id: <200903081629.n28GTxBH087773@svn.freebsd.org> From: John Birrell Date: Sun, 8 Mar 2009 16:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189537 - projects/jbuild/usr.sbin/config X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2009 16:30:00 -0000 Author: jb Date: Sun Mar 8 16:29:59 2009 New Revision: 189537 URL: http://svn.freebsd.org/changeset/base/189537 Log: Apply the jbuild patches to support Buildfiles in the kernel config Modified: projects/jbuild/usr.sbin/config/config.h projects/jbuild/usr.sbin/config/main.c projects/jbuild/usr.sbin/config/mkmakefile.c Modified: projects/jbuild/usr.sbin/config/config.h ============================================================================== --- projects/jbuild/usr.sbin/config/config.h Sun Mar 8 16:19:29 2009 (r189536) +++ projects/jbuild/usr.sbin/config/config.h Sun Mar 8 16:29:59 2009 (r189537) @@ -190,12 +190,14 @@ extern STAILQ_HEAD(files_name_head, file extern int profiling; extern int debugging; +extern int f_build; extern int found_defaults; extern int maxusers; extern char *PREFIX; /* Config file name - for error messages */ extern char srcdir[]; /* root of the kernel source tree */ +extern char bldfile[]; /* Target buildfile name. */ #define eq(a,b) (!strcmp(a,b)) #define ns(s) strdup(s) Modified: projects/jbuild/usr.sbin/config/main.c ============================================================================== --- projects/jbuild/usr.sbin/config/main.c Sun Mar 8 16:19:29 2009 (r189536) +++ projects/jbuild/usr.sbin/config/main.c Sun Mar 8 16:29:59 2009 (r189537) @@ -77,8 +77,10 @@ static const char rcsid[] = char * PREFIX; char destdir[MAXPATHLEN]; char srcdir[MAXPATHLEN]; +char bldfile[MAXPATHLEN]; int debugging; +int f_build = 0; int profiling; int found_defaults; int incignore; @@ -120,6 +122,10 @@ main(int argc, char **argv) case 'C': filebased = 1; break; + case 'b': + f_build = 1; + strncpy(bldfile, optarg, sizeof(bldfile)); + break; case 'd': if (*destdir == '\0') strlcpy(destdir, optarg, sizeof(destdir)); @@ -242,8 +248,10 @@ main(int argc, char **argv) makehints(); /* build hints.c */ headers(); /* make a lot of .h files */ cleanheaders(p); - printf("Kernel build directory is %s\n", p); - printf("Don't forget to do ``make cleandepend && make depend''\n"); + if (!f_build) { + printf("Kernel build directory is %s\n", p); + printf("Don't forget to do ``make cleandepend && make depend''\n"); + } exit(0); } Modified: projects/jbuild/usr.sbin/config/mkmakefile.c ============================================================================== --- projects/jbuild/usr.sbin/config/mkmakefile.c Sun Mar 8 16:19:29 2009 (r189536) +++ projects/jbuild/usr.sbin/config/mkmakefile.c Sun Mar 8 16:29:59 2009 (r189537) @@ -118,7 +118,10 @@ makefile(void) int versreq; read_files(); - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); + if (f_build) + snprintf(line, sizeof(line), "../../conf/Buildfile.%s", machinename); + else + snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); ifp = fopen(line, "r"); if (ifp == 0) { snprintf(line, sizeof(line), "Makefile.%s", machinename); @@ -181,7 +184,10 @@ makefile(void) } (void) fclose(ifp); (void) fclose(ofp); - moveifchanged(path("Makefile.new"), path("Makefile")); + if (f_build) + moveifchanged(path("Makefile.new"), path(bldfile)); + else + moveifchanged(path("Makefile.new"), path("Makefile")); } /* @@ -546,10 +552,17 @@ read_files(void) char fname[MAXPATHLEN]; struct files_name *nl, *tnl; - (void) snprintf(fname, sizeof(fname), "../../conf/files"); + if (f_build) + (void) snprintf(fname, sizeof(fname), "../../conf/files.bld"); + else + (void) snprintf(fname, sizeof(fname), "../../conf/files"); read_file(fname); - (void) snprintf(fname, sizeof(fname), - "../../conf/files.%s", machinename); + if (f_build) + (void) snprintf(fname, sizeof(fname), + "../../conf/files.%s.bld", machinename); + else + (void) snprintf(fname, sizeof(fname), + "../../conf/files.%s", machinename); read_file(fname); for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { read_file(nl->f_name);