Please refer to https://www.open-mesh.org/projects/batman-adv/wiki/Building-with-openwrt for building Batman Adv with OpenWrt.
Please refer to https://openwrt.org/docs/guide-user/network/wifi/mesh/batman for installation and configuration of batman-adv.