test/configure.in
author Cameron Cawley <ccawley2011@gmail.com>
Fri, 17 Aug 2018 23:36:17 +0100
branchSDL-1.2
changeset 12777 75aa8b37873d
parent 4229 68ee433ec474
permissions -rw-r--r--
riscos: Support compiling the test programs
slouken@0
     1
dnl Process this file with autoconf to produce a configure script.
slouken@0
     2
AC_INIT(README)
slouken@0
     3
slouken@1550
     4
dnl Detect the canonical build and host environments
slouken@1380
     5
AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
slouken@1550
     6
AC_CANONICAL_HOST
slouken@0
     7
slouken@0
     8
dnl Check for tools
slouken@0
     9
slouken@0
    10
AC_PROG_CC
slouken@0
    11
slouken@0
    12
dnl Check for compiler environment
slouken@0
    13
slouken@0
    14
AC_C_CONST
slouken@0
    15
slouken@0
    16
dnl Figure out which math library to use
slouken@1550
    17
case "$host" in
slouken@0
    18
    *-*-cygwin* | *-*-mingw32*)
slouken@1380
    19
        EXE=".exe"
slouken@0
    20
        MATHLIB=""
slouken@0
    21
        SYS_GL_LIBS="-lopengl32"
slouken@0
    22
        ;;
slouken@4164
    23
    *-*-beos* | *-*-haiku*)
slouken@1380
    24
        EXE=""
slouken@0
    25
        MATHLIB=""
slouken@0
    26
        SYS_GL_LIBS="-lGL"
slouken@0
    27
        ;;
patmandin@991
    28
    *-*-darwin* )
slouken@1380
    29
        EXE=""
slouken@0
    30
        MATHLIB=""
slouken@4229
    31
        SYS_GL_LIBS="-Wl,-framework,OpenGL"
slouken@0
    32
        ;;
slouken@0
    33
    *-*-aix*)
slouken@1380
    34
        EXE=""
slouken@0
    35
        if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    36
            CFLAGS="-mthreads"
patmandin@978
    37
        fi
slouken@0
    38
        SYS_GL_LIBS=""
slouken@0
    39
        ;;
patmandin@991
    40
    *-*-mint*)
slouken@1380
    41
        EXE=""
patmandin@991
    42
        MATHLIB=""
patmandin@991
    43
        AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
patmandin@991
    44
        if test "x$OSMESA_CONFIG" = "xyes"; then
patmandin@991
    45
            OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
patmandin@991
    46
            OSMESA_LIBS=`$OSMESA_CONFIG --libs`
patmandin@991
    47
            CFLAGS="$CFLAGS $OSMESA_CFLAGS"
patmandin@991
    48
            SYS_GL_LIBS="$OSMESA_LIBS"
patmandin@991
    49
        else
patmandin@991
    50
            SYS_GL_LIBS="-lOSMesa"
patmandin@991
    51
        fi
patmandin@991
    52
		;;
ccawley2011@12777
    53
    *-*-riscos*)
ccawley2011@12777
    54
	EXE=",e1f"
ccawley2011@12777
    55
	MATHLIB=""
ccawley2011@12777
    56
	SYS_GL_LIBS=""
ccawley2011@12777
    57
	;;
slouken@0
    58
    *)
slouken@1380
    59
        EXE=""
slouken@0
    60
        MATHLIB="-lm"
slouken@1380
    61
        SYS_GL_LIBS="-lGL"
slouken@0
    62
        ;;
slouken@0
    63
esac
slouken@1380
    64
AC_SUBST(EXE)
slouken@0
    65
AC_SUBST(MATHLIB)
slouken@0
    66
slouken@0
    67
dnl Check for SDL
slouken@1387
    68
SDL_VERSION=1.2.10
slouken@0
    69
AM_PATH_SDL($SDL_VERSION,
slouken@0
    70
            :,
slouken@0
    71
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@0
    72
)
slouken@0
    73
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    74
LIBS="$LIBS $SDL_LIBS"
slouken@0
    75
slouken@3990
    76
dnl Check for X11 path, needed for OpenGL on some systems
slouken@3990
    77
AC_PATH_X
slouken@3990
    78
if test x$have_x = xyes; then
slouken@3990
    79
    if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
slouken@3990
    80
        :
slouken@3990
    81
    else
slouken@3990
    82
        CFLAGS="$CFLAGS -I$ac_x_includes"
slouken@3990
    83
    fi
slouken@3990
    84
    if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
slouken@3990
    85
        :
slouken@3990
    86
    else
slouken@3990
    87
        XPATH="-L$ac_x_libraries"
slouken@3990
    88
    fi
slouken@3990
    89
fi
slouken@3990
    90
slouken@0
    91
dnl Check for OpenGL
slouken@0
    92
AC_MSG_CHECKING(for OpenGL support)
slouken@0
    93
have_opengl=no
slouken@0
    94
AC_TRY_COMPILE([
slouken@292
    95
 #include "SDL_opengl.h"
slouken@0
    96
],[
slouken@0
    97
],[
slouken@0
    98
have_opengl=yes
slouken@0
    99
])
slouken@0
   100
AC_MSG_RESULT($have_opengl)
slouken@0
   101
if test x$have_opengl = xyes; then
slouken@0
   102
    CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@3990
   103
    GLLIB="$XPATH $SYS_GL_LIBS"
slouken@0
   104
else
slouken@1380
   105
    GLLIB=""
slouken@0
   106
fi
slouken@1380
   107
AC_SUBST(GLLIB)
slouken@0
   108
slouken@1380
   109
dnl Finally create all the generated files
slouken@0
   110
AC_OUTPUT([Makefile])