flex
flex copied to clipboard
flex: fatal internal error, exec of ~/gcc/gcc-old/missing m4 failed
m4 had to be installed for building flex, which successfully compiled, so:
- How is a prerequisite for building still being required by software once the binary has already been made and installed?
- If this scenario was probable in the imagination, then why did the make install process neither automatically run nor suggest some basic pass/fail functionality test after putting the binaries in place?
- If it turns out that a reboot is necessary to correct this issue, realize that this is highly irregular and unacceptable!
Flex uses m4 at runtime as well as build time. The build process tries to use your system's m4 installation and after install. You can set the M4 variable in your environment to point at your m4 installation if you want to choose one at runtime.
@Mightyjo I say "had to be", indicating that my system (Alpine Linux latest-stable(v3.13.x); MUSL apparently has no system package providing m4 (https://dl-cdn.alpinelinux.org/alpine/latest-stable/main/x86/) & so I suppose that the right side of the set equation for setting a new environment variable = to 'M4' would contain a fully-qualified pathname to the M4 binary, which unknown has to be divined through some sophistry & educated-guesstimation. I love mental gym leg-days.
Amending my answer from 2021-01-30: Flex's build system uses your default m4 unless you tell it otherwise. That default m4 is just whatever ./configure can find. After install, flex tries to find m4 by looking first in your environment for an M4 variable and then on your shell's PATH for an m4 binary. If you built from source it's a good bet flex will find the same m4 at runtime as at build time (unless you're cross compiling).
I did a terrible job condensing that into something sensible before.
When you're installing from a distro's packages and something goes wrong it gets really frustrating finding the right path for the M4 variable, as you've discovered @62f. We don't publishing those distro packages so we may not be a ton of help.
I have almost no experience with Alpine, but I thought I saw a link to their m4 package. Is this what you need? m4-1.4.18-r2.apk Looks like that installs into /usr/bin/m4 and the PKGINFO says it's built against MUSL.