Config won't deal with Options with numerics

berry at zinfandel.UUCP berry at zinfandel.UUCP
Fri Jul 18 09:37:03 AEST 1986


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 at lll-crg.ARPA)



More information about the Comp.bugs.4bsd.ucb-fixes mailing list