Created attachment 98379 [details]
Fix gbm compile without dri
Tested with mesa3d 10.2-rc1, configure options used:
--disable-glx --disable-xa --disable-static --enable-shared-glapi --with-gallium-drivers=swrast --disable-dri --without-dri-drivers --enable-opengl --enable-gbm --enable-egl --with-egl-platforms=drm --enable-gles1 --enable-gles2
OpenGL: yes (ES1: yes ES2: yes)
EGL platforms: drm
Winsys dirs: sw
Driver dirs: galahad identity noop rbug softpipe trace
Shared libs: yes
Static libs: no
mesa3d compiles without errors, but other apps needing mesa3d fail to compile, like xbmc 12.3:
checking for main in -lEGL... no
configure: error: Could not find a required library. Please see the README for your platform.
snippet from xbmc config.log:
configure:19532: checking for main in -lEGL
configure:19551: /home/br2/output/host/usr/bin/i686-pc-linux-gnu-gcc -o conftest -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -I/home/fli4l/br2/output/host/usr/i586-buildroot-linux-gnu/sysroot/usr/include -DMESA_EGL_NO_X11_HEADERS -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG=1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 conftest.c -lEGL -lpython2.7 -lpthread -ldl -lutil -lm >&5
/home/br2/output/host/usr/i586-buildroot-linux-gnu/sysroot/usr/lib32/libgbm.so.1: undefined reference to `gbm_dri_backend'
collect2: error: ld returned 1 exit status
The attached patch fixes the problem.
Have you tried using EGL with the mentioned config/patch ?
AFAICS both gbm backends require DRI, thus in your case you're building only an empty libgbm library which does not provide much functionality on it's own.
If you want a gallium based swrast + opengl, egl etc. I would drop the "disable-dri" part.
Meanwhile I'll prep a patch that errors out on --enable-gbm --disable-dri.
As mentioned previously, building gbm without dri i.e. without any backends serves little benefit. With the following commit we'll avoid that error-ing at configure time.
Author: Emil Velikov <firstname.lastname@example.org>
Date: Mon May 5 22:09:22 2014 +0100
configure: error out if building GBM without dri
Both backends require --enable-dri, and building an empty libgbm
makes little to no sense. Error out at configure to prevent the
user from shooting themselves in the foot.