View | Details | Raw Unified | Return to bug 187712 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile.inc1 (-1 / +1 lines)
Lines 1015-1021 Link Here
1015
	cd ${KRNLCONFDIR}; \
1015
	cd ${KRNLCONFDIR}; \
1016
		PATH=${TMPPATH} \
1016
		PATH=${TMPPATH} \
1017
		    config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
1017
		    config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
1018
			${KERNCONFDIR}/${_kernel}
1018
			-I ${KERNCONFDIR} ${KERNCONFDIR}/${_kernel}
1019
.endif
1019
.endif
1020
.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
1020
.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
1021
	@echo
1021
	@echo
(-)usr.sbin/config/config.8 (+7 lines)
Lines 37-42 Link Here
37
.Sh SYNOPSIS
37
.Sh SYNOPSIS
38
.Nm
38
.Nm
39
.Op Fl CVgp
39
.Op Fl CVgp
40
.Op Fl I Ar path
40
.Op Fl d Ar destdir
41
.Op Fl d Ar destdir
41
.Ar SYSTEM_NAME
42
.Ar SYSTEM_NAME
42
.Nm
43
.Nm
Lines 69-74 Link Here
69
kernel image will contain full configuration files included
70
kernel image will contain full configuration files included
70
literally (preserving comments).
71
literally (preserving comments).
71
This flag is kept for backward compatibility.
72
This flag is kept for backward compatibility.
73
.It Fl I Ar path
74
Search in
75
.Ar path
76
for any file included by the 
77
.Ic include
78
directive.  This option may be specified more than once.
72
.It Fl d Ar destdir
79
.It Fl d Ar destdir
73
Use
80
Use
74
.Ar destdir
81
.Ar destdir
(-)usr.sbin/config/config.h (+7 lines)
Lines 144-149 Link Here
144
144
145
STAILQ_HEAD(hint_head, hint) hints;
145
STAILQ_HEAD(hint_head, hint) hints;
146
146
147
struct includepath {
148
	char	*path;
149
	SLIST_ENTRY(includepath) path_next;
150
};
151
152
SLIST_HEAD(, includepath) includepath;
153
147
/*
154
/*
148
 * Tag present in the kernelconf.tmlp template file. It's mandatory for those
155
 * Tag present in the kernelconf.tmlp template file. It's mandatory for those
149
 * two strings to be the same. Otherwise you'll get into trouble.
156
 * two strings to be the same. Otherwise you'll get into trouble.
(-)usr.sbin/config/lang.l (+13 lines)
Lines 34-39 Link Here
34
#include <assert.h>
34
#include <assert.h>
35
#include <ctype.h>
35
#include <ctype.h>
36
#include <err.h>
36
#include <err.h>
37
#include <stdlib.h>
37
#include <string.h>
38
#include <string.h>
38
#include "y.tab.h"
39
#include "y.tab.h"
39
#include "config.h"
40
#include "config.h"
Lines 257-262 Link Here
257
{
258
{
258
	FILE *fp;
259
	FILE *fp;
259
	struct incl *in;
260
	struct incl *in;
261
	struct includepath* ipath;
260
	char *fnamebuf;
262
	char *fnamebuf;
261
263
262
	fnamebuf = NULL;
264
	fnamebuf = NULL;
Lines 269-274 Link Here
269
		}
271
		}
270
	}
272
	}
271
	if (fp == NULL) {
273
	if (fp == NULL) {
274
		SLIST_FOREACH(ipath, &includepath, path_next) {
275
			asprintf(&fnamebuf, "%s/%s", ipath->path, fname);
276
			if (fnamebuf != NULL) {
277
				fp = fopen(fnamebuf, "r");
278
				free(fnamebuf);
279
			}
280
			if (fp != NULL)
281
				break;
282
		}
283
	}
284
	if (fp == NULL) {
272
		yyerror("cannot open included file");
285
		yyerror("cannot open included file");
273
		return (-1);
286
		return (-1);
274
	}
287
	}
(-)usr.sbin/config/main.c (-1 / +11 lines)
Lines 110-124 Link Here
110
	int ch, len;
110
	int ch, len;
111
	char *p;
111
	char *p;
112
	char *kernfile;
112
	char *kernfile;
113
	struct includepath* ipath;
113
	int printmachine;
114
	int printmachine;
114
115
115
	printmachine = 0;
116
	printmachine = 0;
116
	kernfile = NULL;
117
	kernfile = NULL;
117
	while ((ch = getopt(argc, argv, "Cd:gmpVx:")) != -1)
118
	SLIST_INIT(&includepath);
119
	while ((ch = getopt(argc, argv, "CI:d:gmpVx:")) != -1)
118
		switch (ch) {
120
		switch (ch) {
119
		case 'C':
121
		case 'C':
120
			filebased = 1;
122
			filebased = 1;
121
			break;
123
			break;
124
		case 'I':
125
			ipath = (struct includepath *) \
126
			    	calloc(1, sizeof (struct includepath));
127
			if (ipath == NULL)
128
				err(EXIT_FAILURE, "calloc");
129
			ipath->path = optarg;
130
			SLIST_INSERT_HEAD(&includepath, ipath, path_next);
131
			break;
122
		case 'm':
132
		case 'm':
123
			printmachine = 1;
133
			printmachine = 1;
124
			break;
134
			break;

Return to bug 187712