* Copyright (c) 1980 Regents of the University of California.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 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
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
static char sccsid
[] = "@(#)main.c 5.17 (Berkeley) 7/1/91";
* 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
);