* Copyright (c) 1980 Regents of the University of California.
* %sccs.include.redist.c%
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
static char sccsid
[] = "@(#)main.c 5.20 (Berkeley) %G%";
* Config builds a set of files for building a UNIX
* system given a description of the desired system.
while ((ch
= getopt(argc
, argv
, "gp")) != EOF
)
usage
: fputs("usage: config [-gp] sysname\n", stderr
);
if (freopen(PREFIX
= *argv
, "r", stdin
) == NULL
) {
if (stat(p
= path((char *)NULL
), &buf
)) {
else if ((buf
.st_mode
& S_IFMT
) != S_IFDIR
) {
fprintf(stderr
, "config: %s isn't a directory.\n", p
);
vax_ioconf(); /* Print ioconf.c */
ubglue(); /* Create ubglue.s */
i386_ioconf(); /* Print ioconf.c */
vector(); /* Create vector.s */
printf("Specify machine type, e.g. ``machine vax''\n");
* make symbolic links in compilation directory
* for "sys" (to make genassym.c work along with #include <sys/xxx>)
* and similarly for "machine".
(void) sprintf(xxx
, "../../%s/include", machinename
);
(void) symlink(xxx
, path("machine"));
makefile(); /* build Makefile */
headers(); /* make a lot of .h files */
swapconf(); /* swap config files */
printf("Don't forget to run \"make depend\"\n");
* returns EOF on end of file
* pointer to the word otherwise
while ((ch
= getc(fp
)) != EOF
)
if (ch
!= ' ' && ch
!= '\t')
while ((ch
= getc(fp
)) != EOF
) {
* like get_word but will accept something in double or single quotes
* (to allow embedded spaces).
while ((ch
= getc(fp
)) != EOF
)
if (ch
!= ' ' && ch
!= '\t')
if (ch
== '"' || ch
== '\'') {
while ((ch
= getc(fp
)) != EOF
) {
printf("config: missing quote reading `%s'\n",
while ((ch
= getc(fp
)) != EOF
) {
* prepend the path to a filename
#define CDIR "../../compile/"
cp
= malloc((unsigned int)(sizeof(CDIR
) + strlen(PREFIX
) +
(file
? strlen(file
) : 0) + 2));
(void) strcat(cp
, PREFIX
);