svn commit: r189537 - projects/jbuild/usr.sbin/config
John Birrell
jb at FreeBSD.org
Sun Mar 8 09:30:00 PDT 2009
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);
More information about the svn-src-projects
mailing list