aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorAlejandro Marzini2010-08-04 03:42:53 +0000
committerAlejandro Marzini2010-08-04 03:42:53 +0000
commiteff862290b337ab6935b4c284ba1b0c0200c1e95 (patch)
treeaccd945650c0a6cb8c5d56d69f28a05377f1d3f8 /configure
parent8fa456852f45a95134756f64740de6721c231673 (diff)
downloadscummvm-rg350-eff862290b337ab6935b4c284ba1b0c0200c1e95.tar.gz
scummvm-rg350-eff862290b337ab6935b4c284ba1b0c0200c1e95.tar.bz2
scummvm-rg350-eff862290b337ab6935b4c284ba1b0c0200c1e95.zip
OPENGL: Improved OpenGL auto detection.
svn-id: r51720
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure55
1 files changed, 26 insertions, 29 deletions
diff --git a/configure b/configure
index 077780231b..534ed60fac 100755
--- a/configure
+++ b/configure
@@ -1382,8 +1382,6 @@ case $_host_os in
DEFINES="$DEFINES -DMACOSX"
CXXFLAGS="$CXXFLAGS"
LIBS="$LIBS -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
- OPENGL_CFLAGS="-I/System/Library/Frameworks/OpenGL.framework/Headers"
- OPENGL_LIBS="-framework OpenGL"
add_line_to_config_mk 'MACOSX = 1'
_unix=yes
;;
@@ -1428,8 +1426,6 @@ case $_host_os in
DEFINES="$DEFINES -DWIN32 -D__USE_MINGW_ANSI_STDIO=0"
LIBS="$LIBS -lmingw32 -lwinmm"
OBJS="$OBJS scummvmico.o"
- OPENGL_CFLAGS=""
- OPENGL_LIBS="-lopengl32"
add_line_to_config_mk 'WIN32 = 1'
;;
mint*)
@@ -1487,18 +1483,6 @@ case $_host_os in
;;
esac
-# HACK: On non-OSX systems and no mingw compiler, add the GL library if using sdl backend
-if test "$_backend" = "sdl" ; then
- case $_host_os in
- *darwin*)
- ;;
- *mingw*)
- ;;
- *)
- OPENGL_LIBS="$OPENGL_LIBS -lGL"
- esac
-fi
-
if test -n "$_host"; then
# Cross-compiling mode - add your target here if needed
echo "Cross-compiling to $_host"
@@ -2314,31 +2298,44 @@ define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE'
echocheck "OpenGL (ES)"
if test "$_opengl" = auto ; then
_opengl=no
- cat > $TMPC << EOF
-#if defined(MACOSX)
-#include <OpenGL/gl.h>
-#else
-#if defined(__WIN32__)
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
+ if test "$_backend" = "sdl" ; then
+ case $_host_os in
+ *darwin*)
+ _opengl=yes
+ ;;
+ *mingw*)
+ _opengl=yes
+ ;;
+ *)
+ cat > $TMPC << EOF
#include <GL/gl.h>
-#endif
int main(void) { return GL_VERSION_1_1; }
EOF
- cc_check $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS && _opengl=yes
+ cc_check $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS -lGL && _opengl=yes
+ esac
+ fi
fi
if test "$_opengl" = yes ; then
- _def_opengl='#define USE_OPENGL'
LIBS="$LIBS $OPENGL_LIBS"
INCLUDES="$INCLUDES $OPENGL_CFLAGS"
DEFINES="$DEFINES -DUSE_OPENGL"
-else
- _def_opengl='#undef USE_OPENGL'
+ case $_host_os in
+ *darwin*)
+ INCLUDES="$INCLUDES -I/System/Library/Frameworks/OpenGL.framework/Headers"
+ LIBS="$LIBS -framework OpenGL"
+ ;;
+ *mingw*)
+ LIBS="$LIBS -lopengl32"
+ ;;
+ *)
+ LIBS="$LIBS -lGL"
+ esac
fi
echo "$_opengl"
+define_in_config_if_yes "$_opengl" 'USE_OPENGL'
+
#
# Check for nasm
#