Deleted Added
sdiff udiff text old ( 133248 ) new ( 134542 )
full compact
1/*
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 4. Neither the name of the University nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)config.h 8.1 (Berkeley) 6/6/93
30 * $FreeBSD: head/usr.sbin/config/config.h 133248 2004-08-07 04:19:37Z imp $
31 */
32
33/*
34 * Config.
35 */
36#include <sys/types.h>
37#include <sys/queue.h>
38#include <stdlib.h>
39#include <string.h>
40
41struct file_list {
42 STAILQ_ENTRY(file_list) f_next;
43 char *f_fn; /* the name */
44 int f_type; /* type or count */
45 u_char f_flags; /* see below */
46 char *f_compilewith; /* special make rule if present */
47 char *f_depends; /* additional dependancies */
48 char *f_clean; /* File list to add to clean rule */
49 char *f_needs;
50 char *f_warn; /* warning message */
51};
52
53struct files_name {
54 char *f_name;
55 STAILQ_ENTRY(files_name) f_next;
56};
57
58/*
59 * Types.
60 */
61#define NORMAL 1
62#define INVISIBLE 2
63#define PROFILING 3
64#define NODEPEND 4
65#define LOCAL 5
66#define DEVDONE 0x80000000
67#define TYPEMASK 0x7fffffff
68
69/*
70 * Attributes (flags).
71 */
72#define NO_IMPLCT_RULE 1
73#define NO_OBJ 2
74#define BEFORE_DEPEND 4
75#define NEED_COUNT 8
76#define ISDUP 16
77#define NOWERROR 32
78
79struct device {
80 int d_done; /* processed */
81 char *d_name; /* name of device (e.g. rk11) */
82 int d_count; /* device count */
83#define UNKNOWN -2 /* -2 means not set yet */
84 STAILQ_ENTRY(device) d_next; /* Next one in list */
85};
86
87struct config {
88 char *s_sysname;
89};
90
91/*
92 * Config has a global notion of which machine type is
93 * being used. It uses the name of the machine in choosing
94 * files and directories. Thus if the name of the machine is ``i386'',
95 * it will build from ``Makefile.i386'' and use ``../i386/inline''
96 * in the makerules, etc.
97 */
98char *machinename;
99
100/*
101 * For each machine, a set of CPU's may be specified as supported.
102 * These and the options (below) are put in the C flags in the makefile.
103 */
104struct cputype {
105 char *cpu_name;
106 SLIST_ENTRY(cputype) cpu_next;
107};
108
109SLIST_HEAD(, cputype) cputype;
110
111/*
112 * A set of options may also be specified which are like CPU types,
113 * but which may also specify values for the options.
114 * A separate set of options may be defined for make-style options.
115 */
116struct opt {
117 char *op_name;
118 char *op_value;
119 int op_ownfile; /* true = own file, false = makefile */
120 SLIST_ENTRY(opt) op_next;
121};
122
123SLIST_HEAD(opt_head, opt) opt, mkopt;
124
125struct opt_list {
126 char *o_name;
127 char *o_file;
128 SLIST_ENTRY(opt_list) o_next;
129};
130
131SLIST_HEAD(, opt_list) otab;
132
133extern char *ident;
134extern char *env;
135extern char *hints;
136extern int do_trace;
137extern int envmode;
138extern int hintmode;
139
140char *get_word(FILE *);
141char *get_quoted_word(FILE *);
142char *path(const char *);
143char *raisestr(char *);
144void remember(const char *);
145void moveifchanged(const char *, const char *);
146int yyparse(void);
147int yylex(void);
148void options(void);
149void makefile(void);
150void headers(void);
151
152extern STAILQ_HEAD(device_head, device) dtab;
153
154extern char errbuf[80];
155extern int yyline;
156extern const char *yyfile;
157
158extern STAILQ_HEAD(file_list_head, file_list) ftab;
159
160extern STAILQ_HEAD(files_name_head, files_name) fntab;
161
162extern int profiling;
163extern int debugging;
164
165extern int maxusers;
166
167extern char *PREFIX; /* Config file name - for error messages */
168extern char srcdir[]; /* root of the kernel source tree */
169
170#define eq(a,b) (!strcmp(a,b))
171#define ns(s) strdup(s)