test/configure.in
author Sam Lantinga <slouken@libsdl.org>
Wed, 04 Mar 2009 15:10:47 +0000
changeset 3087 0b6f51c29267
parent 2138 9af6717e676a
child 3090 37f9304df6a9
permissions -rw-r--r--
Date: Wed, 4 Mar 2009 15:38:22 +0200
From: "Mike Gorchak"
Subject: Re: About QNX support in SDL 1.3

Here is another batch of patches.

1) Makefile.in - added SDL_opengles.h header as header to install.
2) configure.in - Added special define to detect Common Lite OpenGL ES
library in case if Common library is not installed. Added check for
clock_gettime in libc (in QNX it is in libc).
3) SDL_config.h.in - Added SDL_VIDEO_RENDER_OPENGL_ES and
SDL_VIDEO_OPENGL_ES declarations for configure script autodetection.
4) SDL_opengles.h - Added GL_API definition if it is not defined. Added
extension GL_OES_draw_texture because OpenGL ES Renderer uses it without
declaration. Added GL_OES_vertex_buffer_object extension, which is supported
under QNX OpenGL ES. Added GL_OES_single_precision extension.
5) To the test directory I've added building OpenGL ES test applications
through the autotools suite. Was support for iPhone IDE building only.
     1 dnl Process this file with autoconf to produce a configure script.
     2 AC_INIT(README)
     3 
     4 dnl Detect the canonical build and host environments
     5 AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
     6 AC_CANONICAL_HOST
     7 
     8 dnl Check for tools
     9 
    10 AC_PROG_CC
    11 
    12 dnl Check for compiler environment
    13 
    14 AC_C_CONST
    15 
    16 dnl Figure out which math library to use
    17 case "$host" in
    18     *-*-cygwin* | *-*-mingw32*)
    19         EXE=".exe"
    20         MATHLIB=""
    21         SYS_GL_LIBS="-lopengl32"
    22         ;;
    23     *-*-beos*)
    24         EXE=""
    25         MATHLIB=""
    26         SYS_GL_LIBS="-lGL"
    27         ;;
    28     *-*-darwin* )
    29         EXE=""
    30         MATHLIB=""
    31         SYS_GL_LIBS="-Wl,-framework,OpenGL"
    32         ;;
    33     *-*-aix*)
    34         EXE=""
    35         if test x$ac_cv_prog_gcc = xyes; then
    36             CFLAGS="-mthreads"
    37         fi
    38         SYS_GL_LIBS=""
    39         ;;
    40     *-*-mint*)
    41         EXE=""
    42         MATHLIB=""
    43         AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
    44         if test "x$OSMESA_CONFIG" = "xyes"; then
    45             OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
    46             OSMESA_LIBS=`$OSMESA_CONFIG --libs`
    47             CFLAGS="$CFLAGS $OSMESA_CFLAGS"
    48             SYS_GL_LIBS="$OSMESA_LIBS"
    49         else
    50             SYS_GL_LIBS="-lOSMesa"
    51         fi
    52         ;;
    53     *-*-qnx*)
    54         EXE=""
    55         MATHLIB=""
    56         SYS_GL_LIBS="-lGLES_CM"
    57         ;;
    58     *)
    59         EXE=""
    60         MATHLIB="-lm"
    61         SYS_GL_LIBS="-lGL"
    62         ;;
    63 esac
    64 AC_SUBST(EXE)
    65 AC_SUBST(MATHLIB)
    66 
    67 dnl Check for SDL
    68 SDL_VERSION=1.3.0
    69 AM_PATH_SDL($SDL_VERSION,
    70             :,
    71 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    72 )
    73 CFLAGS="$CFLAGS $SDL_CFLAGS"
    74 LIBS="$LIBS $SDL_LIBS"
    75 
    76 dnl Check for X11 path, needed for OpenGL on some systems
    77 AC_PATH_X
    78 if test x$have_x = xyes; then
    79     if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
    80         :
    81     else
    82         CFLAGS="$CFLAGS -I$ac_x_includes"
    83     fi
    84     if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
    85         :
    86     else
    87         XPATH="-L$ac_x_libraries"
    88     fi
    89 fi
    90 
    91 dnl Check for OpenGL
    92 AC_MSG_CHECKING(for OpenGL support)
    93 have_opengl=no
    94 AC_TRY_COMPILE([
    95  #include "SDL_opengl.h"
    96 ],[
    97 ],[
    98 have_opengl=yes
    99 ])
   100 AC_MSG_RESULT($have_opengl)
   101 if test x$have_opengl = xyes; then
   102     CFLAGS="$CFLAGS -DHAVE_OPENGL"
   103     GLLIB="$XPATH $SYS_GL_LIBS"
   104 else
   105     GLLIB=""
   106 fi
   107 
   108 dnl Check for OpenGL ES
   109 AC_MSG_CHECKING(for OpenGL ES support)
   110 have_opengles=no
   111 AC_TRY_COMPILE([
   112  #if defined (__QNXNTO__)
   113     #include <GLES/gl.h>
   114  #elif defined (__IPHONEOS__)
   115     #include <OpenGLES/ES1/gl.h>
   116  #else
   117     #error "No OpenGL ES support"
   118  #endif /* __QNXNTO__ */
   119 ],[
   120 ],[
   121 have_opengles=yes
   122 ])
   123 AC_MSG_RESULT($have_opengles)
   124 if test x$have_opengles = xyes; then
   125     CFLAGS="$CFLAGS -DHAVE_OPENGLES"
   126     GLLIB="$XPATH $SYS_GL_LIBS"
   127 else
   128     GLLIB=""
   129 fi
   130 
   131 AC_SUBST(GLLIB)
   132 
   133 dnl Finally create all the generated files
   134 AC_OUTPUT([Makefile])