Index: usr.sbin/config/config.8 =================================================================== RCS file: /home/ncvs/src/usr.sbin/config/config.8,v retrieving revision 1.10 diff -u -r1.10 config.8 --- config.8 1998/02/18 04:15:03 1.10 +++ config.8 1998/06/01 18:57:31 @@ -40,6 +40,8 @@ .Sh SYNOPSIS .Nm config .Op Fl gpr +.Op Fl f Ar configfile +.Op Fl o Ar directory .Ar SYSTEM_NAME .Sh DESCRIPTION This is the old version of the @@ -72,8 +74,12 @@ Available options and operands: .Pp .Bl -tag -width SYSTEM_NAME +.It Fl f Ar configfile +Use this file as the input filename, instead of ./SYSTEM_NAME .It Fl g Configure a system for debugging. +.It Fl o Ar directory +Use this file as the target directory, instead of ../../compile. .It Fl p Configure a system for profiling; for example, .Xr kgmon 8 Index: usr.sbin/config/main.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/config/main.c,v retrieving revision 1.24 diff -u -r1.24 main.c --- main.c 1998/05/02 01:57:38 1.24 +++ main.c 1998/06/01 18:55:06 @@ -66,6 +66,7 @@ #endif char *PREFIX; +static char *CDIR = "../../compile/"; static int no_config_clobber = TRUE; int old_config_present; @@ -85,12 +86,20 @@ struct stat buf; int ch; char *p; + char *configfn = NULL; /* filename */ + extern char *optarg; - while ((ch = getopt(argc, argv, "gprn")) != -1) + while ((ch = getopt(argc, argv, "f:go:prn")) != -1) switch (ch) { + case 'f': + configfn = optarg; + break; case 'g': debugging++; break; + case 'o': + CDIR = optarg; + break; case 'p': profiling++; break; @@ -112,8 +121,11 @@ if (argc != 1) usage(); - if (freopen(PREFIX = *argv, "r", stdin) == NULL) - err(2, "%s", PREFIX); + PREFIX = *argv; + if (configfn == NULL) + configfn = PREFIX; + if (freopen(configfn, "r", stdin) == NULL) + err(2, "%s", configfn); p = path((char *)NULL); if (stat(p, &buf)) { @@ -327,9 +339,8 @@ { register char *cp; -#define CDIR "../../compile/" - cp = malloc((unsigned int)(sizeof(CDIR) + strlen(PREFIX) + - (file ? strlen(file) : 0) + 2)); + cp = malloc((unsigned int)(strlen(CDIR) + strlen(PREFIX) + + (file ? strlen(file) : 0) + 3)); (void) strcpy(cp, CDIR); (void) strcat(cp, PREFIX); if (file) {