superenv: set M4 on Linux when bison is a dependency

Bison no longer remembers the path to `m4` as of
Homebrew/homebrew-core#84931. Since superenv does not put runtime
dependencies of build dependences in `PATH`, we now need to help Bison
find `m4` by setting `M4` in the environment.

See also Homebrew/homebrew-core#85260.
This commit is contained in:
Carlo Cabrera 2021-09-16 21:11:12 +08:00
parent 2dd3934fd7
commit 22db7aa516
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -24,6 +24,7 @@ module Superenv
self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2"
self["HOMEBREW_DYNAMIC_LINKER"] = determine_dynamic_linker_path
self["HOMEBREW_RPATH_PATHS"] = determine_rpath_paths(@formula)
self["M4"] = "#{HOMEBREW_PREFIX}/opt/m4/bin/m4" if deps.any? { |d| d.name == "libtool" || d.name == "bison" }
end
def homebrew_extra_paths