Hi, Thanks for working on this!
I don't have a strong opinion of what's the best way to implement this and I don't recall why the previous attempts exactly failed. I do however remember that all the failures previously where immediately visible in the CI. For 2a and 2b let's proceed as you see fit. I don't know why mariadb_config is a binary and I haven't checked git blame. Upstream probably had some reason but upstream does not really test nor target cross-compiling. Once we have this fully working in Debian, I hope you can continue by also submitting your improvements upstream. But let's fix this fully in Debian and Ubuntu first and see for a few weeks that no regressions surface.

