Let X be a building of arbitrary type. A compactification Cr(X) of the set
Res(X) of spherical residues of X is introduced. We prove that it coincides
with the horofunction compactification of Res(X) endowed with a natural
combinatorial distance which we call the root-distance. Points of Cr(X)
admit amenable stabilisers in Aut(X) and conversely, any amenable subgroup
virtually fixes a point in Cr(X). In addition, it is shown that, provided
Aut(X)is transitive enough, this compactification also coincides with the
group-theoretic compactification constructed using the Chabauty topology on
closed subgroups of Aut(X). This generalises to arbitrary buildings results
established by Y. Guivarc'h and B. R\'emy in the Bruhat--Tits case