smartcard_nss=""
libusb=""
usb_redir=""
-glx=""
+opengl=""
zlib="yes"
lzo=""
snappy=""
;;
--enable-vhost-scsi) vhost_scsi="yes"
;;
- --disable-glx) glx="no"
+ --disable-opengl) opengl="no"
;;
- --enable-glx) glx="yes"
+ --enable-opengl) opengl="yes"
;;
--disable-rbd) rbd="no"
;;
fi
fi
+##########################################
+# X11 probe
+x11_cflags=
+x11_libs=-lX11
+if $pkg_config --exists "x11"; then
+ x11_cflags=`$pkg_config --cflags x11`
+ x11_libs=`$pkg_config --libs x11`
+fi
+
##########################################
# GTK probe
gtk_cflags=`$pkg_config --cflags $gtkpackage`
gtk_libs=`$pkg_config --libs $gtkpackage`
if $pkg_config --exists "$gtkx11package >= $gtkversion"; then
- gtk_libs="$gtk_libs -lX11"
+ gtk_cflags="$gtk_cflags $x11_cflags"
+ gtk_libs="$gtk_libs $x11_libs"
fi
libs_softmmu="$gtk_libs $libs_softmmu"
gtk="yes"
#endif
int main(void) { return 0; }
EOF
- if compile_prog "$sdl_cflags" "$sdl_libs" ; then
- sdl_libs="$sdl_libs -lX11"
+ if compile_prog "$sdl_cflags $x11_cflags" "$sdl_libs $x11_libs" ; then
+ sdl_cflags="$sdl_cflags $x11_cflags"
+ sdl_libs="$sdl_libs $x11_libs"
fi
libs_softmmu="$sdl_libs $libs_softmmu"
fi
libs_softmmu="$libs_softmmu $fdt_libs"
##########################################
+# opengl probe (for sdl2, milkymist-tmu2)
+
# GLX probe, used by milkymist-tmu2
-if test "$glx" != "no" ; then
- glx_libs="-lGL -lX11"
- cat > $TMPC << EOF
+# this is temporary, code will be switched to egl mid-term.
+cat > $TMPC << EOF
#include <X11/Xlib.h>
#include <GL/gl.h>
#include <GL/glx.h>
int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; }
EOF
- if compile_prog "" "-lGL -lX11" ; then
- glx=yes
+if compile_prog "" "-lGL -lX11" ; then
+ have_glx=yes
+else
+ have_glx=no
+fi
+
+if test "$opengl" != "no" ; then
+ opengl_pkgs="gl"
+ if $pkg_config $opengl_pkgs x11 && test "$have_glx" = "yes"; then
+ opengl_cflags="$($pkg_config --cflags $opengl_pkgs) $x11_cflags"
+ opengl_libs="$($pkg_config --libs $opengl_pkgs) $x11_libs"
+ opengl=yes
else
- if test "$glx" = "yes" ; then
- feature_not_found "glx" "Install GL devel (e.g. MESA)"
+ if test "$opengl" = "yes" ; then
+ feature_not_found "opengl" "Install GL devel (e.g. MESA)"
fi
- glx_libs=
- glx=no
+ opengl_cflags=""
+ opengl_libs=""
+ opengl=no
fi
fi
echo "nss used $smartcard_nss"
echo "libusb $libusb"
echo "usb net redir $usb_redir"
-echo "GLX support $glx"
+echo "OpenGL support $opengl"
echo "libiscsi support $libiscsi"
echo "libnfs support $libnfs"
echo "build guest agent $guest_agent"
echo "CONFIG_USB_REDIR=y" >> $config_host_mak
fi
-if test "$glx" = "yes" ; then
- echo "CONFIG_GLX=y" >> $config_host_mak
- echo "GLX_LIBS=$glx_libs" >> $config_host_mak
+if test "$opengl" = "yes" ; then
+ echo "CONFIG_OPENGL=y" >> $config_host_mak
+ echo "OPENGL_CFLAGS=$opengl_cflags" >> $config_host_mak
+ echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
fi
if test "$lzo" = "yes" ; then