Put on my viking helmet from the closet, and get out the war axe and

"retire" some more stuff.
This commit is contained in:
Peter Wemm 1999-05-09 18:54:25 +00:00
parent 818850c6eb
commit 3e624da0af
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46821
7 changed files with 12 additions and 227 deletions

View File

@ -1,11 +1,11 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $Id: Makefile,v 1.22 1999/04/17 14:41:40 peter Exp $
# $Id: Makefile,v 1.23 1999/04/18 13:36:28 peter Exp $
PROG= config
CFLAGS+=-I. -I${.CURDIR}
#CFLAGS+=-Wall -Wunused -Wmissing-prototypes -Wredundant-decls
SRCS= config.y main.c lang.l mkioconf.c mkmakefile.c mkheaders.c \
mkoptions.c mkswapconf.c y.tab.h
mkoptions.c y.tab.h
MAN8= config.8
DPADD= ${LIBL}
LDADD= -ll

View File

@ -51,7 +51,6 @@ struct file_list {
char *f_depends; /* additional dependancies */
char *f_clean; /* File list to add to clean rule */
char *f_needs;
char *f_rootdev;
};
/*
@ -61,11 +60,8 @@ struct file_list {
#define NORMAL 2
#define INVISIBLE 3
#define PROFILING 4
#define SYSTEMSPEC 5
#define SWAPSPEC 6
#define COMPDEVICE 7
#define NODEPEND 8
#define LOCAL 9
#define NODEPEND 5
#define LOCAL 6
#define DEVDONE 0x80000000
#define TYPEMASK 0x7fffffff
@ -164,7 +160,6 @@ int yylex __P((void));
void options __P((void));
void makefile __P((void));
void headers __P((void));
void swapconf __P((void));
extern int seen_scbus;
@ -173,7 +168,7 @@ extern struct device *dtab;
extern char errbuf[80];
extern int yyline;
extern struct file_list *ftab, *conf_list, **confp;
extern struct file_list *ftab;
extern int profiling;
extern int debugging;

View File

@ -107,7 +107,7 @@ static struct device *curp = 0;
struct device *dtab;
char *ident;
int yyline;
struct file_list *ftab, *conf_list, **confp;
struct file_list *ftab;
char errbuf[80];
int maxusers;
int do_trace;
@ -448,20 +448,6 @@ newdev(dp)
}
static struct file_list *
newflist(ftype)
u_char ftype;
{
struct file_list *fl = (struct file_list *)malloc(sizeof (*fl));
memset(fl, 0, sizeof(*fl));
fl->f_type = ftype;
fl->f_next = 0;
fl->f_needs = 0;
fl->f_fn = 0;
return (fl);
}
/*
* find the pointer to connect to the given device and number.
* returns 0 if no such device and prints an error message
@ -593,24 +579,3 @@ check_nexus(dev, num)
}
}
/*
* Check system specification and apply defaulting
* rules on root, argument, dump, and swap devices.
*/
static void
checksystemspec(fl)
register struct file_list *fl;
{
char buf[BUFSIZ];
register struct file_list *swap;
int generic;
if (fl == 0 || fl->f_type != SYSTEMSPEC) {
yyerror("internal error, bad system specification");
exit(1);
}
swap = fl->f_next;
generic = swap && swap->f_type == SWAPSPEC && eq(swap->f_fn, "generic");
}

View File

@ -6,6 +6,6 @@
* The numbering scheme is inspired by the sys/conf/newvers.sh RELDATE
* and <osreldate.h> system.
*
* $Id: configvers.h,v 1.13 1999/04/24 21:38:48 peter Exp $
* $Id: configvers.h,v 1.14 1999/05/09 17:23:33 phk Exp $
*/
#define CONFIGVERS 400015
#define CONFIGVERS 400016

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$Id: main.c,v 1.32 1999/04/24 18:59:19 peter Exp $";
"$Id: main.c,v 1.33 1999/05/09 17:23:35 phk Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -74,28 +74,6 @@ int profiling;
static void usage __P((void));
static void configfile __P((void));
/*
* note that a configuration should be made
*/
static void
mkconf(sysname)
char *sysname;
{
register struct file_list *fl, **flp;
fl = (struct file_list *) malloc(sizeof *fl);
memset(fl, 0, sizeof(*fl));
fl->f_type = SYSTEMSPEC;
fl->f_needs = sysname;
fl->f_rootdev = 0;
fl->f_fn = 0;
fl->f_next = 0;
for (flp = confp; *flp; flp = &(*flp)->f_next)
;
*flp = fl;
confp = flp;
}
/*
* Config builds a set of files for building a UNIX
* system given a description of the desired system.
@ -165,8 +143,6 @@ main(argc, argv)
old_config_present = 1;
dtab = NULL;
confp = &conf_list;
mkconf("kernel");
if (yyparse())
exit(3);
switch (machine) {
@ -195,7 +171,6 @@ main(argc, argv)
options(); /* make options .h files */
makefile(); /* build Makefile */
headers(); /* make a lot of .h files */
swapconf(); /* swap config files */
configfile(); /* put config file into kernel*/
printf("Kernel build directory is %s\n", p);
exit(0);

View File

