bam should honour system toolchain
Closed this issue · 1 comments
hasufell commented
In order for packages that use bam to be correctly packaged with the distribution compiler which may be prefixed (e.g. x86_64-pc-linux-gnu-gcc
instead of gcc
), one has to do hackery like (example for teeworlds):
cat << __EOF__ > "${WORK}/settings.lua"
function addSettings(settings)
settings.optimize = 0
settings.cc.exe_c = "${CC}"
settings.cc.exe_cxx = "${CXX}"
settings.cc.flags_c:Add("${CFLAGS}")
settings.cc.flags_cxx:Add("${CXXFLAGS}")
settings.link.exe = "${CXX}"
settings.link.flags:Add("${LDFLAGS}")
end
__EOF__
edo sed -i \
-e '/if family == "unix" then/a \\t\tdofile("settings.lua") addSettings(settings)' \
bam.lua
Instead, pretty much every major build system honors variables like CC
when they are set in the environment or at least gives you very easy means to change them without changing any file.
So, bam should either
- allow to set these things via environment variables
- allow to set these variables via
bam --some-switch
invocation
Hacking on every possible bam.lua file just to get the toolchain right is not a solution.