test/configure.in
author Ryan C. Gordon <icculus@icculus.org>
Thu, 14 Nov 2013 11:51:24 -0500
changeset 7981 6d538bc1b395
parent 7828 1451063c8ecd
child 8014 0a4b6dec7de5
permissions -rw-r--r--
Renamed things named after BeOS to be named after Haiku instead.
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
icculus@6390
    16
dnl We only care about this for building testnative at the moment, so these
icculus@6390
    17
dnl  values shouldn't be considered absolute truth.
icculus@7981
    18
dnl  (Haiku, for example, sets none of these.)
icculus@6390
    19
ISUNIX="false"
icculus@6390
    20
ISWINDOWS="false"
icculus@6390
    21
ISMACOSX="false"
icculus@6390
    22
slouken@0
    23
dnl Figure out which math library to use
slouken@1550
    24
case "$host" in
slouken@0
    25
    *-*-cygwin* | *-*-mingw32*)
icculus@6390
    26
        ISWINDOWS="true"
slouken@1380
    27
        EXE=".exe"
slouken@0
    28
        MATHLIB=""
slouken@0
    29
        SYS_GL_LIBS="-lopengl32"
slouken@0
    30
        ;;
icculus@7981
    31
    *-*-haiku*)
slouken@1380
    32
        EXE=""
slouken@0
    33
        MATHLIB=""
slouken@0
    34
        SYS_GL_LIBS="-lGL"
slouken@0
    35
        ;;
patmandin@991
    36
    *-*-darwin* )
icculus@6390
    37
        ISMACOSX="true"
slouken@1380
    38
        EXE=""
slouken@0
    39
        MATHLIB=""
icculus@3623
    40
        SYS_GL_LIBS="-Wl,-framework,OpenGL"
slouken@0
    41
        ;;
slouken@0
    42
    *-*-aix*)
icculus@6390
    43
        ISUNIX="true"
slouken@1380
    44
        EXE=""
slouken@0
    45
        if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    46
            CFLAGS="-mthreads"
patmandin@978
    47
        fi
slouken@0
    48
        SYS_GL_LIBS=""
slouken@0
    49
        ;;
patmandin@991
    50
    *-*-mint*)
slouken@1380
    51
        EXE=""
patmandin@991
    52
        MATHLIB=""
patmandin@991
    53
        AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
patmandin@991
    54
        if test "x$OSMESA_CONFIG" = "xyes"; then
patmandin@991
    55
            OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
patmandin@991
    56
            OSMESA_LIBS=`$OSMESA_CONFIG --libs`
patmandin@991
    57
            CFLAGS="$CFLAGS $OSMESA_CFLAGS"
patmandin@991
    58
            SYS_GL_LIBS="$OSMESA_LIBS"
patmandin@991
    59
        else
patmandin@991
    60
            SYS_GL_LIBS="-lOSMesa"
patmandin@991
    61
        fi
slouken@3087
    62
        ;;
slouken@3087
    63
    *-*-qnx*)
slouken@3087
    64
        EXE=""
slouken@3087
    65
        MATHLIB=""
slouken@3087
    66
        SYS_GL_LIBS="-lGLES_CM"
slouken@3087
    67
        ;;
slouken@0
    68
    *)
icculus@6390
    69
        dnl Oh well, call it Unix...
icculus@6390
    70
        ISUNIX="true"
slouken@1380
    71
        EXE=""
slouken@0
    72
        MATHLIB="-lm"
slouken@1380
    73
        SYS_GL_LIBS="-lGL"
slouken@0
    74
        ;;
slouken@0
    75
esac
slouken@1380
    76
AC_SUBST(EXE)
slouken@0
    77
AC_SUBST(MATHLIB)
icculus@6390
    78
AC_SUBST(ISMACOSX)
icculus@6390
    79
AC_SUBST(ISWINDOWS)
icculus@6390
    80
AC_SUBST(ISUNIX)
slouken@0
    81
slouken@0
    82
dnl Check for SDL
slouken@6250
    83
SDL_VERSION=2.0.0
slouken@6272
    84
AM_PATH_SDL2($SDL_VERSION,
slouken@0
    85
            :,
slouken@0
    86
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@0
    87
)
slouken@0
    88
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@7828
    89
