* Copyright (c) 1980 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
static char sccsid
[] = "@(#)main.c 5.9 (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
, "p")) != EOF
)
usage
: fputs("usage: config [-p] 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 */
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) symlink("../h", path("sys"));
(void) sprintf(xxx
, "../%s", 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
) {
* prepend the path to a filename
cp
= malloc((unsigned)(strlen(PREFIX
)+strlen(file
)+5));
(void) strcpy(cp
, "../");
(void) strcat(cp
, PREFIX
);