test/configure.in
author Jørgen P. Tjernø <jorgen@valvesoftware.com>
Wed, 05 Jun 2013 12:48:44 -0700
changeset 7277 1290cd7f34af
parent 6785 c094c438c0a6
child 7495 c4ba5e5c2765
permissions -rw-r--r--
Mac: Fix invalid PS3 controller mapping.

PS3 controller had swapped D-Pad down & left buttons, as well as X & Y buttons.
Thanks to Alex Szpakowski for the bug report and fix.

Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1891
     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 We only care about this for building testnative at the moment, so these
    17 dnl  values shouldn't be considered absolute truth.
    18 dnl  (BeOS, for example, sets none of these.)
    19 ISUNIX="false"
    20 ISWINDOWS="false"
    21 ISMACOSX="false"
    22 
    23 dnl Figure out which math library to use
    24 case "$host" in
    25     *-*-cygwin* | *-*-mingw32*)
    26         ISWINDOWS="true"
    27         EXE=".exe"
    28         MATHLIB=""
    29         SYS_GL_LIBS="-lopengl32"
    30         ;;
    31     *-*-beos* | *-*-haiku*)
    32         EXE=""
    33         MATHLIB=""
    34         SYS_GL_LIBS="-lGL"
    35         ;;
    36     *-*-darwin* )
    37         ISMACOSX="true"
    38         EXE=""
    39         MATHLIB=""
    40         SYS_GL_LIBS="-Wl,-framework,OpenGL"
    41         ;;
    42     *-*-aix*)
    43         ISUNIX="true"
    44         EXE=""
    45         if test x$ac_cv_prog_gcc = xyes; then
    46             CFLAGS="-mthreads"
    47         fi
    48         SYS_GL_LIBS=""
    49         ;;
    50     *-*-mint*)
    51         EXE=""
    52         MATHLIB=""
    53         AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
    54         if test "x$OSMESA_CONFIG" = "xyes"; then
    55             OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
    56             OSMESA_LIBS=`$OSMESA_CONFIG --libs`
    57             CFLAGS="$CFLAGS $OSMESA_CFLAGS"
    58             SYS_GL_LIBS="$OSMESA_LIBS"
    59         else
    60             SYS_GL_LIBS="-lOSMesa"
    61         fi
    62         ;;
    63     *-*-qnx*)
    64         EXE=""
    65         MATHLIB=""
    66         SYS_GL_LIBS="-lGLES_CM"
    67         ;;
    68     *)
    69         dnl Oh well, call it Unix...
    70         ISUNIX="true"
    71         EXE=""
    72         MATHLIB="-lm"
    73         SYS_GL_LIBS="-lGL"
    74         ;;
    75 esac
    76 AC_SUBST(EXE)
    77 AC_SUBST(MATHLIB)
    78 AC_SUBST(ISMACOSX)
    79 AC_SUBST(ISWINDOWS)
    80 AC_SUBST(ISUNIX)
    81 
    82 dnl Check for SDL
    83 SDL_VERSION=2.0.0
    84 AM_PATH_SDL2($SDL_VERSION,
    85             :,
    86 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    87 )
    88 CFLAGS="$CFLAGS $SDL_CFLAGS"
    89 LIBS="$LIBS -lSDL2_test $SDL_LIBS"
    90 
    91 dnl Check for X11 path, needed for OpenGL on some systems
    92 AC_PATH_X
    93 if test x$have_x = xyes; then
    94     if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
    95         :
    96     else
    97         CFLAGS="$CFLAGS -I$ac_x_includes"
    98     fi
    99     if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
   100         :
   101     else
   102         XPATH="-L$ac_x_libraries"
   103     fi
   104 fi
   105 
   106 dnl Check for OpenGL
   107 AC_MSG_CHECKING(for OpenGL support)
   108 have_opengl=no
   109 AC_TRY_COMPILE([
   110  #include "SDL_opengl.h"
   111 ],[
   112 ],[
   113 have_opengl=yes
   114 ])
   115 AC_MSG_RESULT($have_opengl)
   116 
   117 dnl Check for OpenGL ES
   118 AC_MSG_CHECKING(for OpenGL ES support)
   119 have_opengles=no
   120 AC_TRY_COMPILE([
   121  #if defined (__IPHONEOS__)
   122     #include <OpenGLES/ES1/gl.h>
   123  #else
   124     #include <GLES/gl.h>
   125  #endif /* __QNXNTO__ */
   126 ],[
   127 ],[
   128 have_opengles=yes
   129 ])
   130 AC_MSG_RESULT($have_opengles)
   131 
   132 GLLIB=""
   133 if test x$have_opengles = xyes; then
   134     CFLAGS="$CFLAGS -DHAVE_OPENGLES"
   135     GLLIB="$XPATH -lGLESv1_CM"
   136 elif test x$have_opengl = xyes; then
   137     CFLAGS="$CFLAGS -DHAVE_OPENGL"
   138     GLLIB="$XPATH $SYS_GL_LIBS"
   139 else
   140     GLLIB=""
   141 fi
   142 
   143 AC_SUBST(GLLIB)
   144 
   145 dnl Check for SDL_ttf
   146 AC_CHECK_LIB(SDL2_ttf, TTF_Init, have_SDL_ttf=yes)
   147 if test x$have_SDL_ttf = xyes; then
   148     CFLAGS="$CFLAGS -DHAVE_SDL_TTF"
   149     SDL_TTF_LIB="-lSDL2_ttf"
   150 fi
   151 AC_SUBST(SDL_TTF_LIB)
   152 
   153 dnl Finally create all the generated files
   154 AC_OUTPUT([Makefile])