LIBS="$LIBS -lSDL2_test $SDL_LIBS"
slouken@0
    90
slouken@2138
    91
dnl Check for X11 path, needed for OpenGL on some systems
slouken@2138
    92
AC_PATH_X
slouken@2138
    93
if test x$have_x = xyes; then
gabomdq@7794
    94
    if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone || test "x$ac_x_includes" = x; then
slouken@2138
    95
        :
slouken@2138
    96
    else
slouken@2138
    97
        CFLAGS="$CFLAGS -I$ac_x_includes"
slouken@2138
    98
    fi
gabomdq@7703
    99
    if test x$ac_x_libraries = xno || test "x$ac_x_libraries" = xNone; then
slouken@2138
   100
        :
slouken@2138
   101
    else
gabomdq@7704
   102
        if test "x$ac_x_libraries" = x; then
gabomdq@7794
   103
            XPATH=""
gabomdq@7704
   104
            XLIB="-lX11"
gabomdq@7704
   105
        else
gabomdq@7794
   106
            XPATH="-L$ac_x_libraries"
gabomdq@7704
   107
            XLIB="-L$ac_x_libraries -lX11"
gabomdq@7704
   108
        fi
slouken@2138
   109
    fi
slouken@2138
   110
fi
slouken@2138
   111
slouken@0
   112
dnl Check for OpenGL
slouken@0
   113
AC_MSG_CHECKING(for OpenGL support)
slouken@0
   114
have_opengl=no
slouken@0
   115
AC_TRY_COMPILE([
slouken@292
   116
 #include "SDL_opengl.h"
slouken@0
   117
],[
slouken@0
   118
],[
slouken@0
   119
have_opengl=yes
slouken@0
   120
])
slouken@0
   121
AC_MSG_RESULT($have_opengl)
slouken@3087
   122
slouken@3087
   123
dnl Check for OpenGL ES
slouken@3087
   124
AC_MSG_CHECKING(for OpenGL ES support)
slouken@3087
   125
have_opengles=no
slouken@3087
   126
AC_TRY_COMPILE([
slouken@6188
   127
 #if defined (__IPHONEOS__)
slouken@3087
   128
    #include <OpenGLES/ES1/gl.h>
slouken@3087
   129
 #else
slouken@6188
   130
    #include <GLES/gl.h>
slouken@3087
   131
 #endif /* __QNXNTO__ */
slouken@3087
   132
],[
slouken@3087
   133
],[
slouken@3087
   134
have_opengles=yes
slouken@3087
   135
])
slouken@3087
   136
AC_MSG_RESULT($have_opengles)
slouken@3090
   137
slouken@6188
   138
GLLIB=""
gabomdq@7794
   139
GLESLIB=""
slouken@6188
   140
if test x$have_opengles = xyes; then
slouken@6188
   141
    CFLAGS="$CFLAGS -DHAVE_OPENGLES"
gabomdq@7794
   142
    GLESLIB="$XPATH -lGLESv1_CM"
gabomdq@7794
   143
fi
gabomdq@7794
   144
if test x$have_opengl = xyes; then
slouken@3090
   145
    CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@3090
   146
    GLLIB="$XPATH $SYS_GL_LIBS"
slouken@3087
   147
fi
slouken@3087
   148
slouken@1380
   149
AC_SUBST(GLLIB)
gabomdq@7794
   150
AC_SUBST(GLESLIB)
slouken@7495
   151
AC_SUBST(XLIB)
slouken@0
   152
slouken@3280
   153
dnl Check for SDL_ttf
slouken@6598
   154
AC_CHECK_LIB(SDL2_ttf, TTF_Init, have_SDL_ttf=yes)
slouken@3280
   155
if test x$have_SDL_ttf = xyes; then
slouken@3280
   156
    CFLAGS="$CFLAGS -DHAVE_SDL_TTF"
slouken@6598
   157
    SDL_TTF_LIB="-lSDL2_ttf"
slouken@3280
   158
fi
slouken@3280
   159
AC_SUBST(SDL_TTF_LIB)
slouken@3280
   160
slouken@1380
   161
dnl Finally create all the generated files
slouken@0
   162
AC_OUTPUT([Makefile])