diff test/configure.in @ 0:74212992fb08

Initial revision
author Sam Lantinga <slouken@lokigames.com>
date Thu, 26 Apr 2001 16:45:43 +0000
parents
children fba28d77901f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/configure.in	Thu Apr 26 16:45:43 2001 +0000
@@ -0,0 +1,86 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(README)
+
+dnl Setup for automake
+SDL_VERSION=1.2.0
+AM_INIT_AUTOMAKE(SDL_tests, $SDL_VERSION)
+
+dnl Detect the canonical host and target build environment
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
+dnl Check for tools
+
+AC_PROG_CC
+
+dnl Check for compiler environment
+
+AC_C_CONST
+
+dnl Figure out which math library to use
+case "$target" in
+    *-*-cygwin* | *-*-mingw32*)
+        MATHLIB=""
+        SYS_GL_LIBS="-lopengl32"
+        ;;
+    *-*-beos*)
+        MATHLIB=""
+        SYS_GL_LIBS="-lGL"
+        ;;
+    *-*-darwin*)
+        MATHLIB=""
+        SYS_GL_LIBS=""
+        ;;
+    *-*-aix*)
+        if test x$ac_cv_prog_gcc = xyes; then
+            CFLAGS="-mthreads"
+	fi
+        SYS_GL_LIBS=""
+        ;;
+    *)
+        MATHLIB="-lm"
+        AC_PATH_X
+        AC_PATH_XTRA
+        if test x$have_x = xyes; then
+            CFLAGS="$CFLAGS $X_CFLAGS"
+            SYS_GL_LIBS="$X_LIBS -lGL"
+        else
+            SYS_GL_LIBS="-lGL"
+        fi
+        ;;
+esac
+AC_SUBST(MATHLIB)
+
+dnl Check for SDL
+
+AM_PATH_SDL($SDL_VERSION,
+            :,
+	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
+)
+CFLAGS="$CFLAGS $SDL_CFLAGS"
+LIBS="$LIBS $SDL_LIBS"
+
+dnl Check for OpenGL
+AC_MSG_CHECKING(for OpenGL support)
+have_opengl=no
+AC_TRY_COMPILE([
+ #if defined(__APPLE__) && defined(__MACH__)
+ #include <OpenGL/gl.h>
+ #else
+ #include <GL/gl.h>
+ #endif
+],[
+],[
+have_opengl=yes
+])
+AC_MSG_RESULT($have_opengl)
+if test x$have_opengl = xyes; then
+    CFLAGS="$CFLAGS -DHAVE_OPENGL"
+    GL_LIBS="$SYS_GL_LIBS"
+else
+    GL_LIBS=""
+fi
+AC_SUBST(GL_LIBS)
+
+# Finally create all the generated files
+AC_OUTPUT([Makefile])