VirtualBox

Changeset 17912 in vbox


Ignore:
Timestamp:
Mar 16, 2009 10:48:01 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
44474
Message:

configure: check for OpenGL stuff

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r17826 r17912  
    355355 VBOX_WITH_CROGL = 1
    356356endif
    357 # Enable OpenGL service
    358 VBOX_WITH_OGL = 1
    359357# Enable shared folders
    360358VBOX_WITH_SHARED_FOLDERS = 1
  • trunk/configure

    r17551 r17912  
    44
    55#
    6 # Copyright (C) 2006-2007 Sun Microsystems, Inc.
     6# Copyright (C) 2006-2009 Sun Microsystems, Inc.
    77#
    88# This file is part of VirtualBox Open Source Edition (OSE), as
     
    6868WITH_DBUS=1
    6969WITH_KMODS=1
     70WITH_OPENGL=1
    7071WITH_HARDENING=1
    7172CC="gcc"
     
    9293INCX11="/usr/local/include"
    9394LIBXCURSOR="-lXcursor"
     95LIBXMU="-lXmu"
     96MESA="-lGL"
    9497INCZ=""
    9598LIBZ="-lz"
     
    216219
    217220# Compile a test
     221#  $1   compile flags/libs
     222#  $2   library name
     223#  $3   package name
     224#  $4   if this argument is 'nofatal', don't abort
    218225test_compile()
    219226{
     
    11311138
    11321139#
     1140# Check for the X libraries (Xext, X11)
     1141#
     1142check_x()
     1143{
     1144  test_header "X libraries"
     1145  cat > $ODIR.tmp_src.cc << EOF
     1146#include <cstdio>
     1147#include <X11/Xlib.h>
     1148extern "C" int main(void)
     1149{
     1150  Display *dpy;
     1151  int scrn_num;
     1152  Screen *scrn;
     1153  Window win;
     1154
     1155  dpy      = XOpenDisplay(NULL);
     1156  scrn_num = DefaultScreen(dpy);
     1157  scrn     = ScreenOfDisplay(dpy, scrn_num);
     1158  win      = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
     1159                           0, 16, InputOutput, CopyFromParent, 0, NULL);
     1160  XDestroyWindow(dpy, win);
     1161}
     1162EOF
     1163  [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
     1164  if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
     1165    log_success "found"
     1166  fi
     1167}
     1168
     1169
     1170#
    11331171# Check for the Xcursor library, needed by VBoxSDL and VBoxBFE
    11341172#
     
    11561194
    11571195#
    1158 # Check for the X libraries (Xext, X11)
    1159 #
    1160 check_x()
    1161 {
    1162   test_header "X libraries"
     1196# Check for the Xmu library, needed by OpenGL
     1197#
     1198check_xmu()
     1199{
     1200  test_header Xmu
     1201  cat > $ODIR.tmp_src.cc << EOF
     1202#include <cstdio>
     1203#include <X11/Xatom.h>
     1204#include <X11/Xlib.h>
     1205#include <X11/Xutil.h>
     1206#include <X11/Xmu/StdCmap.h>
     1207extern "C" int main(void)
     1208{
     1209  Display *dpy;
     1210  int scrn_num;
     1211  Screen *scrn;
     1212
     1213  dpy = XOpenDisplay(NULL);
     1214  scrn_num = DefaultScreen(dpy);
     1215  scrn     = ScreenOfDisplay(dpy, scrn_num);
     1216  Status status = XmuLookupStandardColormap(dpy, RootWindowOfScreen(scrn), 0,
     1217                  24, XA_RGB_DEFAULT_MAP, False, True);
     1218  printf("Status = %x\n", status);
     1219  return 0;
     1220}
     1221EOF
     1222  [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
     1223  if test_compile "$LIBX11 $LIBXMU $I_INCX11" Xmu Xmu; then
     1224    log_success "found"
     1225    cnf_append "VBOX_XMU_LIBS" "`strip_l "$LIBXMU"`"
     1226  fi
     1227}
     1228
     1229
     1230#
     1231# Check for Mesa, needed by OpenGL
     1232#
     1233check_mesa()
     1234{
     1235  test_header "Mesa / GLU"
    11631236  cat > $ODIR.tmp_src.cc << EOF
    11641237#include <cstdio>
    11651238#include <X11/Xlib.h>
     1239#include <GL/glx.h>
     1240#include <GL/glu.h>
    11661241extern "C" int main(void)
    11671242{
    11681243  Display *dpy;
    1169   int scrn_num;
    1170   Screen *scrn;
    1171   Window win;
    1172 
    1173   dpy      = XOpenDisplay(NULL);
    1174   scrn_num = DefaultScreen(dpy);
    1175   scrn     = ScreenOfDisplay(dpy, scrn_num);
    1176   win      = XCreateWindow(dpy, RootWindowOfScreen(scrn), 0, 0, 100, 100,
    1177                            0, 16, InputOutput, CopyFromParent, 0, NULL);
    1178   XDestroyWindow(dpy, win);
     1244  int major, minor;
     1245
     1246  dpy = XOpenDisplay(NULL);
     1247  if (glXQueryVersion(dpy, &major, &minor))
     1248  {
     1249    printf("found version %u.%u, OK.\n", major, minor);
     1250  }
     1251  return 0;
    11791252}
    11801253EOF
    11811254  [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
    1182   if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
    1183     log_success "found"
     1255  if test_compile "$LIBX11 $MESA $I_INCX11" Mesa Mesa; then
     1256    test_execute
    11841257  fi
    11851258}
     
    17371810  --disable-kmods          don't build Linux kernel modules (host and guest)
    17381811  --disable-hardening      don't be strict about /dev/vboxdrv access
     1812  --disable-opengl         disable OpenGL support
    17391813  --enable-webservice      enable the webservice stuff
    17401814  --build-libxml2          build libxml2 from sources
     
    18401914      WITH_KMODS=0
    18411915      ;;
     1916    --disable-opengl)
     1917      WITH_OPENGL=0
     1918      ;;
    18421919    --disable-hardening)
    18431920      WITH_HARDENING=0
     
    18661943      WITH_SDL_TTF=0
    18671944      WITH_X11=0
     1945      WITH_OPENGL=0
    18681946      WITH_QT4=0
    18691947      ;;
     
    19892067fi
    19902068
     2069if [ $WITH_OPENGL -eq 0 ]; then
     2070  cnf_append "VBOX_WITH_CROGL" ""
     2071fi
     2072
    19912073if [ "$OS" = "darwin" ]; then
    19922074  # On Darwin we want to build against Qt4 only. WITH_QT4 is enabled by
     
    20302112[ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf
    20312113[ $WITH_X11    -eq 1 ] && check_x
    2032 # TODO check for Xmu (X11/Xmu/StdCmap.h)
    2033 # TODO check for mesa-common-dev (GL/glx.h)
    2034 # TODO check for libglu1-mesa-dev (GL/glu.h)
    2035 # TODO check for xcomposite-dev (X11/extensions/Xcomposite.h)
    2036 # TODO check for libxdamange-dev (X11/extensions/Xdamage.h)
     2114# TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only)
     2115# TODO check for libxdamange-dev (X11/extensions/Xdamage.h, additions only)
    20372116[ $WITH_X11    -eq 1 ] && check_xcursor
     2117[ $WITH_OPENGL -eq 1 ] && check_xmu
     2118[ $WITH_OPENGL -eq 1 ] && check_mesa
    20382119[ $WITH_QT4    -eq 1 ] && check_qt4
    20392120[ $WITH_PYTHON -eq 1 -a "$OS" != "darwin" ] && check_python
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette