if [ "$OPENGL" = no ]; then
  OPENGL_SUPPORT="no"
else
  OPENGL_SUPPORT="yes"
fi

if [ "$OPENGLES" = no ]; then
  OPENGLES_SUPPORT="no"
else
  OPENGLES_SUPPORT="yes"
fi

get_graphicdrivers() {
  if [ "$GRAPHIC_DRIVERS" = "all" ]; then
    GRAPHIC_DRIVERS="i915 i965 r200 r300 r600 nvidia"
  fi

  for drv in $GRAPHIC_DRIVERS; do
    if [ "$drv" = "i915" ]; then
      DRI_DRIVERS="$DRI_DRIVERS,i915"
      XORG_DRIVERS="$XORG_DRIVERS intel"
      COMPOSITE_SUPPORT="yes"
      VAAPI_SUPPORT="yes"
    fi

    if [ "$drv" = "i965" ]; then
      DRI_DRIVERS="$DRI_DRIVERS,i965"
      XORG_DRIVERS="$XORG_DRIVERS intel"
      COMPOSITE_SUPPORT="yes"
      VAAPI_SUPPORT="yes"
    fi

    if [ "$drv" = "nvidia" ]; then
      XORG_DRIVERS="$XORG_DRIVERS nvidia"
      VDPAU_SUPPORT="yes"
    fi

    if [ "$drv" = "nvidia-legacy" ]; then
      XORG_DRIVERS="$XORG_DRIVERS nvidia-legacy"
      VDPAU_SUPPORT="yes"
    fi

    if [ "$drv" = "r200" ]; then
      DRI_DRIVERS="$DRI_DRIVERS,r200"
      XORG_DRIVERS="$XORG_DRIVERS ati"
      COMPOSITE_SUPPORT="yes"
    fi

    if [ "$drv" = "r300" ]; then
      GALLIUM_DRIVERS="$GALLIUM_DRIVERS,r300"
      XORG_DRIVERS="$XORG_DRIVERS ati"
      LLVM_SUPPORT="yes"
      COMPOSITE_SUPPORT="yes"
      VDPAU_SUPPORT="yes"
    fi

    if [ "$drv" = "r600" ]; then
      GALLIUM_DRIVERS="$GALLIUM_DRIVERS,r600"
      XORG_DRIVERS="$XORG_DRIVERS ati"
      LLVM_SUPPORT="yes"
      COMPOSITE_SUPPORT="yes"
      VDPAU_SUPPORT="yes"
    fi

    if [ "$drv" = "radeonsi" ]; then
      GALLIUM_DRIVERS="$GALLIUM_DRIVERS,radeonsi"
      XORG_DRIVERS="$XORG_DRIVERS ati"
      LLVM_SUPPORT="yes"
      COMPOSITE_SUPPORT="yes"
      VDPAU_SUPPORT="yes"
    fi

  done
}
