2001-04-13 05:17:32

by David E. Weekly

[permalink] [raw]
Subject: Yacc in 2.4.3 causes kernel compile to fail (aicasm_gram.y)

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



2001-04-13 12:51:07

by Alan

[permalink] [raw]
Subject: Re: Yacc in 2.4.3 causes kernel compile to fail (aicasm_gram.y)

> 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.

2001-04-13 19:38:44

by H. Peter Anvin

[permalink] [raw]
Subject: Re: Yacc in 2.4.3 causes kernel compile to fail (aicasm_gram.y)

Followup to: <[email protected]>
By author: "David E. Weekly" <[email protected]>
In newsgroup: linux.dev.kernel
>
> 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
--
<[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