Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!brl-adm!caip!lll-crg!lll-lcc!dual!ptsfa!qantel!vlsvax1!zehntel!zinfandel!berry From: berry@zinfandel.UUCP Newsgroups: net.bugs.4bsd Subject: Config won't deal with Options with numerics Message-ID: <518@zinfandel.UUCP> Date: Thu, 17-Jul-86 19:37:03 EDT Article-I.D.: zinfande.518 Posted: Thu Jul 17 19:37:03 1986 Date-Received: Sun, 20-Jul-86 08:02:34 EDT Reply-To: berry@zinfandel.UUCP (Berry Kercheval) Organization: Zehntel Inc., Walnut Creek CA Lines: 78 Keywords: 4.3BSD config options 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)