@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$Id: mkmakefile.c,v 1.41 1999/04/24 18:59:19 peter Exp $";
"$Id: mkmakefile.c,v 1.42 1999/05/09 17:23:37 phk Exp $";
#endif /* not lint */
/*
@ -74,14 +74,12 @@ static struct file_list *fcur;
static char *tail __P((char *));
static void do_clean __P((FILE *));
static void do_load __P((FILE *));
static void do_rules __P((FILE *));
static void do_sfiles __P((FILE *));
static void do_mfiles __P((FILE *));
static void do_cfiles __P((FILE *));
static void do_objs __P((FILE *));
static void do_before_depend __P((FILE *));
static struct file_list *do_systemspec __P((FILE *, struct file_list *, int));
static int opteq __P((char *, char *));
static void read_files __P((void));
@ -202,8 +200,6 @@ makefile()
do_sfiles(ofp);
else if (eq(line, "%RULES\n"))
do_rules(ofp);
else if (eq(line, "%LOAD\n"))
do_load(ofp);
else if (eq(line, "%CLEAN\n"))
do_clean(ofp);
else if (strncmp(line, "%VERSREQ=", sizeof("%VERSREQ=") - 1) == 0) {
@ -551,10 +547,9 @@ static void
do_objs(fp)
FILE *fp;
{
register struct file_list *tp, *fl;
register struct file_list *tp;
register int lpos, len;
register char *cp, och, *sp;
char swapname[32];
fprintf(fp, "OBJS=");
lpos = 6;
@ -562,13 +557,6 @@ do_objs(fp)
if (tp->f_type == INVISIBLE || tp->f_flags & NO_OBJ)
continue;
sp = tail(tp->f_fn);
for (fl = conf_list; fl; fl = fl->f_next) {
if (fl->f_type != SWAPSPEC)
continue;
(void) snprintf(swapname, sizeof(swapname), "swapkernel.c");
if (eq(sp, swapname))
goto cont;
}
cp = sp + (len = strlen(sp)) - 1;
och = *cp;
*cp = 'o';
@ -579,8 +567,6 @@ do_objs(fp)
fprintf(fp, "%s ", sp);
lpos += len + 1;
*cp = och;
cont:
;
}
if (lpos != 8)
putc('\n', fp);
@ -590,9 +576,8 @@ static void
do_cfiles(fp)
FILE *fp;
{
register struct file_list *tp, *fl;
register struct file_list *tp;
register int lpos, len;
char swapname[32];
fputs("CFILES=", fp);
lpos = 8;
@ -612,16 +597,6 @@ do_cfiles(fp)
lpos += len + 1;
}
for (fl = conf_list; fl; fl = fl->f_next)
if (fl->f_type == SYSTEMSPEC) {
(void) snprintf(swapname, sizeof(swapname), "swapkernel.c");
if ((len = 3 + strlen(swapname)) + lpos > 72) {
lpos = 8;
fputs("\\\n\t", fp);
}
fprintf(fp, "%s ", swapname);
lpos += len + 1;
}
if (lpos != 8)
putc('\n', fp);
}
@ -764,26 +739,6 @@ do_rules(f)
}
}
/*
* Create the load strings
*/
static void
do_load(f)
register FILE *f;
{
register struct file_list *fl;
register int first;
fputs("\nall:", f);
for (fl = conf_list; fl; fl = fl->f_next)
if (fl->f_type == SYSTEMSPEC)
fprintf(f, " %s", fl->f_needs);
fputs("\n\n", f);
for (first = 1, fl = conf_list; fl; first = 0)
fl = fl->f_type == SYSTEMSPEC ?
do_systemspec(f, fl, first) : fl->f_next;
}
static void
do_clean(fp)
FILE *fp;
@ -807,26 +762,6 @@ do_clean(fp)
putc('\n', fp);
}
static struct file_list *
do_systemspec(f, fl, first)
FILE *f;
register struct file_list *fl;
int first;
{
fprintf(f, "KERNEL=\t%s\n", fl->f_needs);
fprintf(f, "${FULLKERNEL}: ${SYSTEM_DEP}");
if (first)
fprintf(f, " vers.o");
fprintf(f, "\n\t${SYSTEM_LD_HEAD}\n");
fprintf(f, "\t${SYSTEM_LD}\n", fl->f_fn);
fprintf(f, "\t${SYSTEM_LD_TAIL}\n\n");
for (fl = fl->f_next; fl; fl = fl->f_next)
if (fl->f_type != SWAPSPEC)
break;
return (fl);
}
char *
raisestr(str)
register char *str;

View File

@ -1,85 +0,0 @@
/*
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)mkswapconf.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$Id: mkswapconf.c,v 1.19 1999/04/24 18:59:19 peter Exp $";
#endif /* not lint */
/*
* Build a swap configuration file.
*/
#include <err.h>
#include <unistd.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "config.h"
void
swapconf()
{
FILE *fp;
char newswapname[80];
char swapname[80];
register struct file_list *swap;
register struct file_list *fl;
fl = conf_list;
while (fl) {
if (fl->f_type != SYSTEMSPEC) {
fl = fl->f_next;
continue;
}
break;
}
(void) snprintf(swapname, sizeof(swapname), "swapkernel.c");
(void) snprintf(newswapname, sizeof(newswapname), "swapkernel.c.new");
fp = fopen(path(newswapname), "w");
if (fp == 0)
err(1, "%s", path(newswapname));
fprintf(fp, "#include <sys/param.h>\n");
fprintf(fp, "#include <sys/conf.h>\n");
fprintf(fp, "\n");
fprintf(fp, "char\t*rootdevname = \"%s\";\n", fl->f_rootdev);
fclose(fp);
moveifchanged(path(newswapname), path(swapname));
return;
}