简体   繁体   中英

glibc configure error: yacc/bison missing

I'm following the instructions from LFS but with a twist: I'm only following parts of Section 5 - Constructing a Temporary System to the extent that I can build my own GCC, reason being that this is a work machine, and I don't have root privileges. It was going all right until I ran into an error configuring glibc :

configure: error:
*** These critical programs are missing or too old: as GNU ld make bison compiler
*** Check the INSTALL file for required versions.

After some investigation, it turns out that I'm not satisfying this condition that's required for LFS:

/usr/bin/yacc is a symbolic link to bison or a small script that executes bison.

Turns out that there is no such file at /usr/bin/yacc (although bison does exist). However, because I don't have root privileges at work, I can't create a symbolic link there. Is there a workaround here?

Current glibc versions need the bison program to build (and not yacc). You can download the bison source and build them like this:

wget https://ftp.gnu.org/gnu/bison/bison-3.2.tar.gz
tar xf bison-3.2.tar.gz
cd bison-3.2
./configure --prefix=$HOME/install
make
make install

Then you can put the $HOME/install/bin directory on the command search path:

PATH=$HOME/install/bin:$PATH

At this point, glibc's configure script should pick up that bison version.

Older versions of glibc (before 2.27) ship the bison-generated files as part of the sources, so that bison is optional. Apparently the instructions you are following have not been updated to reflect the new requirement for bison.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM