Using Android Build System with Android.mk i.e. the mesa version currently in android-x86 OSDN repo
if you only want to build mesa:
cd [android-x86 source folder]
lunch lunch android_x86_64-userdebug
mmma external/mesa
With q-x86 and later it is possible to build mesa 21.2 in a simpler way,
by using meson build system launched by a minimal android/Android.mk
NOTE1: the changes in
board.mk can be moved to device/genericcommon/BoadConfig.mk
NOTE3: init_hal_gralloc() in init.sh requires set_property ro.hardware.egl mesa for libEGL_mesa.so be loaded correcly by Android EGL client
cd [android-x86 source folder]
lunch lunch android_x86_64-userdebug
cd external/mesa
git fetch freedesktop 21.2
git checkout FETCH_HEAD
cd ..
cd ..
mmma external/mesa