Skip to contentSkip to conversation

Yacc in 2.4.3 causes kernel compile to fail (aicasm_gram.y)

DISCUSSION David E. Weekly 3 participants 3 messages Apr 13, 2001

lore
Share & tools
lore
#0 lore raw

There is a singular Yacc file in 2.4.3:
linux/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y

This is the first time I remember seeing a Yacc file in the Linux kernel source code, but I'm young and stupid.

Since the default Makefile mapping for .y files is to call yacc, and since I have bison on my system instead, compiling the aic7xxx code into 2.4.3 broke my build.

The Makefile system is expecting the YACC variable to be defined; a straightforward workaround is then to define:

export YACC="which bison -y"

The -y option makes sure that bison outputs files in the same way that yacc does (i.e., y.tab.c and not [filename].tab.c).

I would put in my two cents that the better way to do this is to add YACC to the list of "make variables" in the root Makefile.

I'm guessing that anyone compiling the AIC 7xxx SCSI drivers who has bison and hasn't configured a spoof "yacc" will run into this problem.

-david

#1 lore raw
Quoted 4 lines

The Makefile system is expecting the YACC variable to be defined; a straightforward workaround is then to define:

export YACC="which bison -y"

Umm

[root@irongate linux.ac]# which yacc
/usr/bin/yacc
/usr/bin/which: no bison in (/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/X11R6/bin)

so you would need to check for yacc first.

#2 lore raw
In reply to David E. Weekly
Followup to:  <[email protected]>
By author:    "David E. Weekly" <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 8 lines

This is the first time I remember seeing a Yacc file in the Linux kernel source code, but I'm young and stupid.

Since the default Makefile mapping for .y files is to call yacc, and since I have bison on my system instead, compiling the aic7xxx code into 2.4.3 broke my build.

It's a good idea if you have bison installed to have a /usr/bin/yacc containing:

	#!/bin/sh -
	exec bison -y "$@"

I think there is a reasonably good expectation that the command "yacc" should do what is expected, without needing any special hacks for bison -- unless, of course, you're using bison special features.

-hpa

Signature · 3 lines
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt