[Scummvm-cvs-logs] SF.net SVN: scummvm:[51720] scummvm/branches/gsoc2010-opengl/configure

vgvgf at users.sourceforge.net vgvgf at users.sourceforge.net
Wed Aug 4 05:42:53 CEST 2010


Revision: 51720
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51720&view=rev
Author:   vgvgf
Date:     2010-08-04 03:42:53 +0000 (Wed, 04 Aug 2010)

Log Message:
-----------
OPENGL: Improved OpenGL auto detection.

Modified Paths:
--------------
    scummvm/branches/gsoc2010-opengl/configure

Modified: scummvm/branches/gsoc2010-opengl/configure
===================================================================
--- scummvm/branches/gsoc2010-opengl/configure	2010-08-04 02:30:22 UTC (rev 51719)
+++ scummvm/branches/gsoc2010-opengl/configure	2010-08-04 03:42:53 UTC (rev 51720)
@@ -1382,8 +1382,6 @@
 		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 @@
 		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 @@
 		;;
 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 @@
 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
 #


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list