Kconfig reindented to 4 spaces.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* 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
|
||||
@@ -12,8 +12,8 @@
|
||||
* 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.
|
||||
* 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.
|
||||
@@ -46,190 +46,188 @@ static char *PREFIX;
|
||||
* system given a description of the desired system.
|
||||
*/
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
struct stat buf;
|
||||
int ch;
|
||||
char *p;
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
struct stat buf;
|
||||
int ch;
|
||||
char *p;
|
||||
|
||||
while ((ch = getopt(argc, argv, "gp")) != EOF)
|
||||
switch (ch) {
|
||||
case 'g':
|
||||
debugging++;
|
||||
break;
|
||||
case 'p':
|
||||
profiling++;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
while ((ch = getopt(argc, argv, "gp")) != EOF)
|
||||
switch (ch) {
|
||||
case 'g':
|
||||
debugging++;
|
||||
break;
|
||||
case 'p':
|
||||
profiling++;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc != 1) {
|
||||
usage: fputs("usage: config [-gp] sysname\n", stderr);
|
||||
exit(1);
|
||||
}
|
||||
if (argc != 1) {
|
||||
usage: fputs("usage: config [-gp] sysname\n", stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (freopen(PREFIX = *argv, "r", stdin) == NULL) {
|
||||
fprintf(stderr, "--- PREFIX\n");
|
||||
perror(PREFIX);
|
||||
exit(2);
|
||||
}
|
||||
mkdir("../../compile", 0777);
|
||||
if (stat(p = path((char *)NULL), &buf)) {
|
||||
if (mkdir(p, 0777)) {
|
||||
fprintf(stderr, "--- mkdir path\n");
|
||||
perror(p);
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
else if ((buf.st_mode & S_IFMT) != S_IFDIR) {
|
||||
fprintf(stderr, "config: %s isn't a directory.\n", p);
|
||||
exit(2);
|
||||
}
|
||||
if (freopen(PREFIX = *argv, "r", stdin) == NULL) {
|
||||
perror(PREFIX);
|
||||
exit(2);
|
||||
}
|
||||
mkdir("../../compile", 0777);
|
||||
if (stat(p = path((char *)NULL), &buf)) {
|
||||
if (mkdir(p, 0777)) {
|
||||
perror(p);
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
else if ((buf.st_mode & S_IFMT) != S_IFDIR) {
|
||||
fprintf(stderr, "config: %s isn't a directory.\n", p);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
dtab = NULL;
|
||||
confp = &conf_list;
|
||||
compp = &comp_list;
|
||||
if (yyparse())
|
||||
exit(3);
|
||||
switch (machine) {
|
||||
dtab = NULL;
|
||||
confp = &conf_list;
|
||||
compp = &comp_list;
|
||||
if (yyparse())
|
||||
exit(3);
|
||||
switch (machine) {
|
||||
|
||||
case MACHINE_VAX:
|
||||
vax_ioconf(); /* Print ioconf.c */
|
||||
ubglue(); /* Create ubglue.s */
|
||||
break;
|
||||
case MACHINE_VAX:
|
||||
vax_ioconf(); /* Print ioconf.c */
|
||||
ubglue(); /* Create ubglue.s */
|
||||
break;
|
||||
|
||||
case MACHINE_TAHOE:
|
||||
tahoe_ioconf();
|
||||
vbglue();
|
||||
break;
|
||||
case MACHINE_TAHOE:
|
||||
tahoe_ioconf();
|
||||
vbglue();
|
||||
break;
|
||||
|
||||
case MACHINE_HP300:
|
||||
case MACHINE_LUNA68K:
|
||||
hp300_ioconf();
|
||||
hpglue();
|
||||
break;
|
||||
case MACHINE_HP300:
|
||||
case MACHINE_LUNA68K:
|
||||
hp300_ioconf();
|
||||
hpglue();
|
||||
break;
|
||||
|
||||
case MACHINE_I386:
|
||||
i386_ioconf(); /* Print ioconf.c */
|
||||
vector(); /* Create vector.s */
|
||||
break;
|
||||
case MACHINE_I386:
|
||||
i386_ioconf(); /* Print ioconf.c */
|
||||
vector(); /* Create vector.s */
|
||||
break;
|
||||
|
||||
case MACHINE_MIPS:
|
||||
case MACHINE_PMAX:
|
||||
pmax_ioconf();
|
||||
break;
|
||||
case MACHINE_MIPS:
|
||||
case MACHINE_PMAX:
|
||||
pmax_ioconf();
|
||||
break;
|
||||
|
||||
case MACHINE_PIC32:
|
||||
pic32_ioconf();
|
||||
break;
|
||||
case MACHINE_PIC32:
|
||||
pic32_ioconf();
|
||||
break;
|
||||
|
||||
case MACHINE_NEWS3400:
|
||||
news_ioconf();
|
||||
break;
|
||||
case MACHINE_NEWS3400:
|
||||
news_ioconf();
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Specify machine type, e.g. ``machine vax''\n");
|
||||
exit(1);
|
||||
}
|
||||
makefile(); /* build Makefile */
|
||||
headers(); /* make a lot of .h files */
|
||||
swapconf(); /* swap config files */
|
||||
printf("Don't forget to run \"make depend\"\n");
|
||||
exit(0);
|
||||
default:
|
||||
printf("Specify machine type, e.g. ``machine vax''\n");
|
||||
exit(1);
|
||||
}
|
||||
makefile(); /* build Makefile */
|
||||
headers(); /* make a lot of .h files */
|
||||
swapconf(); /* swap config files */
|
||||
printf("Don't forget to run \"make depend\"\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* get_word
|
||||
* returns EOF on end of file
|
||||
* NULL on end of line
|
||||
* pointer to the word otherwise
|
||||
* returns EOF on end of file
|
||||
* NULL on end of line
|
||||
* pointer to the word otherwise
|
||||
*/
|
||||
char *
|
||||
get_word(fp)
|
||||
register FILE *fp;
|
||||
register FILE *fp;
|
||||
{
|
||||
static char line[80];
|
||||
register int ch;
|
||||
register char *cp;
|
||||
static char line[80];
|
||||
register int ch;
|
||||
register char *cp;
|
||||
|
||||
while ((ch = getc(fp)) != EOF)
|
||||
if (ch != ' ' && ch != '\t')
|
||||
break;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
if (ch == '\n')
|
||||
return (NULL);
|
||||
cp = line;
|
||||
*cp++ = ch;
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (isspace(ch))
|
||||
break;
|
||||
*cp++ = ch;
|
||||
}
|
||||
*cp = 0;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
(void) ungetc(ch, fp);
|
||||
return (line);
|
||||
while ((ch = getc(fp)) != EOF)
|
||||
if (ch != ' ' && ch != '\t')
|
||||
break;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
if (ch == '\n')
|
||||
return (NULL);
|
||||
cp = line;
|
||||
*cp++ = ch;
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (isspace(ch))
|
||||
break;
|
||||
*cp++ = ch;
|
||||
}
|
||||
*cp = 0;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
(void) ungetc(ch, fp);
|
||||
return (line);
|
||||
}
|
||||
|
||||
/*
|
||||
* get_quoted_word
|
||||
* like get_word but will accept something in double or single quotes
|
||||
* (to allow embedded spaces).
|
||||
* like get_word but will accept something in double or single quotes
|
||||
* (to allow embedded spaces).
|
||||
*/
|
||||
char *
|
||||
get_quoted_word(fp)
|
||||
register FILE *fp;
|
||||
register FILE *fp;
|
||||
{
|
||||
static char line[256];
|
||||
register int ch;
|
||||
register char *cp;
|
||||
static char line[256];
|
||||
register int ch;
|
||||
register char *cp;
|
||||
|
||||
while ((ch = getc(fp)) != EOF)
|
||||
if (ch != ' ' && ch != '\t')
|
||||
break;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
if (ch == '\n')
|
||||
return (NULL);
|
||||
cp = line;
|
||||
if (ch == '"' || ch == '\'') {
|
||||
register int quote = ch;
|
||||
while ((ch = getc(fp)) != EOF)
|
||||
if (ch != ' ' && ch != '\t')
|
||||
break;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
if (ch == '\n')
|
||||
return (NULL);
|
||||
cp = line;
|
||||
if (ch == '"' || ch == '\'') {
|
||||
register int quote = ch;
|
||||
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (ch == quote)
|
||||
break;
|
||||
if (ch == '\n') {
|
||||
*cp = 0;
|
||||
printf("config: missing quote reading `%s'\n",
|
||||
line);
|
||||
exit(2);
|
||||
}
|
||||
*cp++ = ch;
|
||||
}
|
||||
} else {
|
||||
*cp++ = ch;
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (isspace(ch))
|
||||
break;
|
||||
*cp++ = ch;
|
||||
}
|
||||
if (ch != EOF)
|
||||
(void) ungetc(ch, fp);
|
||||
}
|
||||
*cp = 0;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
return (line);
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (ch == quote)
|
||||
break;
|
||||
if (ch == '\n') {
|
||||
*cp = 0;
|
||||
printf("config: missing quote reading `%s'\n",
|
||||
line);
|
||||
exit(2);
|
||||
}
|
||||
*cp++ = ch;
|
||||
}
|
||||
} else {
|
||||
*cp++ = ch;
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (isspace(ch))
|
||||
break;
|
||||
*cp++ = ch;
|
||||
}
|
||||
if (ch != EOF)
|
||||
(void) ungetc(ch, fp);
|
||||
}
|
||||
*cp = 0;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
return (line);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -237,18 +235,19 @@ get_quoted_word(fp)
|
||||
*/
|
||||
char *
|
||||
path(file)
|
||||
char *file;
|
||||
char *file;
|
||||
{
|
||||
register char *cp;
|
||||
register char *cp;
|
||||
|
||||
#define CDIR "../../compile/"
|
||||
cp = malloc((unsigned int)(sizeof(CDIR) + strlen(PREFIX) +
|
||||
(file ? strlen(file) : 0) + 2));
|
||||
(void) strcpy(cp, CDIR);
|
||||
(void) strcat(cp, PREFIX);
|
||||
if (file) {
|
||||
(void) strcat(cp, "/");
|
||||
(void) strcat(cp, file);
|
||||
}
|
||||
return (cp);
|
||||
#define CDIR "../../compile/"
|
||||
|
||||
cp = malloc((unsigned int)(sizeof(CDIR) + strlen(PREFIX) +
|
||||
(file ? strlen(file) : 0) + 2));
|
||||
(void) strcpy(cp, CDIR);
|
||||
(void) strcat(cp, PREFIX);
|
||||
if (file) {
|
||||
(void) strcat(cp, "/");
|
||||
(void) strcat(cp, file);
|
||||
}
|
||||
return (cp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user