[net.bugs.4bsd] Config won't deal with Options with numerics

berry@zinfandel.UUCP (07/18/86)

Subject: config cannot handle OPTIONS with numeric characters.
Index:	etc/config/config.y 4.3BSD

Description:
	When using config(8) to build kernels for 4.3BSD, if one follows the
	instructions in "Installing and Operating 4.3BSD on the VAX" and
	try to enable TCP compatibility with 4.2BSD, config gives a syntax
	error and creates an incorrect Makefile.

Repeat-By:
	Go to /usr/src/sys/conf.  Make a configuration file, TEST, with a
	line that reads 
		OPTIONS	COMPAT_42
	Make a directory ../TEST
	Run
		/etc/config TEST
	Observe the syntax error message.  Examine the Makefile in ../TEST,
	noting the "-DCOMPAT_" incorrectly placed therein.
	
Fix:
	Apply the following patch to /usr/src/etc/config/config.y
	A similar patch can be applied to the 'Mkoption' production for
        completeness, but I have not done it.

*** /tmp/,RCSt1000995	Tue Jul 15 21:08:38 1986
--- config.y	Tue Jul 15 20:58:24 1986
***************
*** 331,336 ****
--- 331,348 ----
  		opt = op;
  		free(temp_id);
  	      } |
+ 	Save_id NUMBER
+ 	      = {
+ 		char buf[80];
+ 		struct opt *op = (struct opt *)malloc(sizeof (struct opt));
+ 
+ 		(void) sprintf(buf, "%s%d", $1, $2);
+ 		op->op_name = ns(buf); free($1);
+ 		op->op_next = opt;
+ 		op->op_value = 0;
+ 		opt = op;
+ 		free(temp_id);
+ 	      } |
  	Save_id EQUALS Opt_value
  	      = {
  		struct opt *op = (struct opt *)malloc(sizeof (struct opt));
***************
*** 337,342 ****
--- 349,368 ----
  		op->op_name = ns($1);
  		op->op_next = opt;
  		op->op_value = ns($3);
+ 		opt = op;
+ 		free(temp_id);
+ 		free(val_id);
+ 	      } |
+ 	Save_id NUMBER EQUALS Opt_value
+ 	      = {
+ 		char buf[80];
+ 		struct opt *op = (struct opt *)malloc(sizeof (struct opt));
+ 
+ 		
+ 		(void) sprintf(buf, "%s%d", $1, $2);
+ 		op->op_name = ns(buf); free($1);
+ 		op->op_next = opt;
+ 		op->op_value = ns($4);
  		opt = op;
  		free(temp_id);
  		free(val_id);


-- 
Schmeichelnd hold und lieblich klingen // Unsers Lebens Harmonien
Und dem Schoenheitssinn entschwingen // Blumne sich, die ewig bluehn
--
Berry Kercheval		Zehntel Inc.	(ihnp4!zehntel!zinfandel!berry)
(415)932-6900				(kerch@lll-crg.ARPA)

muller@sdcsvax.UUCP (Keith Muller) (07/21/86)

In article <518@zinfandel.UUCP>, berry@zinfandel.UUCP (Berry Kercheval) writes:
> Subject: config cannot handle OPTIONS with numeric characters.
> Index:	etc/config/config.y 4.3BSD
> 
> Description:
> 	When using config(8) to build kernels for 4.3BSD, if one follows the
> 	instructions in "Installing and Operating 4.3BSD on the VAX" and
> 	try to enable TCP compatibility with 4.2BSD, config gives a syntax
> 	error and creates an incorrect Makefile.

Somewhere in that manual there is a note that says numeric options need to be
enclosed in "". So:
	options "TCP_COMPAT_42"

Works just fine. (same reason you say: cpu "VAX750" in the conf file).

	Keith Muller
	University of California

berry@zinfandel.UUCP (Berry Kercheval) (07/23/86)

In article <1940@sdcsvax.UUCP> muller@sdcsvax.UUCP (Keith Muller) writes:
>In article <518@zinfandel.UUCP>, berry@zinfandel.UUCP (Berry Kercheval) writes:
>> Subject: config cannot handle OPTIONS with numeric characters.

>Somewhere in that manual there is a note that says numeric options need to be
>enclosed in "". 
>	Keith Muller
>	University of California

Well, I went and looked in the manual again, and sure enough, there it is
buried at the bottom of the "makeoptions" descriptions on page 7.  The
CPU type paragraph seems to imply that the quotes are required.

OK, so I didn't rtfm well enough.  I still think there is no reason
why config should not be able to deal with numerics without having to 
quote them.  I'm going to leave my 'fix' installed.

  

-- 
Schmeichelnd hold und lieblich klingen // Unsers Lebens Harmonien
Und dem Schoenheitssinn entschwingen // Blumne sich, die ewig bluehn
--
Berry Kercheval		Zehntel Inc.	(ihnp4!zehntel!zinfandel!berry)
(415)932-6900				(kerch@s1-c.ARPA after August 4)