NetBSD Problem Report #9309

Received: (qmail 26318 invoked from network); 28 Jan 2000 09:51:24 -0000
Message-Id: <200001280950.SAA02410@gabriel.ece.ibaraki-ct.ac.jp>
Date: Fri, 28 Jan 2000 18:50:12 +0900 (JST)
From: you@nightbreak.org (Y. Takizawa)
Reply-To: takizawa@gabriel.ece.ibaraki-ct.ac.jp
To: gnats-bugs@gnats.netbsd.org
Subject: can not compile config for release branch using Makefile.boot
X-Send-Pr-Version: 3.95

>Number:         9309
>Category:       misc
>Synopsis:       can not compile config of release for Makefile.boot
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 28 01:54:01 +0000 2000
>Closed-Date:    Mon Dec 17 21:31:37 +0000 2001
>Last-Modified:  Mon Dec 17 21:31:37 +0000 2001
>Originator:     Y. Takizawa
>Release:        1.4.1
>Organization:
>Environment:
	SunOS 5.6/sun4u/sparc/Ultra-30
	NetBSD-release 20000122

>Description:
>How-To-Repeat:
	egcs-1.1 release, GNU make 3.76.1, flex 2.5.4, Solaris yacc:

% make -f Makefile.boot
gcc -O -I. -DMAKE_BOOTSTRAP -c files.c
...
gcc -O -I. -DMAKE_BOOTSTRAP -c util.c
yacc -d gram.y
gcc -O -I. -DMAKE_BOOTSTRAP -c y.tab.c
flex -l scan.l
gcc -O -I. -DMAKE_BOOTSTRAP -Dstrtoul=strtol -c lex.yy.c
scan.l:55: gram.h: No such file or directory
make: *** [lex.yy.o] Error 1

>Fix:

diff -urN config.orig/Makefile.boot config/Makefile.boot
--- config.orig/Makefile.boot	Fri Nov  8 07:59:39 1996
+++ config/Makefile.boot	Fri Jan 28 18:19:21 2000
@@ -9,7 +9,7 @@
 CFLAGS= -I. -DMAKE_BOOTSTRAP

 # Uncomment this if your system does not have strtoul (i.e. SunOS)
-STRTOUL= -Dstrtoul=strtol
+#STRTOUL= -Dstrtoul=strtol

 # Note: The scanner here uses features specific to "flex" so
 # do not bother even trying to make lex build the scanner.
@@ -20,18 +20,20 @@
 YACC=yacc

 OBJS=	files.o hash.o main.o mkheaders.o mkioconf.o mkmakefile.o \
-	mkswap.o pack.o sem.o util.o y.tab.o lex.yy.o strerror.o
+	mkswap.o pack.o sem.o util.o gram.o lex.yy.o strerror.o

 config: ${OBJS}
 	${CC} -o $@ ${OBJS}

-y.tab.o : y.tab.c
-	${CC} ${CFLAGS} -c y.tab.c
+gram.o : gram.c
+	${CC} ${CFLAGS} -c gram.c

-y.tab.c y.tab.h : gram.y
+gram.c gram.h : gram.y
 	${YACC} -d gram.y
+	-mv -f y.tab.c gram.c
+	-mv -f y.tab.h gram.h

-lex.yy.o : lex.yy.c
+lex.yy.o : lex.yy.c gram.h
 	${CC} ${CFLAGS} ${STRTOUL} -c lex.yy.c

 lex.yy.c : scan.l
@@ -40,11 +42,11 @@
 ${OBJS} : config.h

 y.tab.o mkmakefile.o mkswap.o sem.o : sem.h
-lex.yy.o : y.tab.h
+lex.yy.o : gram.h

 .c.o:
 	${CC} ${CFLAGS} -c $<

 clean:
-	rm -f *.o config lex.yy.c y.tab.[ch]
+	rm -f *.o config lex.yy.c y.tab.[ch] gram.[ch]

diff -urN config.orig/config.h config/config.h
--- config.orig/config.h	Thu Jan 21 22:10:08 1999
+++ config/config.h	Fri Jan 28 18:25:36 2000
@@ -75,6 +75,14 @@
 #define _PATH_DEVNULL "/dev/null"
 #endif

+#ifdef	MAKE_BOOTSTRAP
+#undef	major
+#undef	minor
+#undef	makedev
+#define	major(x)	((int)(((u_int)(x) >> 8) & 0xff))
+#define	minor(x)	((int)((x) & 0xff))
+#define	makedev(x,y)	((int)(((x) << 8) | (y)))
+#endif	/* MAKE_BOOTSTRAP */

 #define ARRCHR '#'

diff -urN config.orig/main.c config/main.c
--- config.orig/main.c	Tue Feb  9 07:32:58 1999
+++ config/main.c	Fri Jan 28 18:26:23 2000
@@ -95,6 +95,10 @@

 int badfilename __P((const char *fname));

+#ifdef	MAKE_BOOTSTRAP
+char *__progname;
+#endif
+
 int
 main(argc, argv)
 	int argc;
@@ -103,6 +107,10 @@
 	char *p;
 	const char *last_component;
 	int pflag, ch;
+
+#ifdef	MAKE_BOOTSTRAP
+	__progname = argv[0];
+#endif

 	pflag = 0;
 	while ((ch = getopt(argc, argv, "Dgpvb:s:")) != -1) {
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: tv 
State-Changed-When: Mon Dec 17 13:31:21 PST 2001 
State-Changed-Why:  
This isn't really relevant anymore with the new toolchain. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.