configure.in
author Sam Lantinga <slouken@libsdl.org>
Fri, 17 Aug 2007 06:41:20 +0000
changeset 2264 f7f80b822c1f
parent 2261 c20476d7d7b3
child 2271 60b4c52a7906
permissions -rw-r--r--
Enabled SSE2 intrinsics
slouken@0
     1
dnl Process this file with autoconf to produce a configure script.
slouken@0
     2
AC_INIT(README)
slouken@1341
     3
AC_CONFIG_HEADER(include/SDL_config.h)
slouken@1353
     4
AC_GNU_SOURCE
slouken@0
     5
slouken@0
     6
dnl Set various version strings - taken gratefully from the GTk sources
slouken@0
     7
#
slouken@0
     8
# Making releases:
slouken@0
     9
# Edit include/SDL/SDL_version.h and change the version, then:
slouken@0
    10
#   SDL_MICRO_VERSION += 1;
slouken@0
    11
#   SDL_INTERFACE_AGE += 1;
slouken@0
    12
#   SDL_BINARY_AGE += 1;
slouken@0
    13
# if any functions have been added, set SDL_INTERFACE_AGE to 0.
slouken@0
    14
# if backwards compatibility has been broken,
slouken@0
    15
# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
slouken@0
    16
#
slouken@0
    17
SDL_MAJOR_VERSION=1
slouken@1895
    18
SDL_MINOR_VERSION=3
slouken@1895
    19
SDL_MICRO_VERSION=0
slouken@1886
    20
SDL_INTERFACE_AGE=0
slouken@1895
    21
SDL_BINARY_AGE=0
slouken@0
    22
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
slouken@0
    23
slouken@0
    24
AC_SUBST(SDL_MAJOR_VERSION)
slouken@0
    25
AC_SUBST(SDL_MINOR_VERSION)
slouken@0
    26
AC_SUBST(SDL_MICRO_VERSION)
slouken@0
    27
AC_SUBST(SDL_INTERFACE_AGE)
slouken@0
    28
AC_SUBST(SDL_BINARY_AGE)
slouken@0
    29
AC_SUBST(SDL_VERSION)
slouken@0
    30
slouken@0
    31
# libtool versioning
slouken@0
    32
LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
slouken@0
    33
LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
slouken@0
    34
LT_REVISION=$SDL_INTERFACE_AGE
slouken@0
    35
LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
slouken@0
    36
slouken@0
    37
AC_SUBST(LT_RELEASE)
slouken@0
    38
AC_SUBST(LT_CURRENT)
slouken@0
    39
AC_SUBST(LT_REVISION)
slouken@0
    40
AC_SUBST(LT_AGE)
slouken@0
    41
slouken@1550
    42
dnl Detect the canonical build and host environments
slouken@1361
    43
AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
slouken@1550
    44
AC_CANONICAL_HOST
slouken@1354
    45
AC_C_BIGENDIAN
slouken@1354
    46
if test x$ac_cv_c_bigendian = xyes; then
slouken@1354
    47
    AC_DEFINE(SDL_BYTEORDER, 4321)
slouken@1354
    48
else
slouken@1354
    49
    AC_DEFINE(SDL_BYTEORDER, 1234)
slouken@1354
    50
fi
slouken@0
    51
slouken@1389
    52
dnl Set up the compiler and linker flags
slouken@1571
    53
INCLUDE="-I$srcdir/include"
slouken@1373
    54
if test x$srcdir != x.; then
slouken@1742
    55
    # Remove SDL_config.h from the source directory, since it's the
slouken@1742
    56
    # default one, and we want to include the one that we generate.
slouken@1742
    57
    if test -f $srcdir/include/SDL_config.h; then
slouken@1742
    58
        rm $srcdir/include/SDL_config.h
slouken@1742
    59
    fi
slouken@1571
    60
    INCLUDE="-Iinclude $INCLUDE"
slouken@1373
    61
fi
slouken@1550
    62
case "$host" in
slouken@1389
    63
    *-*-cygwin*)
slouken@1389
    64
        # We build SDL on cygwin without the UNIX emulation layer
slouken@1521
    65
        BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
slouken@1521
    66
        BASE_LDFLAGS="-mno-cygwin"
slouken@1389
    67
        ;;
slouken@1389
    68
    *)
slouken@1521
    69
        BASE_CFLAGS="-D_GNU_SOURCE=1"
slouken@1521
    70
        BASE_LDFLAGS=""
slouken@1389
    71
        ;;
slouken@1389
    72
esac
slouken@1648
    73
BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
slouken@1521
    74
EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
slouken@1521
    75
BUILD_LDFLAGS="$LDFLAGS"
slouken@1521
    76
EXTRA_LDFLAGS="$BASE_LDFLAGS"
slouken@2163
    77
## These are common directories to find software packages
slouken@2163
    78
#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
slouken@1823
    79
#    if test -d $path/include; then
slouken@1823
    80
#        EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
slouken@1823
    81
#    fi
slouken@1823
    82
#    if test -d $path/lib; then
slouken@1823
    83
#        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
slouken@1823
    84
#    fi
slouken@1823
    85
#done
slouken@1521
    86
SDL_CFLAGS="$BASE_CFLAGS"
slouken@1521
    87
SDL_LIBS="-lSDL $BASE_LDFLAGS"
slouken@1521
    88
CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
slouken@1521
    89
CFLAGS="$CFLAGS $EXTRA_CFLAGS"
slouken@1521
    90
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
slouken@1373
    91
slouken@0
    92
dnl Check for tools
slouken@0
    93
AC_LIBTOOL_WIN32_DLL
slouken@1361
    94
AC_PROG_LIBTOOL
slouken@0
    95
AC_PROG_CC
slouken@200
    96
AC_PROG_CXX
slouken@0
    97
AC_PROG_INSTALL
slouken@1380
    98
AC_PROG_MAKE_SET
slouken@2206
    99
if test -z "$host_alias"; then
slouken@2206
   100
    hostaliaswindres=
slouken@2206
   101
else
slouken@2206
   102
    hostaliaswindres="$host_alias-windres"
slouken@2206
   103
fi
slouken@2206
   104
AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres])
slouken@1341
   105
slouken@1353
   106
dnl Check for compiler characteristics
slouken@1341
   107
AC_C_CONST
slouken@1341
   108
AC_C_INLINE
slouken@1353
   109
AC_C_VOLATILE
slouken@1353
   110
slouken@1361
   111
dnl See whether we are allowed to use the system C library
slouken@1361
   112
AC_ARG_ENABLE(libc,
slouken@1637
   113
AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
slouken@1361
   114
              , enable_libc=yes)
slouken@1361
   115
if test x$enable_libc = xyes; then
slouken@1361
   116
    AC_DEFINE(HAVE_LIBC)
slouken@1353
   117
slouken@1361
   118
    dnl Check for C library headers
slouken@1361
   119
    AC_HEADER_STDC
slouken@1501
   120
    AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h)
slouken@1361
   121
slouken@1361
   122
    dnl Check for typedefs, structures, etc.
slouken@1361
   123
    AC_TYPE_SIZE_T
slouken@1361
   124
    if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
slouken@1361
   125
        AC_CHECK_TYPE(int64_t)
slouken@1361
   126
        if test x$ac_cv_type_int64_t = xyes; then
slouken@1361
   127
            AC_DEFINE(SDL_HAS_64BIT_TYPE)
slouken@1361
   128
        fi
slouken@1361
   129
        have_inttypes=yes
slouken@1353
   130
    fi
slouken@1361
   131
slouken@1361
   132
    dnl Checks for library functions.
icculus@2079
   133
    case "$host" in
icculus@2079
   134
    *-*-cygwin* | *-*-mingw32*)
icculus@2079
   135
        ;;
icculus@2079
   136
    *)
icculus@2079
   137
        AC_FUNC_ALLOCA
icculus@2079
   138
        ;;
icculus@2079
   139
    esac
icculus@2079
   140
slouken@1361
   141
    AC_FUNC_MEMCMP
slouken@1361
   142
    if test x$ac_cv_func_memcmp_working = xyes; then
slouken@1361
   143
        AC_DEFINE(HAVE_MEMCMP)
slouken@1361
   144
    fi
slouken@1361
   145
    AC_FUNC_STRTOD
slouken@1361
   146
    if test x$ac_cv_func_strtod = xyes; then
slouken@1361
   147
        AC_DEFINE(HAVE_STRTOD)
slouken@1361
   148
    fi
slouken@1512
   149
    AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep)
slouken@1373
   150
slouken@1891
   151
    AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
slouken@1521
   152
    AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
slouken@1361
   153
fi
slouken@1361
   154
slouken@1361
   155
if test x$have_inttypes != xyes; then
slouken@1353
   156
    AC_CHECK_SIZEOF(char, 1)
slouken@1353
   157
    AC_CHECK_SIZEOF(short, 2)
slouken@1353
   158
    AC_CHECK_SIZEOF(int, 4)
slouken@1353
   159
    AC_CHECK_SIZEOF(long, 4)
slouken@1353
   160
    AC_CHECK_SIZEOF(long long, 8)
slouken@1353
   161
    if test x$ac_cv_sizeof_char = x1; then
slouken@1353
   162
        AC_DEFINE(int8_t, signed char)
slouken@1353
   163
        AC_DEFINE(uint8_t, unsigned char)
slouken@1353
   164
    fi
slouken@1353
   165
    if test x$ac_cv_sizeof_short = x2; then
slouken@1353
   166
        AC_DEFINE(int16_t, signed short)
slouken@1353
   167
        AC_DEFINE(uint16_t, unsigned short)
slouken@1353
   168
    else
slouken@1353
   169
        if test x$ac_cv_sizeof_int = x2; then
slouken@1353
   170
            AC_DEFINE(int16_t, signed int)
slouken@1353
   171
            AC_DEFINE(uint16_t, unsigned int)
slouken@1353
   172
        fi
slouken@1353
   173
    fi
slouken@1353
   174
    if test x$ac_cv_sizeof_int = x4; then
slouken@1353
   175
        AC_DEFINE(int32_t, signed int)
slouken@1353
   176
        AC_DEFINE(uint32_t, unsigned int)
slouken@1353
   177
    else
slouken@1353
   178
        if test x$ac_cv_sizeof_long = x4; then
slouken@1353
   179
            AC_DEFINE(int32_t, signed long)
slouken@1353
   180
            AC_DEFINE(uint32_t, unsigned long)
slouken@1353
   181
        fi
slouken@1353
   182
    fi
slouken@1353
   183
    if test x$ac_cv_sizeof_long = x8; then
slouken@1353
   184
        AC_DEFINE(int64_t, signed long)
slouken@1353
   185
        AC_DEFINE(uint64_t, unsigned long)
slouken@1353
   186
        AC_DEFINE(SDL_HAS_64BIT_TYPE)
slouken@1353
   187
    else
slouken@1353
   188
        if test x$ac_cv_sizeof_long_long = x8; then
slouken@1353
   189
            AC_DEFINE(int64_t, signed long long)
slouken@1353
   190
            AC_DEFINE(uint64_t, unsigned long long)
slouken@1353
   191
            AC_DEFINE(SDL_HAS_64BIT_TYPE)
slouken@1353
   192
        fi
slouken@1353
   193
    fi
slouken@1361
   194
    AC_DEFINE(size_t, unsigned int)
slouken@1361
   195
    AC_DEFINE(uintptr_t, unsigned long)
slouken@1353
   196
fi
slouken@1341
   197
slouken@1361
   198
# Standard C sources
slouken@1361
   199
SOURCES="$SOURCES $srcdir/src/*.c"
slouken@1361
   200
SOURCES="$SOURCES $srcdir/src/audio/*.c"
slouken@1361
   201
SOURCES="$SOURCES $srcdir/src/cdrom/*.c"
slouken@1361
   202
SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
slouken@1361
   203
SOURCES="$SOURCES $srcdir/src/events/*.c"
slouken@1361
   204
SOURCES="$SOURCES $srcdir/src/file/*.c"
slouken@1361
   205
SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
slouken@1361
   206
SOURCES="$SOURCES $srcdir/src/thread/*.c"
slouken@1361
   207
SOURCES="$SOURCES $srcdir/src/timer/*.c"
slouken@1361
   208
SOURCES="$SOURCES $srcdir/src/video/*.c"
slouken@1361
   209
slouken@0
   210
dnl Enable/disable various subsystems of the SDL library
slouken@0
   211
slouken@0
   212
AC_ARG_ENABLE(audio,
slouken@1637
   213
AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
slouken@0
   214
              , enable_audio=yes)
slouken@1361
   215
if test x$enable_audio != xyes; then
slouken@1361
   216
    AC_DEFINE(SDL_AUDIO_DISABLED)
slouken@0
   217
fi
slouken@0
   218
AC_ARG_ENABLE(video,
slouken@1637
   219
AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
slouken@0
   220
              , enable_video=yes)
slouken@1361
   221
if test x$enable_video != xyes; then
slouken@1361
   222
    AC_DEFINE(SDL_VIDEO_DISABLED)
slouken@0
   223
fi
slouken@0
   224
AC_ARG_ENABLE(events,
slouken@1637
   225
AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
slouken@0
   226
              , enable_events=yes)
slouken@1361
   227
if test x$enable_events != xyes; then
slouken@1361
   228
    AC_DEFINE(SDL_EVENTS_DISABLED)
slouken@0
   229
fi
slouken@0
   230
AC_ARG_ENABLE(joystick,
slouken@1637
   231
AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
slouken@0
   232
              , enable_joystick=yes)
slouken@1361
   233
if test x$enable_joystick != xyes; then
slouken@1361
   234
    AC_DEFINE(SDL_JOYSTICK_DISABLED)
icculus@2103
   235
else
icculus@2103
   236
    SOURCES="$SOURCES $srcdir/src/joystick/*.c"
slouken@0
   237
fi
slouken@0
   238
AC_ARG_ENABLE(cdrom,
slouken@1637
   239
AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
slouken@0
   240
              , enable_cdrom=yes)
slouken@1361
   241
if test x$enable_cdrom != xyes; then
slouken@1361
   242
    AC_DEFINE(SDL_CDROM_DISABLED)
slouken@0
   243
fi
slouken@0
   244
AC_ARG_ENABLE(threads,
slouken@1637
   245
AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
slouken@0
   246
              , enable_threads=yes)
slouken@0
   247
if test x$enable_threads != xyes; then
slouken@1361
   248
    AC_DEFINE(SDL_THREADS_DISABLED)
slouken@0
   249
fi
slouken@0
   250
AC_ARG_ENABLE(timers,
slouken@1637
   251
AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
slouken@0
   252
              , enable_timers=yes)
slouken@1361
   253
if test x$enable_timers != xyes; then
slouken@1361
   254
    AC_DEFINE(SDL_TIMERS_DISABLED)
slouken@0
   255
fi
slouken@0
   256
AC_ARG_ENABLE(file,
slouken@1637
   257
AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
slouken@0
   258
              , enable_file=yes)
slouken@1361
   259
if test x$enable_file != xyes; then
slouken@1361
   260
    AC_DEFINE(SDL_FILE_DISABLED)
slouken@1361
   261
fi
slouken@1361
   262
AC_ARG_ENABLE(loadso,
slouken@1637
   263
AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
slouken@1361
   264
              , enable_loadso=yes)
slouken@1361
   265
if test x$enable_loadso != xyes; then
slouken@1361
   266
    AC_DEFINE(SDL_LOADSO_DISABLED)
slouken@0
   267
fi
slouken@740
   268
AC_ARG_ENABLE(cpuinfo,
slouken@1637
   269
AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
slouken@740
   270
              , enable_cpuinfo=yes)
slouken@1361
   271
if test x$enable_cpuinfo != xyes; then
slouken@1361
   272
    AC_DEFINE(SDL_CPUINFO_DISABLED)
slouken@1361
   273
fi
slouken@1402
   274
AC_ARG_ENABLE(assembly,
slouken@1637
   275
AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
slouken@1402
   276
              , enable_assembly=yes)
slouken@1402
   277
if test x$enable_assembly = xyes; then
slouken@1402
   278
    AC_DEFINE(SDL_ASSEMBLY_ROUTINES)
slouken@2247
   279
slouken@2247
   280
    dnl Check for various instruction support
slouken@2247
   281
    AC_ARG_ENABLE(mmx,
slouken@2247
   282
AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]),
slouken@2247
   283
                  , enable_mmx=yes)
slouken@2247
   284
    if test x$enable_mmx = xyes; then
slouken@2247
   285
        save_CFLAGS="$CFLAGS"
slouken@2247
   286
        have_gcc_mmx=no
slouken@2247
   287
        AC_MSG_CHECKING(for GCC -mmmx option)
slouken@2247
   288
        mmx_CFLAGS="-mmmx"
slouken@2247
   289
        CFLAGS="$save_CFLAGS $mmx_CFLAGS"
slouken@2247
   290
slouken@2247
   291
        AC_TRY_COMPILE([
slouken@2247
   292
        #include <mmintrin.h>
slouken@2261
   293
        #ifndef __MMX__
slouken@2261
   294
        #error Assembler CPP flag not enabled
slouken@2261
   295
        #endif
slouken@2247
   296
        ],[
slouken@2247
   297
        ],[
slouken@2247
   298
        have_gcc_mmx=yes
slouken@2247
   299
        ])
slouken@2247
   300
        AC_MSG_RESULT($have_gcc_mmx)
slouken@2247
   301
slouken@2247
   302
        if test x$have_gcc_mmx = xyes; then
slouken@2247
   303
            EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS"
slouken@2247
   304
        fi
slouken@2247
   305
    fi
slouken@2247
   306
slouken@2261
   307
    AC_ARG_ENABLE(3dnow,
slouken@2261
   308
AC_HELP_STRING([--enable-3dnow], [use MMX assembly routines [[default=yes]]]),
slouken@2261
   309
                  , enable_3dnow=yes)
slouken@2261
   310
    if test x$enable_3dnow = xyes; then
slouken@2261
   311
        save_CFLAGS="$CFLAGS"
slouken@2261
   312
        have_gcc_3dnow=no
slouken@2261
   313
        AC_MSG_CHECKING(for GCC -m3dnow option)
slouken@2261
   314
        amd3dnow_CFLAGS="-m3dnow"
slouken@2261
   315
        CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS"
slouken@2261
   316
slouken@2261
   317
        AC_TRY_COMPILE([
slouken@2261
   318
        #include <mm3dnow.h>
slouken@2261
   319
        #ifndef __3dNOW__
slouken@2261
   320
        #error Assembler CPP flag not enabled
slouken@2261
   321
        #endif
slouken@2261
   322
        ],[
slouken@2261
   323
        ],[
slouken@2261
   324
        have_gcc_3dnow=yes
slouken@2261
   325
        ])
slouken@2261
   326
        AC_MSG_RESULT($have_gcc_3dnow)
slouken@2261
   327
slouken@2261
   328
        if test x$have_gcc_3dnow = xyes; then
slouken@2261
   329
            EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS"
slouken@2261
   330
        fi
slouken@2261
   331
    fi
slouken@2261
   332
slouken@2247
   333
    AC_ARG_ENABLE(sse,
slouken@2247
   334
AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]),
slouken@2247
   335
                  , enable_sse=yes)
slouken@2247
   336
    if test x$enable_sse = xyes; then
slouken@2247
   337
        save_CFLAGS="$CFLAGS"
slouken@2247
   338
        have_gcc_sse=no
slouken@2247
   339
        AC_MSG_CHECKING(for GCC -msse option)
slouken@2247
   340
        sse_CFLAGS="-msse"
slouken@2247
   341
        CFLAGS="$save_CFLAGS $sse_CFLAGS"
slouken@2247
   342
slouken@2247
   343
        AC_TRY_COMPILE([
slouken@2247
   344
        #include <xmmintrin.h>
slouken@2261
   345
        #ifndef __SSE__
slouken@2261
   346
        #error Assembler CPP flag not enabled
slouken@2261
   347
        #endif
slouken@2247
   348
        ],[
slouken@2247
   349
        ],[
slouken@2247
   350
        have_gcc_sse=yes
slouken@2247
   351
        ])
slouken@2247
   352
        AC_MSG_RESULT($have_gcc_sse)
slouken@2247
   353
slouken@2247
   354
        if test x$have_gcc_sse = xyes; then
slouken@2247
   355
            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS"
slouken@2247
   356
        fi
slouken@2247
   357
    fi
slouken@2247
   358
slouken@2264
   359
    AC_ARG_ENABLE(sse2,
slouken@2264
   360
AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=yes]]]),
slouken@2264
   361
                  , enable_sse2=yes)
slouken@2264
   362
    if test x$enable_sse2 = xyes; then
slouken@2264
   363
        save_CFLAGS="$CFLAGS"
slouken@2264
   364
        have_gcc_sse2=no
slouken@2264
   365
        AC_MSG_CHECKING(for GCC -msse2 option)
slouken@2264
   366
        sse2_CFLAGS="-msse2"
slouken@2264
   367
        CFLAGS="$save_CFLAGS $sse2_CFLAGS"
slouken@2264
   368
slouken@2264
   369
        AC_TRY_COMPILE([
slouken@2264
   370
        #include <emmintrin.h>
slouken@2264
   371
        #ifndef __SSE2__
slouken@2264
   372
        #error Assembler CPP flag not enabled
slouken@2264
   373
        #endif
slouken@2264
   374
        ],[
slouken@2264
   375
        ],[
slouken@2264
   376
        have_gcc_sse2=yes
slouken@2264
   377
        ])
slouken@2264
   378
        AC_MSG_RESULT($have_gcc_sse2)
slouken@2264
   379
slouken@2264
   380
        if test x$have_gcc_sse2 = xyes; then
slouken@2264
   381
            EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS"
slouken@2264
   382
        fi
slouken@2264
   383
    fi
slouken@2264
   384
slouken@2247
   385
    AC_ARG_ENABLE(altivec,
slouken@2247
   386
AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]),
slouken@2247
   387
                  , enable_altivec=yes)
slouken@2247
   388
    if test x$enable_altivec = xyes; then
slouken@2247
   389
        have_altivec_h_hdr=no
slouken@2247
   390
        AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
slouken@2247
   391
slouken@2247
   392
        save_CFLAGS="$CFLAGS"
slouken@2247
   393
        have_gcc_altivec=no
slouken@2247
   394
        AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
slouken@2247
   395
        altivec_CFLAGS="-maltivec"
slouken@2247
   396
        CFLAGS="$save_CFLAGS $altivec_CFLAGS"
slouken@2247
   397
slouken@2247
   398
        if test x$have_altivec_h_hdr = xyes; then
slouken@2247
   399
          AC_TRY_COMPILE([
slouken@2247
   400
          #include <altivec.h>
slouken@2247
   401
          vector unsigned int vzero() {
slouken@2247
   402
              return vec_splat_u32(0);
slouken@2247
   403
          }
slouken@2247
   404
          ],[
slouken@2247
   405
          ],[
slouken@2247
   406
          have_gcc_altivec=yes
slouken@2247
   407
          ])
slouken@2247
   408
          AC_MSG_RESULT($have_gcc_altivec)
slouken@2247
   409
        else
slouken@2247
   410
          AC_TRY_COMPILE([
slouken@2247
   411
          vector unsigned int vzero() {
slouken@2247
   412
              return vec_splat_u32(0);
slouken@2247
   413
          }
slouken@2247
   414
          ],[
slouken@2247
   415
          ],[
slouken@2247
   416
          have_gcc_altivec=yes
slouken@2247
   417
          ])
slouken@2247
   418
          AC_MSG_RESULT($have_gcc_altivec)
slouken@2247
   419
        fi
slouken@2247
   420
slouken@2247
   421
        if test x$have_gcc_altivec = xno; then
slouken@2247
   422
            AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
slouken@2247
   423
            altivec_CFLAGS="-faltivec"
slouken@2247
   424
            CFLAGS="$save_CFLAGS $altivec_CFLAGS"
slouken@2247
   425
            if test x$have_altivec_h_hdr = xyes; then
slouken@2247
   426
              AC_TRY_COMPILE([
slouken@2247
   427
              #include <altivec.h>
slouken@2247
   428
              vector unsigned int vzero() {
slouken@2247
   429
                  return vec_splat_u32(0);
slouken@2247
   430
              }
slouken@2247
   431
              ],[
slouken@2247
   432
              ],[
slouken@2247
   433
              have_gcc_altivec=yes
slouken@2247
   434
              ])
slouken@2247
   435
              AC_MSG_RESULT($have_gcc_altivec)
slouken@2247
   436
            else
slouken@2247
   437
              AC_TRY_COMPILE([
slouken@2247
   438
              vector unsigned int vzero() {
slouken@2247
   439
                  return vec_splat_u32(0);
slouken@2247
   440
              }
slouken@2247
   441
              ],[
slouken@2247
   442
              ],[
slouken@2247
   443
              have_gcc_altivec=yes
slouken@2247
   444
              ])
slouken@2247
   445
              AC_MSG_RESULT($have_gcc_altivec)
slouken@2247
   446
            fi
slouken@2247
   447
        fi
slouken@2247
   448
        CFLAGS="$save_CFLAGS"
slouken@2247
   449
slouken@2247
   450
        if test x$have_gcc_altivec = xyes; then
slouken@2247
   451
            AC_DEFINE(SDL_ALTIVEC_BLITTERS)
slouken@2247
   452
            if test x$have_altivec_h_hdr = xyes; then
slouken@2247
   453
              AC_DEFINE(HAVE_ALTIVEC_H)
slouken@2247
   454
            fi
slouken@2247
   455
            EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
slouken@2247
   456
        fi
slouken@2247
   457
    fi
slouken@740
   458
fi
slouken@0
   459
slouken@0
   460
dnl See if the OSS audio interface is supported
slouken@0
   461
CheckOSS()
slouken@0
   462
{
slouken@0
   463
    AC_ARG_ENABLE(oss,
slouken@1637
   464
AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=yes]]]),
slouken@0
   465
                  , enable_oss=yes)
slouken@0
   466
    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
slouken@0
   467
        AC_MSG_CHECKING(for OSS audio support)
slouken@0
   468
        have_oss=no
slouken@94
   469
        if test x$have_oss != xyes; then
slouken@94
   470
            AC_TRY_COMPILE([
slouken@94
   471
              #include <sys/soundcard.h>
slouken@94
   472
            ],[
slouken@94
   473
              int arg = SNDCTL_DSP_SETFRAGMENT;
slouken@94
   474
            ],[
slouken@94
   475
            have_oss=yes
slouken@94
   476
            ])
slouken@94
   477
        fi
slouken@94
   478
        if test x$have_oss != xyes; then
slouken@94
   479
            AC_TRY_COMPILE([
slouken@94
   480
              #include <soundcard.h>
slouken@94
   481
            ],[
slouken@94
   482
              int arg = SNDCTL_DSP_SETFRAGMENT;
slouken@94
   483
            ],[
slouken@94
   484
            have_oss=yes
slouken@1361
   485
            AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H)
slouken@94
   486
            ])
slouken@94
   487
        fi
slouken@0
   488
        AC_MSG_RESULT($have_oss)
slouken@0
   489
        if test x$have_oss = xyes; then
slouken@1361
   490
            AC_DEFINE(SDL_AUDIO_DRIVER_OSS)
slouken@1361
   491
            SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
slouken@1361
   492
            SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
slouken@1361
   493
            have_audio=yes
slouken@1361
   494
slouken@1565
   495
            # We may need to link with ossaudio emulation library
slouken@1550
   496
            case "$host" in
slouken@1383
   497
                *-*-openbsd*|*-*-netbsd*)
slouken@1521
   498
                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
slouken@1361
   499
            esac
slouken@0
   500
        fi
slouken@0
   501
    fi
slouken@0
   502
}
slouken@0
   503
slouken@0
   504
dnl See if the ALSA audio interface is supported
slouken@0
   505
CheckALSA()
slouken@0
   506
{
slouken@0
   507
    AC_ARG_ENABLE(alsa,
slouken@1637
   508
AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
slouken@0
   509
                  , enable_alsa=yes)
slouken@0
   510
    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
slouken@948
   511
        AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
slouken@1009
   512
        # Restore all flags from before the ALSA detection runs
slouken@1009
   513
        CFLAGS="$alsa_save_CFLAGS"
slouken@1009
   514
        LDFLAGS="$alsa_save_LDFLAGS"
slouken@1009
   515
        LIBS="$alsa_save_LIBS"
slouken@354
   516
        if test x$have_alsa = xyes; then
slouken@865
   517
            AC_ARG_ENABLE(alsa-shared,
slouken@1637
   518
AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
slouken@1361
   519
                          , enable_alsa_shared=yes)
slouken@1361
   520
            if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
slouken@1361
   521
                if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
slouken@1361
   522
                    ALSA_LIBS="-L/lib $ALSA_LIBS"
slouken@1361
   523
                elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
slouken@1361
   524
                    ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
slouken@1361
   525
                elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
slouken@1361
   526
                    ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
slouken@1361
   527
                fi
slouken@1361
   528
            fi
slouken@1361
   529
            alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
slouken@1606
   530
            alsa_lib=`ls -- $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
slouken@1361
   531
            echo "-- $alsa_lib_spec -> $alsa_lib"
slouken@1361
   532
slouken@1361
   533
            AC_DEFINE(SDL_AUDIO_DRIVER_ALSA)
slouken@1361
   534
            SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
slouken@1521
   535
            EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
slouken@1361
   536
            if test x$have_loadso != xyes && \
slouken@1361
   537
               test x$enable_alsa_shared = xyes; then
slouken@1467
   538
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
slouken@1361
   539
            fi
slouken@1361
   540
            if test x$have_loadso = xyes && \
slouken@1361
   541
               test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
slouken@1361
   542
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib")
slouken@1361
   543
            else
slouken@1521
   544
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
slouken@1361
   545
            fi
slouken@1361
   546
            have_audio=yes
slouken@1361
   547
        fi
slouken@1361
   548
    fi
slouken@0
   549
}
slouken@0
   550
slouken@148
   551
dnl Check whether we want to use IRIX 6.5+ native audio or not
slouken@148
   552
CheckDMEDIA()
slouken@148
   553
{
slouken@148
   554
    if test x$enable_audio = xyes; then
slouken@148
   555
        AC_MSG_CHECKING(for dmedia audio support)
slouken@148
   556
        have_dmedia=no
slouken@148
   557
        AC_TRY_COMPILE([
slouken@148
   558
          #include <dmedia/audio.h>
slouken@148
   559
        ],[
slouken@148
   560
          ALport audio_port;
slouken@148
   561
        ],[
slouken@148
   562
        have_dmedia=yes
slouken@148
   563
        ])
slouken@935
   564
        AC_MSG_RESULT($have_dmedia)
slouken@148
   565
        # Set up files for the audio library
slouken@148
   566
        if test x$have_dmedia = xyes; then
slouken@1361
   567
            AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
slouken@1361
   568
            SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
slouken@1521
   569
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio"
slouken@1361
   570
            have_audio=yes
slouken@148
   571
        fi
slouken@148
   572
    fi
slouken@148
   573
}
slouken@148
   574
slouken@1438
   575
dnl Check whether we want to use Tru64 UNIX native audio or not
slouken@1438
   576
CheckMME()
slouken@1438
   577
{
slouken@1438
   578
    dnl Make sure we are running on an Tru64 UNIX
slouken@1438
   579
    case $ARCH in
slouken@1438
   580
        osf)
slouken@1438
   581
            ;;
slouken@1438
   582
        *)
slouken@1438
   583
            return
slouken@1438
   584
            ;;
slouken@1438
   585
    esac
slouken@1438
   586
    if test x$enable_audio = xyes; then
slouken@1438
   587
        AC_MSG_CHECKING(for MME audio support)
slouken@1438
   588
        MME_CFLAGS="-I/usr/include/mme"
slouken@1438
   589
        MME_LIBS="-lmme"
slouken@1438
   590
        have_mme=no
slouken@1438
   591
        save_CFLAGS="$CFLAGS"
slouken@1438
   592
        CFLAGS="$CFLAGS $MME_CFLAGS"
slouken@1438
   593
        AC_TRY_COMPILE([
slouken@1438
   594
          #include <mme_api.h>
slouken@1438
   595
        ],[
slouken@1438
   596
          HWAVEOUT sound;
slouken@1438
   597
        ],[
slouken@1438
   598
        have_mme=yes
slouken@1438
   599
        ])
slouken@1438
   600
        CFLAGS="$save_CFLAGS"
slouken@1438
   601
        AC_MSG_RESULT($have_mme)
slouken@1438
   602
        # Set up files for the audio library
slouken@1438
   603
        if test x$have_mme = xyes; then
slouken@1438
   604
            AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
slouken@1438
   605
            SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
slouken@1521
   606
            EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS"
slouken@1521
   607
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS"
slouken@1438
   608
            have_audio=yes
slouken@1438
   609
        fi
slouken@1438
   610
    fi
slouken@1438
   611
}
slouken@1438
   612
slouken@0
   613
dnl Find the ESD includes and libraries
slouken@0
   614
CheckESD()
slouken@0
   615
{
slouken@0
   616
    AC_ARG_ENABLE(esd,
slouken@1637
   617
AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
slouken@0
   618
                  , enable_esd=yes)
slouken@0
   619
    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
slouken@948
   620
        AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
slouken@948
   621
        if test x$have_esd = xyes; then
slouken@294
   622
            AC_ARG_ENABLE(esd-shared,
slouken@1637
   623
AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
slouken@678
   624
                          , enable_esd_shared=yes)
slouken@294
   625
            esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
slouken@1606
   626
            esd_lib=`ls -- $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
slouken@371
   627
            echo "-- $esd_lib_spec -> $esd_lib"
slouken@1467
   628
slouken@1467
   629
            AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
slouken@1467
   630
            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
slouken@1521
   631
            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
icculus@1173
   632
            if test x$have_loadso != xyes && \
slouken@296
   633
               test x$enable_esd_shared = xyes; then
slouken@1467
   634
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
slouken@296
   635
            fi
icculus@1173
   636
            if test x$have_loadso = xyes && \
slouken@294
   637
               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
slouken@1361
   638
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
slouken@1467
   639
            else
slouken@1521
   640
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
slouken@294
   641
            fi
slouken@1361
   642
            have_audio=yes
slouken@294
   643
        fi
slouken@0
   644
    fi
slouken@0
   645
}
slouken@0
   646
slouken@0
   647
CheckARTSC()
slouken@0
   648
{
slouken@0
   649
    AC_ARG_ENABLE(arts,
slouken@1637
   650
AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
slouken@0
   651
                  , enable_arts=yes)
slouken@0
   652
    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
slouken@1361
   653
        AC_PATH_PROG(ARTSCONFIG, artsc-config)
slouken@1361
   654
        if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
slouken@0
   655
            : # arts isn't installed
slouken@0
   656
        else
slouken@1361
   657
            ARTS_CFLAGS=`$ARTSCONFIG --cflags`
slouken@1361
   658
            ARTS_LIBS=`$ARTSCONFIG --libs`
slouken@1361
   659
            ARTS_PREFIX=`$ARTSCONFIG --arts-prefix`
slouken@0
   660
            AC_MSG_CHECKING(for aRts development environment)
slouken@0
   661
            audio_arts=no
slouken@0
   662
            save_CFLAGS="$CFLAGS"
slouken@1361
   663
            CFLAGS="$CFLAGS $ARTS_CFLAGS"
slouken@0
   664
            AC_TRY_COMPILE([
slouken@0
   665
             #include <artsc.h>
slouken@0
   666
            ],[
slouken@0
   667
             arts_stream_t stream;
slouken@0
   668
            ],[
slouken@0
   669
            audio_arts=yes
slouken@0
   670
            ])
slouken@0
   671
            CFLAGS="$save_CFLAGS"
slouken@0
   672
            AC_MSG_RESULT($audio_arts)
slouken@0
   673
            if test x$audio_arts = xyes; then
slouken@294
   674
                AC_ARG_ENABLE(arts-shared,
slouken@1637
   675
AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
slouken@678
   676
                              , enable_arts_shared=yes)
slouken@1361
   677
                arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*"
slouken@1606
   678
                arts_lib=`ls -- $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
slouken@371
   679
                echo "-- $arts_lib_spec -> $arts_lib"
slouken@1467
   680
slouken@1467
   681
                AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
slouken@1467
   682
                SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
slouken@1521
   683
                EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
icculus@1173
   684
                if test x$have_loadso != xyes && \
slouken@296
   685
                   test x$enable_arts_shared = xyes; then
slouken@1467
   686
                    AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
slouken@296
   687
                fi
icculus@1173
   688
                if test x$have_loadso = xyes && \
slouken@294
   689
                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
slouken@1361
   690
                    AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib")
slouken@1467
   691
                else
slouken@1521
   692
                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
slouken@294
   693
                fi
slouken@1361
   694
                have_audio=yes
slouken@0
   695
            fi
slouken@0
   696
        fi
slouken@0
   697
    fi
slouken@0
   698
}
slouken@0
   699
slouken@0
   700
dnl See if the NAS audio interface is supported
slouken@0
   701
CheckNAS()
slouken@0
   702
{
slouken@0
   703
    AC_ARG_ENABLE(nas,
slouken@1637
   704
AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
slouken@41
   705
                  , enable_nas=yes)
slouken@0
   706
    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
icculus@2049
   707
        AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
icculus@2049
   708
        AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
icculus@2049
   709
slouken@41
   710
        AC_MSG_CHECKING(for NAS audio support)
slouken@41
   711
        have_nas=no
icculus@2049
   712
icculus@2049
   713
        if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
icculus@2049
   714
            have_nas=yes
icculus@2049
   715
            NAS_LIBS="-laudio"
icculus@2049
   716
icculus@2049
   717
        elif test -r /usr/X11R6/include/audio/audiolib.h; then
slouken@41
   718
            have_nas=yes
slouken@1361
   719
            NAS_CFLAGS="-I/usr/X11R6/include/"
slouken@1520
   720
            NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
slouken@605
   721
slouken@605
   722
        dnl On IRIX, the NAS includes are in a different directory,
slouken@605
   723
        dnl and libnas must be explicitly linked in
slouken@605
   724
slouken@605
   725
        elif test -r /usr/freeware/include/nas/audiolib.h; then
slouken@605
   726
            have_nas=yes
slouken@1361
   727
            NAS_LIBS="-lnas -lXt"
slouken@41
   728
        fi
icculus@2049
   729
slouken@605
   730
        AC_MSG_RESULT($have_nas)
icculus@2049
   731
slouken@1361
   732
        if test x$have_nas = xyes; then
icculus@2049
   733
            AC_ARG_ENABLE(nas-shared,
icculus@2049
   734
AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
icculus@2049
   735
                          , enable_nas_shared=yes)
icculus@2049
   736
            if test "x`echo $NAS_LIBS | grep -- -L`" = "x"; then
icculus@2049
   737
                if test "x`ls /lib/libaudio.so.* 2> /dev/null`" != "x"; then
icculus@2049
   738
                    NAS_LIBS="-L/lib $NAS_LIBS"
icculus@2049
   739
                elif test "x`ls /usr/lib/libaudio.so.* 2> /dev/null`" != "x"; then
icculus@2049
   740
                    NAS_LIBS="-L/usr/lib $NAS_LIBS"
icculus@2049
   741
                elif test "x`ls /usr/local/lib/libaudio.so.* 2> /dev/null`" != "x"; then
icculus@2049
   742
                    NAS_LIBS="-L/usr/local/lib $NAS_LIBS"
icculus@2049
   743
                fi
icculus@2049
   744
            fi
icculus@2049
   745
            nas_lib_spec=`echo $NAS_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libaudio.so.*/'`
icculus@2049
   746
            nas_lib=`ls -- $nas_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
icculus@2049
   747
            echo "-- $nas_lib_spec -> $nas_lib"
icculus@2049
   748
icculus@2049
   749
            if test x$have_loadso != xyes && \
icculus@2049
   750
               test x$enable_nas_shared = xyes; then
icculus@2049
   751
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
icculus@2049
   752
            fi
icculus@2049
   753
            if test x$have_loadso = xyes && \
slouken@2163
   754
               test x$enable_nas_shared = xyes && test x$nas_lib != x; then
icculus@2049
   755
                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib")
icculus@2049
   756
            else
icculus@2049
   757
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
icculus@2049
   758
            fi
icculus@2049
   759
slouken@1361
   760
            AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
slouken@1361
   761
            SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
slouken@1521
   762
            EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
slouken@1361
   763
            have_audio=yes
slouken@1361
   764
        fi
slouken@0
   765
    fi
slouken@0
   766
}
slouken@0
   767
slouken@68
   768
dnl rcg07142001 See if the user wants the disk writer audio driver...
slouken@68
   769
CheckDiskAudio()
slouken@68
   770
{
slouken@68
   771
    AC_ARG_ENABLE(diskaudio,
slouken@1637
   772
AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
slouken@86
   773
                  , enable_diskaudio=yes)
slouken@68
   774
    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
slouken@1361
   775
        AC_DEFINE(SDL_AUDIO_DRIVER_DISK)
slouken@1361
   776
        SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
slouken@68
   777
    fi
slouken@68
   778
}
slouken@68
   779
icculus@1532
   780
dnl rcg03142006 See if the user wants the dummy audio driver...
icculus@1532
   781
CheckDummyAudio()
icculus@1532
   782
{
icculus@1532
   783
    AC_ARG_ENABLE(dummyaudio,
slouken@1637
   784
AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
icculus@1532
   785
                  , enable_dummyaudio=yes)
icculus@1532
   786
    if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
icculus@1532
   787
        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY)
icculus@1532
   788
        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
icculus@1532
   789
    fi
icculus@1532
   790
}
icculus@1532
   791
slouken@398
   792
dnl Set up the Atari Audio driver
slouken@398
   793
CheckAtariAudio()
slouken@398
   794
{
slouken@398
   795
    AC_ARG_ENABLE(mintaudio,
slouken@1637
   796
AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [[default=yes]]]),
slouken@398
   797
                  , enable_mintaudio=yes)
slouken@398
   798
    if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
slouken@398
   799
        mintaudio=no
slouken@398
   800
        AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
slouken@398
   801
        if test x$have_mint_falcon_hdr = xyes; then
slouken@398
   802
            mintaudio=yes
slouken@1361
   803
            AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
patmandin@1364
   804
            SOURCES="$SOURCES $srcdir/src/audio/mint/*.c"
patmandin@1477
   805
            SOURCES="$SOURCES $srcdir/src/audio/mint/*.S"
slouken@1361
   806
            have_audio=yes
slouken@398
   807
        fi
slouken@398
   808
    fi
slouken@398
   809
}
slouken@398
   810
icculus@1573
   811
dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
icculus@1573
   812
dnl  Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
icculus@1573
   813
CheckVisibilityHidden()
icculus@1573
   814
{
icculus@1573
   815
    AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
icculus@1573
   816
    have_gcc_fvisibility=no
icculus@1573
   817
icculus@1573
   818
    visibility_CFLAGS="-fvisibility=hidden"
icculus@1573
   819
    save_CFLAGS="$CFLAGS"
icculus@1573
   820
    CFLAGS="$save_CFLAGS $visibility_CFLAGS"
icculus@1573
   821
    AC_TRY_COMPILE([
slouken@1745
   822
    #if !defined(__GNUC__) || __GNUC__ < 4
slouken@1745
   823
    #error SDL only uses visibility attributes in GCC 4 or newer
slouken@1745
   824
    #endif
icculus@1573
   825
    ],[
icculus@1573
   826
    ],[
icculus@1573
   827
    have_gcc_fvisibility=yes
icculus@1573
   828
    ])
icculus@1573
   829
    AC_MSG_RESULT($have_gcc_fvisibility)
icculus@1573
   830
    CFLAGS="$save_CFLAGS"
icculus@1573
   831
icculus@1573
   832
    if test x$have_gcc_fvisibility = xyes; then
slouken@1574
   833
        EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
icculus@1573
   834
    fi
icculus@1573
   835
}
icculus@1573
   836
icculus@1573
   837
icculus@1140
   838
dnl Do the iPod thing
icculus@1140
   839
CheckIPod()
icculus@1140
   840
{
icculus@1140
   841
    AC_ARG_ENABLE(ipod,
slouken@1361
   842
AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [default=yes on arm-elf]]),
slouken@1361
   843
        , enable_ipod=yes)
icculus@1140
   844
icculus@1140
   845
    if test x$enable_ipod = xyes; then
slouken@1521
   846
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD"
slouken@1361
   847
        AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
slouken@1361
   848
        SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
icculus@1140
   849
    fi
slouken@1361
   850
}
icculus@1140
   851
slouken@30
   852
dnl Find the nanox include and library directories
slouken@30
   853
CheckNANOX()
slouken@30
   854
{
slouken@292
   855
    AC_ARG_ENABLE(video-nanox,
slouken@1637
   856
        AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [[default=no]]]),
slouken@292
   857
        , enable_video_nanox=no)
slouken@30
   858
slouken@292
   859
    if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
slouken@1361
   860
        AC_ARG_ENABLE(nanox-debug,  
slouken@1637
   861
            AC_HELP_STRING([--enable-nanox-debug], [print debug messages [[default=no]]]),
slouken@1361
   862
            , enable_nanox_debug=no)
slouken@292
   863
        if test x$enable_nanox_debug = xyes; then
slouken@1521
   864
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG"
slouken@292
   865
        fi
slouken@30
   866
slouken@1361
   867
        AC_ARG_ENABLE(nanox-share-memory,  
slouken@1637
   868
            AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [[default=no]]]),
slouken@1361
   869
            , enable_nanox_share_memory=no)
slouken@292
   870
        if test x$enable_nanox_share_memory = xyes; then
slouken@1521
   871
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY"
slouken@292
   872
        fi
slouken@30
   873
slouken@1361
   874
        AC_ARG_ENABLE(nanox_direct_fb, 
slouken@1637
   875
            AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [[default=no]]]),
slouken@1361
   876
            , enable_nanox_direct_fb=no)
slouken@471
   877
        if test x$enable_nanox_direct_fb = xyes; then
slouken@1521
   878
            EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
slouken@471
   879
        fi
slouken@30
   880
slouken@1361
   881
        AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
slouken@1361
   882
        SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
slouken@1521
   883
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
slouken@1361
   884
        have_video=yes
slouken@292
   885
    fi
slouken@30
   886
}
slouken@30
   887
slouken@0
   888
dnl Find the X11 include and library directories
slouken@0
   889
CheckX11()
slouken@0
   890
{
slouken@0
   891
    AC_ARG_ENABLE(video-x11,
slouken@1637
   892
AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
slouken@0
   893
                  , enable_video_x11=yes)
slouken@0
   894
    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
slouken@1806
   895
        case "$host" in
slouken@1807
   896
            *-*-darwin*)
slouken@1807
   897
                # This isn't necessary for X11, but fixes GLX detection
slouken@1808
   898
                if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
slouken@1806
   899
                    x_includes="/usr/X11R6/include"
slouken@1806
   900
                    x_libraries="/usr/X11R6/lib"
slouken@1806
   901
                fi
slouken@1806
   902
                ;;
slouken@1806
   903
        esac
slouken@0
   904
        AC_PATH_X
slouken@0
   905
        AC_PATH_XTRA
slouken@0
   906
        if test x$have_x = xyes; then
slouken@1879
   907
            # Only allow dynamically loaded X11 if the X11 function pointers
slouken@1879
   908
            # will not end up in the global namespace, which causes problems
slouken@1879
   909
            # with other libraries calling X11 functions.
slouken@1879
   910
            x11_symbols_private=$have_gcc_fvisibility
slouken@1879
   911
icculus@1168
   912
            AC_ARG_ENABLE(x11-shared,
slouken@1879
   913
AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
slouken@1879
   914
                          , enable_x11_shared=maybe)
icculus@1168
   915
slouken@1550
   916
            case "$host" in
icculus@1589
   917
                *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs...
slouken@1879
   918
                    x11_symbols_private=yes
icculus@1174
   919
                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
icculus@1174
   920
                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
slouken@1592
   921
                    xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
icculus@1589
   922
                    xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
icculus@1174
   923
                    ;;
slouken@1384
   924
                *-*-osf*)
slouken@1384
   925
                    x11_lib='libX11.so'
slouken@1384
   926
                    x11ext_lib='libXext.so'
slouken@1384
   927
                    ;;
slouken@1384
   928
                *-*-irix*) # IRIX 6.5 requires that we use /usr/lib32
icculus@1299
   929
                    x11_lib='libX11.so'
icculus@1299
   930
                    x11ext_lib='libXext.so'
icculus@1299
   931
                    ;;
icculus@1174
   932
                *)
slouken@1569
   933
                    x11_lib_spec=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1/'`]
slouken@1571
   934
                    for path in $x11_lib_path /usr/lib /usr/X11/lib /usr/X11R6/lib; do
slouken@1571
   935
                        if test "x$x11_lib" = "x"; then
slouken@1606
   936
                            x11_lib=[`ls -- $path/libX11.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@1879
   937
                            if test "x$x11_lib" = "x"; then
slouken@1879
   938
                                x11_lib=[`ls -- $path/libX11.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@1879
   939
                            fi
slouken@1571
   940
                        fi
slouken@1571
   941
                        if test "x$x11ext_lib" = "x"; then
slouken@1606
   942
                            x11ext_lib=[`ls -- $path/libXext.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@1879
   943
                            if test "x$x11ext_lib" = "x"; then
slouken@1879
   944
                                x11ext_lib=[`ls -- $path/libXext.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@1879
   945
                            fi
slouken@1571
   946
                        fi
icculus@1589
   947
                        if test "x$xrender_lib" = "x"; then
slouken@1606
   948
                            xrender_lib=[`ls -- $path/libXrender.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@1879
   949
                            if test "x$xrender_lib" = "x"; then
slouken@1879
   950
                                xrender_lib=[`ls -- $path/libXrender.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@1879
   951
                            fi
icculus@1589
   952
                        fi
icculus@1589
   953
                        if test "x$xrandr_lib" = "x"; then
slouken@1606
   954
                            xrandr_lib=[`ls -- $path/libXrandr.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@1879
   955
                            if test "x$xrandr_lib" = "x"; then
slouken@1879
   956
                                xrandr_lib=[`ls -- $path/libXrandr.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
slouken@1879
   957
                            fi
icculus@1589
   958
                        fi
slouken@1569
   959
                    done
icculus@1174
   960
                    ;;
icculus@1174
   961
            esac
icculus@1168
   962
slouken@1361
   963
            X_CFLAGS="$X_CFLAGS -DXTHREADS"
slouken@1361
   964
            if test x$ac_cv_func_shmat != xyes; then
slouken@1361
   965
                X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
slouken@1361
   966
            fi
slouken@1799
   967
            CFLAGS="$CFLAGS $X_CFLAGS"
slouken@1799
   968
            LDFLAGS="$LDFLAGS $X_LIBS"
slouken@1468
   969
slouken@1468
   970
            AC_DEFINE(SDL_VIDEO_DRIVER_X11)
slouken@1468
   971
            SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
bob@2185
   972
            SOURCES="$SOURCES $srcdir/src/video/Xext/XmuStdCmap/*.c"
slouken@1521
   973
            EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
slouken@1879
   974
slouken@1879
   975
            if test x$enable_x11_shared = xmaybe; then
slouken@1879
   976
                enable_x11_shared=$x11_symbols_private
slouken@1879
   977
            fi
icculus@1173
   978
            if test x$have_loadso != xyes && \
icculus@1168
   979
               test x$enable_x11_shared = xyes; then
slouken@1467
   980
                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
icculus@1875
   981
                enable_x11_shared=no
icculus@1168
   982
            fi
slouken@1879
   983
            if test x$x11_symbols_private != xyes && \
icculus@1875
   984
               test x$enable_x11_shared = xyes; then
icculus@1875
   985
                AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
icculus@1875
   986
                enable_x11_shared=no
icculus@1875
   987
            fi
icculus@1875
   988
icculus@1173
   989
            if test x$have_loadso = xyes && \
icculus@1170
   990
               test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
icculus@1174
   991
                echo "-- dynamic libX11 -> $x11_lib"
icculus@1174
   992
                echo "-- dynamic libX11ext -> $x11ext_lib"
slouken@1361
   993
                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
slouken@1361
   994
                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
icculus@1168
   995
            else
icculus@1589
   996
                enable_x11_shared=no
slouken@1521
   997
                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
icculus@1168
   998
            fi
slouken@1361
   999
            have_video=yes
slouken@0
  1000
slouken@0
  1001
            AC_ARG_ENABLE(video-x11-vm,
slouken@1637
  1002
AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
slouken@0
  1003
                          , enable_video_x11_vm=yes)
slouken@0
  1004
            if test x$enable_video_x11_vm = xyes; then
slouken@1361
  1005
                AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
slouken@1361
  1006
                SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
slouken@0
  1007
            fi
slouken@0
  1008
            AC_ARG_ENABLE(video-x11-xv,
slouken@1637
  1009
AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [[default=yes]]]),
slouken@0
  1010
                          , enable_video_x11_xv=yes)
slouken@0
  1011
            if test x$enable_video_x11_xv = xyes; then
slouken@1361
  1012
                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV)
slouken@1361
  1013
                SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c"
slouken@0
  1014
            fi
slouken@227
  1015
            AC_ARG_ENABLE(video-x11-xinerama,
slouken@1637
  1016
AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
slouken@227
  1017
                            , enable_video_x11_xinerama=yes)
slouken@227
  1018
            if test x$enable_video_x11_xinerama = xyes; then
slouken@1361
  1019
                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
slouken@1361
  1020
                SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
slouken@227
  1021
            fi
slouken@242
  1022
            AC_ARG_ENABLE(video-x11-xme,
slouken@1637
  1023
AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]),
slouken@242
  1024
                            , enable_video_x11_xme=yes)
slouken@242
  1025
            if test x$enable_video_x11_xme = xyes; then
slouken@1361
  1026
                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
slouken@1361
  1027
                SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
slouken@242
  1028
            fi
icculus@1589
  1029
            AC_ARG_ENABLE(video-x11-xrandr,
slouken@1637
  1030
AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
icculus@1589
  1031
                            , enable_video_x11_xrandr=yes)
icculus@1589
  1032
            if test x$enable_video_x11_xrandr = xyes; then
icculus@1589
  1033
                definitely_enable_video_x11_xrandr=no
icculus@1589
  1034
                AC_CHECK_HEADER(X11/extensions/Xrandr.h,
icculus@1589
  1035
                                have_xrandr_h_hdr=yes,
icculus@1589
  1036
                                have_xrandr_h_hdr=no,
icculus@1589
  1037
                                [#include <X11/Xlib.h>
icculus@1589
  1038
                                ])
icculus@1589
  1039
                if test x$have_xrandr_h_hdr = xyes; then
icculus@1589
  1040
                    if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
icculus@1589
  1041
                        echo "-- dynamic libXrender -> $xrender_lib"
icculus@1589
  1042
                        echo "-- dynamic libXrandr -> $xrandr_lib"
icculus@1589
  1043
                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
icculus@1589
  1044
                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
icculus@1589
  1045
                        definitely_enable_video_x11_xrandr=yes
icculus@1589
  1046
                    else
icculus@1589
  1047
                        AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
icculus@1589
  1048
                        AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
icculus@1589
  1049
                        if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then
icculus@1589
  1050
                            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender"
icculus@1589
  1051
                            definitely_enable_video_x11_xrandr=yes
icculus@1589
  1052
                        fi
icculus@1589
  1053
                    fi
icculus@1589
  1054
                fi
icculus@1589
  1055
            fi
icculus@1589
  1056
            if test x$definitely_enable_video_x11_xrandr = xyes; then
icculus@1589
  1057
                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
icculus@1589
  1058
            fi
slouken@1783
  1059
            AC_ARG_ENABLE(video-x11-dpms,
slouken@1783
  1060
AC_HELP_STRING([--enable-video-x11-dpms], [enable X11 DPMS extension [[default=yes]]]),
slouken@1783
  1061
                            , enable_video_x11_dpms=yes)
slouken@1783
  1062
            if test x$enable_video_x11_dpms = xyes; then
slouken@1783
  1063
                AC_CHECK_HEADER(X11/extensions/dpms.h,
slouken@1783
  1064
                                have_dpms_h_hdr=yes,
slouken@1783
  1065
                                have_dpms_h_hdr=no,
slouken@1783
  1066
                                [#include <X11/Xlib.h>
slouken@1783
  1067
                                ])
slouken@1783
  1068
                if test x$have_dpms_h_hdr = xyes; then
slouken@1783
  1069
                    AC_DEFINE(SDL_VIDEO_DRIVER_X11_DPMS)
slouken@1783
  1070
                fi
slouken@1783
  1071
            fi
slouken@0
  1072
        fi
slouken@0
  1073
    fi
slouken@0
  1074
}
slouken@279
  1075
slouken@1361
  1076
dnl Check for QNX photon video driver
slouken@0
  1077
CheckPHOTON()
slouken@0
  1078
{
slouken@0
  1079
    AC_ARG_ENABLE(video-photon,
slouken@1637
  1080
AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=yes]]]),
slouken@0
  1081
                  , enable_video_photon=yes)
slouken@0
  1082
    if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
slouken@0
  1083
        AC_MSG_CHECKING(for QNX Photon support)
slouken@0
  1084
        video_photon=no
slouken@0
  1085
        AC_TRY_COMPILE([
slouken@0
  1086
          #include <Ph.h>
slouken@0
  1087
          #include <Pt.h>
slouken@0
  1088
          #include <photon/Pg.h>
slouken@0
  1089
          #include <photon/PdDirect.h>
slouken@0
  1090
        ],[
slouken@0
  1091
         PgDisplaySettings_t *visual;
slouken@0
  1092
        ],[
slouken@0
  1093
        video_photon=yes
slouken@0
  1094
        ])
slouken@0
  1095
        AC_MSG_RESULT($video_photon)
slouken@0
  1096
        if test x$video_photon = xyes; then
slouken@1361
  1097
            AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
slouken@1361
  1098
            SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
slouken@1521
  1099
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph"
slouken@1361
  1100
            have_video=yes
slouken@1361
  1101
slouken@279
  1102
            CheckOpenGLQNX
slouken@0
  1103
        fi
slouken@0
  1104
    fi
slouken@0
  1105
}
slouken@0
  1106
slouken@1361
  1107
dnl Set up the BWindow video driver if enabled
slouken@1361
  1108
CheckBWINDOW()
slouken@1361
  1109
{
slouken@1361
  1110
    if test x$enable_video = xyes; then
slouken@1361
  1111
        AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW)
slouken@1361
  1112
        SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
slouken@1361
  1113
        have_video=yes
slouken@1361
  1114
    fi
slouken@1361
  1115
}
slouken@1361
  1116
slouken@1931
  1117
dnl Set up the Cocoa video driver for Mac OS X (but not Darwin)
slouken@1361
  1118
CheckCOCOA()
slouken@1361
  1119
{
slouken@1361
  1120
    AC_ARG_ENABLE(video-cocoa,
slouken@1931
  1121
AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]),
slouken@1361
  1122
                  , enable_video_cocoa=yes)
slouken@1361
  1123
    if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
slouken@1361
  1124
        save_CFLAGS="$CFLAGS"
slouken@1361
  1125
        dnl work around that we don't have Objective-C support in autoconf
slouken@1361
  1126
        CFLAGS="$CFLAGS -x objective-c"
slouken@1361
  1127
        AC_MSG_CHECKING(for Cocoa framework)
slouken@1361
  1128
        have_cocoa=no
slouken@1361
  1129
        AC_TRY_COMPILE([
slouken@1361
  1130
          #import <Cocoa/Cocoa.h>
slouken@1361
  1131
        ],[
slouken@1361
  1132
        ],[
slouken@1361
  1133
        have_cocoa=yes
slouken@1361
  1134
        ])
slouken@1361
  1135
        AC_MSG_RESULT($have_cocoa)
slouken@1361
  1136
        CFLAGS="$save_CFLAGS"
slouken@1361
  1137
        if test x$have_cocoa = xyes; then
slouken@1931
  1138
            AC_DEFINE(SDL_VIDEO_DRIVER_COCOA)
slouken@1931
  1139
            SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m"
slouken@1361
  1140
            have_video=yes
slouken@1361
  1141
        fi
slouken@1361
  1142
    fi
slouken@1361
  1143
}
slouken@1361
  1144
slouken@0
  1145
dnl Find the framebuffer console includes
slouken@0
  1146
CheckFBCON()
slouken@0
  1147
{
slouken@0
  1148
    AC_ARG_ENABLE(video-fbcon,
slouken@2021
  1149
AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [[default=no]]]),
slouken@2021
  1150
                  , enable_video_fbcon=no)
slouken@0
  1151
    if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
slouken@0
  1152
        AC_MSG_CHECKING(for framebuffer console support)
slouken@0
  1153
        video_fbcon=no
slouken@0
  1154
        AC_TRY_COMPILE([
slouken@0
  1155
         #include <linux/fb.h>
slouken@0
  1156
         #include <linux/kd.h>
slouken@0
  1157
         #include <linux/keyboard.h>
slouken@0
  1158
        ],[
slouken@0
  1159
        ],[
slouken@0
  1160
        video_fbcon=yes
slouken@0
  1161
        ])
slouken@0
  1162
        AC_MSG_RESULT($video_fbcon)
slouken@0
  1163
        if test x$video_fbcon = xyes; then
icculus@2093
  1164
            AC_CHECK_FUNCS(getpagesize)
slouken@1361
  1165
            AC_DEFINE(SDL_VIDEO_DRIVER_FBCON)
slouken@1361
  1166
            SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c"
slouken@1361
  1167
            have_video=yes
slouken@0
  1168
        fi
slouken@0
  1169
    fi
slouken@0
  1170
}
slouken@0
  1171
slouken@167
  1172
dnl Find DirectFB
slouken@167
  1173
CheckDirectFB()
slouken@167
  1174
{
slouken@167
  1175
    AC_ARG_ENABLE(video-directfb,
slouken@1637
  1176
AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=yes]]]),
slouken@1588
  1177
                  , enable_video_directfb=yes)
slouken@167
  1178
    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
slouken@167
  1179
        video_directfb=no
slouken@167
  1180
slouken@1588
  1181
        DIRECTFB_REQUIRED_VERSION=0.9.15
slouken@1588
  1182
slouken@1602
  1183
        AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no)
slouken@1602
  1184
        if test x$DIRECTFBCONFIG = xno; then
slouken@1588
  1185
            AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
slouken@1602
  1186
            AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
slouken@1602
  1187
            if test x$PKG_CONFIG != xno; then
slouken@1602
  1188
                if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
slouken@1588
  1189
                    DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
slouken@1588
  1190
                    DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
slouken@1588
  1191
                    video_directfb=yes
slouken@1588
  1192
                fi
slouken@1588
  1193
            fi
slouken@1602
  1194
            AC_MSG_RESULT($video_directfb)
slouken@167
  1195
        else
slouken@1588
  1196
            AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
slouken@1588
  1197
            set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
slouken@1588
  1198
            NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
slouken@1588
  1199
            set -- `directfb-config --version | sed 's/\./ /g'`
slouken@1588
  1200
            HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
slouken@1588
  1201
            if test $HAVE_VERSION -ge $NEED_VERSION; then
slouken@1588
  1202
                DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
slouken@1588
  1203
                DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
slouken@167
  1204
                video_directfb=yes
slouken@167
  1205
            fi
slouken@1588
  1206
            AC_MSG_RESULT($video_directfb)
slouken@167
  1207
        fi
slouken@167
  1208
slouken@167
  1209
        if test x$video_directfb = xyes; then
slouken@1361
  1210
            AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
slouken@1361
  1211
            SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
slouken@1521
  1212
            EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
slouken@1521
  1213
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
slouken@1361
  1214
            have_video=yes
slouken@167
  1215
        fi
slouken@167
  1216
    fi
slouken@167
  1217
}
slouken@167
  1218
slouken@70
  1219
dnl See if we're running on PlayStation 2 hardware
slouken@70
  1220
CheckPS2GS()
slouken@70
  1221
{
slouken@72
  1222
    AC_ARG_ENABLE(video-ps2gs,
slouken@1637
  1223
AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [[default=yes]]]),
slouken@72
  1224
                  , enable_video_ps2gs=yes)
slouken@70
  1225
    if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
slouken@72
  1226
        AC_MSG_CHECKING(for PlayStation 2 GS support)
slouken@70
  1227
        video_ps2gs=no
slouken@70
  1228
        AC_TRY_COMPILE([
slouken@70
  1229
         #include <linux/ps2/dev.h>
slouken@70
  1230
         #include <linux/ps2/gs.h>
slouken@70
  1231
        ],[
slouken@70
  1232
        ],[
slouken@70
  1233
        video_ps2gs=yes
slouken@70
  1234
        ])
slouken@72
  1235
        AC_MSG_RESULT($video_ps2gs)
slouken@70
  1236
        if test x$video_ps2gs = xyes; then
slouken@1361
  1237
            AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS)
slouken@1361
  1238
            SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c"
slouken@1361
  1239
            have_video=yes
slouken@70
  1240
        fi
slouken@70
  1241
    fi
slouken@70
  1242
}
slouken@70
  1243
slouken@0
  1244
dnl Find the SVGAlib includes and libraries
slouken@0
  1245
CheckSVGA()
slouken@0
  1246
{
slouken@0
  1247
    AC_ARG_ENABLE(video-svga,
slouken@1637
  1248
AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=yes]]]),
slouken@1555
  1249
                  , enable_video_svga=yes)
slouken@0
  1250
    if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
slouken@0
  1251
        AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
slouken@0
  1252
        video_svga=no
slouken@0
  1253
        AC_TRY_COMPILE([
slouken@0
  1254
         #include <vga.h>
slouken@0
  1255
         #include <vgamouse.h>
slouken@0
  1256
         #include <vgakeyboard.h>
slouken@0
  1257
        ],[
slouken@0
  1258
         if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
slouken@0
  1259
             exit(0);
slouken@0
  1260
         }
slouken@0
  1261
        ],[
slouken@0
  1262
        video_svga=yes
slouken@0
  1263
        ])
slouken@0
  1264
        AC_MSG_RESULT($video_svga)
slouken@0
  1265
        if test x$video_svga = xyes; then
slouken@1361
  1266
            AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
slouken@1361
  1267
            SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
slouken@1556
  1268
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga"
slouken@1361
  1269
            have_video=yes
slouken@0
  1270
        fi
slouken@0
  1271
    fi
slouken@0
  1272
}
slouken@0
  1273
slouken@75
  1274
dnl Find the VGL includes and libraries
slouken@75
  1275
CheckVGL()
slouken@75
  1276
{
slouken@75
  1277
    AC_ARG_ENABLE(video-vgl,
slouken@1637
  1278
AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [[default=yes]]]),
slouken@1588
  1279
                  , enable_video_vgl=yes)
slouken@75
  1280
    if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
slouken@75
  1281
        AC_MSG_CHECKING(for libVGL support)
slouken@75
  1282
        video_vgl=no
slouken@75
  1283
        AC_TRY_COMPILE([
slouken@75
  1284
         #include <sys/fbio.h>
slouken@75
  1285
         #include <sys/consio.h>
slouken@75
  1286
         #include <sys/kbio.h>
slouken@75
  1287
         #include <vgl.h>
slouken@75
  1288
        ],[
slouken@75
  1289
         VGLBitmap bitmap;
slouken@1836
  1290
         bitmap.Type = VIDBUF32;
slouken@1836
  1291
         bitmap.PixelBytes = 4;
slouken@144
  1292
         exit(bitmap.Bitmap);
slouken@75
  1293
        ],[
slouken@75
  1294
        video_vgl=yes
slouken@75
  1295
        ])
slouken@75
  1296
        AC_MSG_RESULT($video_vgl)
slouken@75
  1297
        if test x$video_vgl = xyes; then
slouken@1361
  1298
            AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
slouken@1361
  1299
            SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
slouken@1521
  1300
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl"
slouken@1361
  1301
            have_video=yes
slouken@75
  1302
        fi
slouken@75
  1303
    fi
slouken@75
  1304
}
slouken@75
  1305
slouken@1361
  1306
dnl Set up the wscons video driver if enabled
slouken@1361
  1307
CheckWscons()
slouken@1361
  1308
{
slouken@1361
  1309
    AC_ARG_ENABLE(video-wscons,
slouken@1637
  1310
AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]]),
slouken@1361
  1311
                  , enable_video_wscons=yes)
slouken@1361
  1312
    if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
slouken@1361
  1313
        AC_MSG_CHECKING(for wscons support)
slouken@1361
  1314
        video_wscons=no
slouken@1361
  1315
        AC_TRY_COMPILE([
slouken@1597
  1316
         #include <sys/time.h>
slouken@1597
  1317
         #include <dev/wscons/wsconsio.h>
slouken@1597
  1318
         #include <dev/wscons/wsdisplay_usl_io.h>
slouken@1361
  1319
        ],[
slouken@1597
  1320
         int wsmode = WSDISPLAYIO_MODE_DUMBFB;
slouken@1361
  1321
        ],[
slouken@1361
  1322
        video_wscons=yes
slouken@1361
  1323
        ])
slouken@1361
  1324
        AC_MSG_RESULT($video_wscons)
slouken@1361
  1325
        if test x$video_wscons = xyes; then
slouken@1361
  1326
            AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS)
slouken@1361
  1327
            SOURCES="$SOURCES $srcdir/src/video/wscons/*.c"
slouken@1361
  1328
            have_video=yes
slouken@1361
  1329
        fi
slouken@1361
  1330
    fi
slouken@1361
  1331
}
slouken@1361
  1332
slouken@1361
  1333
dnl Set up the Atari Bios keyboard driver
slouken@1361
  1334
CheckAtariBiosEvent()
slouken@1361
  1335
{
slouken@1361
  1336
    SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c"
patmandin@1477
  1337
    SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.S"
slouken@1361
  1338
}
slouken@1361
  1339
slouken@281
  1340
dnl Set up the Atari Xbios driver
slouken@281
  1341
CheckAtariXbiosVideo()
slouken@281
  1342
{
patmandin@2085
  1343
    AC_ARG_ENABLE(video-xbios,
slouken@1637
  1344
AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [[default=yes]]]),
slouken@281
  1345
                  , enable_video_xbios=yes)
slouken@281
  1346
    video_xbios=no
slouken@281
  1347
    if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
slouken@281
  1348
        video_xbios=yes
slouken@1361
  1349
        AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
slouken@1361
  1350
        SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
slouken@1361
  1351
        have_video=yes
slouken@281
  1352
    fi
slouken@281
  1353
}
slouken@281
  1354
slouken@281
  1355
dnl Set up the Atari Gem driver
slouken@281
  1356
CheckAtariGemVideo()
slouken@281
  1357
{
patmandin@2085
  1358
    AC_ARG_ENABLE(video-gem,
slouken@1637
  1359
AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [[default=yes]]]),
slouken@281
  1360
                  , enable_video_gem=yes)
slouken@281
  1361
    if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
slouken@281
  1362
        video_gem=no
slouken@281
  1363
        AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
slouken@281
  1364
        AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
slouken@281
  1365
        if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
slouken@1366
  1366
            video_gem=yes
slouken@1361
  1367
            AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
slouken@1361
  1368
            SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
patmandin@1825
  1369
            SDL_LIBS="$SDL_LIBS -lgem"
slouken@1361
  1370
            have_video=yes
slouken@281
  1371
        fi
slouken@281
  1372
    fi
slouken@281
  1373
}
slouken@281
  1374
slouken@1
  1375
dnl rcg04172001 Set up the Null video driver.
slouken@1
  1376
CheckDummyVideo()
slouken@1
  1377
{
slouken@1
  1378
    AC_ARG_ENABLE(video-dummy,
slouken@1637
  1379
AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
slouken@86
  1380
                  , enable_video_dummy=yes)
slouken@1
  1381
    if test x$enable_video_dummy = xyes; then
slouken@1361
  1382
        AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY)
slouken@1361
  1383
        SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
slouken@1361
  1384
        have_video=yes
slouken@1
  1385
    fi
slouken@1
  1386
}
slouken@1
  1387
slouken@0
  1388
dnl Check to see if OpenGL support is desired
slouken@0
  1389
AC_ARG_ENABLE(video-opengl,
slouken@1952
  1390
AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]),
slouken@0
  1391
              , enable_video_opengl=yes)
slouken@0
  1392
slouken@0
  1393
dnl Find OpenGL
icculus@1191
  1394
CheckOpenGLX11()
slouken@0
  1395
{
slouken@0
  1396
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1397
        AC_MSG_CHECKING(for OpenGL (GLX) support)
slouken@0
  1398
        video_opengl=no
slouken@0
  1399
        AC_TRY_COMPILE([
slouken@0
  1400
         #include <GL/gl.h>
slouken@0
  1401
         #include <GL/glx.h>
icculus@2125
  1402
         #include <GL/glu.h>
slouken@0
  1403
        ],[
slouken@0
  1404
        ],[
slouken@0
  1405
        video_opengl=yes
slouken@0
  1406
        ])
slouken@0
  1407
        AC_MSG_RESULT($video_opengl)
slouken@0
  1408
        if test x$video_opengl = xyes; then
slouken@1361
  1409
            AC_DEFINE(SDL_VIDEO_OPENGL)
slouken@1361
  1410
            AC_DEFINE(SDL_VIDEO_OPENGL_GLX)
slouken@1952
  1411
            AC_DEFINE(SDL_VIDEO_RENDER_OGL)
slouken@0
  1412
        fi
slouken@0
  1413
    fi
slouken@0
  1414
}
slouken@0
  1415
slouken@279
  1416
dnl Find QNX RtP OpenGL
slouken@279
  1417
CheckOpenGLQNX()
slouken@279
  1418
{
slouken@279
  1419
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@279
  1420
        AC_MSG_CHECKING(for OpenGL (Photon) support)
slouken@279
  1421
        video_opengl=no
slouken@279
  1422
        AC_TRY_COMPILE([
slouken@279
  1423
         #include <GL/gl.h>
slouken@279
  1424
        ],[
slouken@279
  1425
        ],[
slouken@279
  1426
        video_opengl=yes
slouken@279
  1427
        ])
slouken@279
  1428
        AC_MSG_RESULT($video_opengl)
slouken@279
  1429
        if test x$video_opengl = xyes; then
slouken@1361
  1430
            AC_DEFINE(SDL_VIDEO_OPENGL)
slouken@1952
  1431
            AC_DEFINE(SDL_VIDEO_RENDER_OGL)
slouken@1521
  1432
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
slouken@279
  1433
        fi
slouken@279
  1434
    fi
slouken@279
  1435
}
slouken@279
  1436
slouken@1361
  1437
dnl Check for Win32 OpenGL
slouken@1361
  1438
CheckWIN32GL()
slouken@1361
  1439
{
slouken@1361
  1440
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@1361
  1441
        AC_DEFINE(SDL_VIDEO_OPENGL)
slouken@1361
  1442
        AC_DEFINE(SDL_VIDEO_OPENGL_WGL)
slouken@1952
  1443
        AC_DEFINE(SDL_VIDEO_RENDER_OGL)
slouken@1361
  1444
    fi
slouken@1361
  1445
}
slouken@1361
  1446
slouken@0
  1447
dnl Check for BeOS OpenGL
slouken@0
  1448
CheckBeGL()
slouken@0
  1449
{
slouken@0
  1450
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@1361
  1451
        AC_DEFINE(SDL_VIDEO_OPENGL)
slouken@1952
  1452
        AC_DEFINE(SDL_VIDEO_OPENGL_BGL)
slouken@1952
  1453
        AC_DEFINE(SDL_VIDEO_RENDER_OGL)
slouken@1521
  1454
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
slouken@0
  1455
    fi
slouken@0
  1456
}
slouken@0
  1457
slouken@0
  1458
dnl Check for MacOS OpenGL
slouken@0
  1459
CheckMacGL()
slouken@0
  1460
{
slouken@0
  1461
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@1361
  1462
        AC_DEFINE(SDL_VIDEO_OPENGL)
slouken@1952
  1463
        AC_DEFINE(SDL_VIDEO_OPENGL_CGL)
slouken@1952
  1464
        AC_DEFINE(SDL_VIDEO_RENDER_OGL)
slouken@1550
  1465
        case "$host" in
slouken@0
  1466
            *-*-darwin*)
slouken@1625
  1467
                if test x$enable_video_cocoa = xyes; then
slouken@1625
  1468
                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
slouken@1625
  1469
                fi
slouken@0
  1470
        esac
slouken@0
  1471
    fi
slouken@0
  1472
}
slouken@0
  1473
patmandin@978
  1474
dnl Check for Mesa offscreen rendering
patmandin@989
  1475
CheckAtariOSMesa()
patmandin@978
  1476
{
patmandin@989
  1477
    if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
patmandin@991
  1478
        AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
patmandin@991
  1479
        AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
patmandin@991
  1480
patmandin@991
  1481
        # Static linking to -lOSMesa
patmandin@989
  1482
        AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
patmandin@989
  1483
        if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
patmandin@991
  1484
            # -lOSMesa is really the static library
patmandin@989
  1485
            if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
slouken@1361
  1486
                OSMESA_LIBS="-lOSMesa"
patmandin@989
  1487
            fi
patmandin@989
  1488
        else
patmandin@991
  1489
            # -lOSMesa is a loader for OSMesa.ldg
patmandin@989
  1490
            OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
patmandin@989
  1491
            OSMESA_LIBS=`$OSMESA_CONFIG --libs`
patmandin@978
  1492
        fi
slouken@1361
  1493
        AC_DEFINE(SDL_VIDEO_OPENGL)
slouken@1361
  1494
        AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
slouken@1952
  1495
        AC_DEFINE(SDL_VIDEO_RENDER_OGL)
patmandin@1825
  1496
        SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS"
patmandin@1825
  1497
        SDL_LIBS="$SDL_LIBS $OSMESA_LIBS"
patmandin@991
  1498
patmandin@991
  1499
        AC_ARG_ENABLE(osmesa-shared,
slouken@1637
  1500
AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [[default=yes]]]),
patmandin@991
  1501
                              , enable_osmesa_shared=yes)
patmandin@991
  1502
        if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
patmandin@991
  1503
            # Dynamic linking
patmandin@991
  1504
            if test "x$have_osmesa_hdr" = "xyes"; then
slouken@1361
  1505
                AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
patmandin@991
  1506
            fi
slouken@1361
  1507
        fi
patmandin@978
  1508
    fi
patmandin@978
  1509
}
patmandin@978
  1510
slouken@0
  1511
dnl See if we can use the new unified event interface in Linux 2.4
slouken@0
  1512
CheckInputEvents()
slouken@0
  1513
{
slouken@0
  1514
    dnl Check for Linux 2.4 unified input event interface support
slouken@0
  1515
    AC_ARG_ENABLE(input-events,
slouken@1637
  1516
AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [[default=yes]]]),
slouken@211
  1517
                  , enable_input_events=yes)
slouken@0
  1518
    if test x$enable_input_events = xyes; then
slouken@0
  1519
        AC_MSG_CHECKING(for Linux 2.4 unified input interface)
slouken@0
  1520
        use_input_events=no
slouken@0
  1521
        AC_TRY_COMPILE([
slouken@0
  1522
          #include <linux/input.h>
slouken@0
  1523
        ],[
slouken@0
  1524
          #ifndef EVIOCGNAME
slouken@0
  1525
          #error EVIOCGNAME() ioctl not available
slouken@0
  1526
          #endif
slouken@0
  1527
        ],[
slouken@0
  1528
        use_input_events=yes
slouken@0
  1529
        ])
slouken@0
  1530
        AC_MSG_RESULT($use_input_events)
slouken@0
  1531
        if test x$use_input_events = xyes; then
slouken@1361
  1532
            AC_DEFINE(SDL_INPUT_LINUXEV)
slouken@0
  1533
        fi
slouken@0
  1534
    fi
slouken@0
  1535
}
slouken@0
  1536
icculus@1201
  1537
dnl See if we can use the Touchscreen input library
icculus@1201
  1538
CheckTslib()
icculus@1201
  1539
{
icculus@1201
  1540
    AC_ARG_ENABLE(input-tslib,
slouken@1637
  1541
AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
icculus@1201
  1542
                  , enable_input_tslib=yes)
icculus@1201
  1543
    if test x$enable_input_tslib = xyes; then
icculus@1201
  1544
        AC_MSG_CHECKING(for Touchscreen library support)
icculus@1201
  1545
        enable_input_tslib=no
icculus@1201
  1546
        AC_TRY_COMPILE([
icculus@1201
  1547
          #include "tslib.h"
icculus@1201
  1548
        ],[
icculus@1201
  1549
        ],[
icculus@1201
  1550
        enable_input_tslib=yes
icculus@1201
  1551
        ])
icculus@1201
  1552
        AC_MSG_RESULT($enable_input_tslib)
icculus@1201
  1553
        if test x$enable_input_tslib = xyes; then
slouken@1361
  1554
            AC_DEFINE(SDL_INPUT_TSLIB)
slouken@1521
  1555
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
icculus@1201
  1556
        fi
icculus@1201
  1557
    fi
icculus@1201
  1558
}
icculus@1201
  1559
slouken@399
  1560
dnl See if we can use GNU pth library for threads
slouken@399
  1561
CheckPTH()
slouken@399
  1562
{
slouken@399
  1563
    dnl Check for pth support
slouken@399
  1564
    AC_ARG_ENABLE(pth,
slouken@1637
  1565
AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [[default=yes]]]),
slouken@399
  1566
                  , enable_pth=yes)
slouken@399
  1567
    if test x$enable_threads = xyes -a x$enable_pth = xyes; then
slouken@399
  1568
        AC_PATH_PROG(PTH_CONFIG, pth-config, no)
slouken@399
  1569
        if test "$PTH_CONFIG" = "no"; then
slouken@399
  1570
            use_pth=no
slouken@399
  1571
        else
slouken@399
  1572
            use_pth=yes
slouken@399
  1573
        fi
slouken@399
  1574
        AC_MSG_CHECKING(pth)
slouken@1361
  1575
        AC_MSG_RESULT($use_pth)
slouken@399
  1576
        if test "x$use_pth" = xyes; then
slouken@1361
  1577
            AC_DEFINE(SDL_THREAD_PTH)
slouken@1361
  1578
            SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
slouken@1361
  1579
            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
slouken@1361
  1580
            SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
slouken@1361
  1581
            SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`"
slouken@1361
  1582
            have_threads=yes
slouken@399
  1583
        fi
slouken@399
  1584
    fi
slouken@399
  1585
}
slouken@399
  1586
slouken@0
  1587
dnl See what type of thread model to use on Linux and Solaris
slouken@0
  1588
CheckPTHREAD()
slouken@0
  1589
{
slouken@0
  1590
    dnl Check for pthread support
slouken@0
  1591
    AC_ARG_ENABLE(pthreads,
slouken@1637
  1592
AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
slouken@0
  1593
                  , enable_pthreads=yes)
slouken@0
  1594
    dnl This is used on Linux for glibc binary compatibility (Doh!)
slouken@0
  1595
    AC_ARG_ENABLE(pthread-sem,
slouken@1637
  1596
AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
slouken@0
  1597
                  , enable_pthread_sem=yes)
slouken@1550
  1598
    case "$host" in
slouken@1820
  1599
        *-*-linux*|*-*-uclinux*)
slouken@1361
  1600
            pthread_cflags="-D_REENTRANT"
slouken@1324
  1601
            pthread_lib="-lpthread"
slouken@1324
  1602
            ;;
slouken@0
  1603
        *-*-bsdi*)
slouken@0
  1604
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1605
            pthread_lib=""
slouken@0
  1606
            ;;
slouken@0
  1607
        *-*-darwin*)
slouken@0
  1608
            pthread_cflags="-D_THREAD_SAFE"
slouken@0
  1609
# causes Carbon.p complaints?
slouken@0
  1610
#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1611
            ;;
slouken@1565
  1612
        *-*-freebsd*|*-*-dragonfly*)
slouken@0
  1613
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1614
            pthread_lib="-pthread"
slouken@0
  1615
            ;;
slouken@43
  1616
        *-*-netbsd*)
slouken@1383
  1617
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@2158
  1618
            pthread_lib="-lpthread"
slouken@43
  1619
            ;;
slouken@0
  1620
        *-*-openbsd*)
slouken@0
  1621
            pthread_cflags="-D_REENTRANT"
slouken@0
  1622
            pthread_lib="-pthread"
slouken@0
  1623
            ;;
slouken@0
  1624
        *-*-solaris*)
slouken@0
  1625
            pthread_cflags="-D_REENTRANT"
slouken@0
  1626
            pthread_lib="-lpthread -lposix4"
slouken@0
  1627
            ;;
slouken@0
  1628
        *-*-sysv5*)
slouken@0
  1629
            pthread_cflags="-D_REENTRANT -Kthread"
slouken@0
  1630
            pthread_lib=""
slouken@0
  1631
            ;;
slouken@0
  1632
        *-*-irix*)
slouken@0
  1633
            pthread_cflags="-D_SGI_MP_SOURCE"
slouken@0
  1634
            pthread_lib="-lpthread"
slouken@0
  1635
            ;;
slouken@0
  1636
        *-*-aix*)
slouken@0
  1637
            pthread_cflags="-D_REENTRANT -mthreads"
slouken@0
  1638
            pthread_lib="-lpthread"
slouken@0
  1639
            ;;
icculus@425
  1640
        *-*-hpux11*)
icculus@425
  1641
            pthread_cflags="-D_REENTRANT"
icculus@425
  1642
            pthread_lib="-L/usr/lib -lpthread"
icculus@425
  1643
            ;;
slouken@0
  1644
        *-*-qnx*)
slouken@0
  1645
            pthread_cflags=""
slouken@0
  1646
            pthread_lib=""
slouken@0
  1647
            ;;
slouken@873
  1648
        *-*-osf*)
slouken@1019
  1649
            pthread_cflags="-D_REENTRANT"
slouken@873
  1650
            if test x$ac_cv_prog_gcc = xyes; then
slouken@873
  1651
                pthread_lib="-lpthread -lrt"
slouken@873
  1652
            else
slouken@1019
  1653
                pthread_lib="-lpthread -lexc -lrt"
slouken@873
  1654
            fi
slouken@873
  1655
            ;;
slouken@0
  1656
        *)
slouken@0
  1657
            pthread_cflags="-D_REENTRANT"
slouken@0
  1658
            pthread_lib="-lpthread"
slouken@0
  1659
            ;;
slouken@0
  1660
    esac
icculus@1140
  1661
    if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
slouken@415
  1662
        # Save the original compiler flags and libraries
slouken@415
  1663
        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
slouken@415
  1664
        # Add the pthread compiler flags and libraries
slouken@415
  1665
        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
slouken@415
  1666
        # Check to see if we have pthread support on this system
slouken@0
  1667
        AC_MSG_CHECKING(for pthreads)
slouken@0
  1668
        use_pthreads=no
slouken@0
  1669
        AC_TRY_LINK([
slouken@0
  1670
         #include <pthread.h>
slouken@0
  1671
        ],[
slouken@0
  1672
         pthread_attr_t type;
slouken@0
  1673
         pthread_attr_init(&type);
slouken@0
  1674
        ],[
slouken@0
  1675
        use_pthreads=yes
slouken@0
  1676
        ])
slouken@0
  1677
        AC_MSG_RESULT($use_pthreads)
slouken@415
  1678
        # Restore the compiler flags and libraries
slouken@415
  1679
        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
slouken@1361
  1680
slouken@415
  1681
        # Do futher testing if we have pthread support...
slouken@0
  1682
        if test x$use_pthreads = xyes; then
slouken@1361
  1683
            AC_DEFINE(SDL_THREAD_PTHREAD)
slouken@1521
  1684
            EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
slouken@1521
  1685
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
slouken@0
  1686
            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
slouken@0
  1687
            SDL_LIBS="$SDL_LIBS $pthread_lib"
slouken@0
  1688
slouken@1438
  1689
            # Save the original compiler flags and libraries
slouken@1438
  1690
            ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
slouken@1438
  1691
            # Add the pthread compiler flags and libraries
slouken@1438
  1692
            CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
slouken@1438
  1693
slouken@0
  1694
            # Check to see if recursive mutexes are available
slouken@0
  1695
            AC_MSG_CHECKING(for recursive mutexes)
slouken@0
  1696
            has_recursive_mutexes=no
slouken@1324
  1697
            if test x$has_recursive_mutexes = xno; then
slouken@1324
  1698
                AC_TRY_COMPILE([
slouken@1324
  1699
                  #include <pthread.h>
slouken@1324
  1700
                ],[
slouken@1324
  1701
                  pthread_mutexattr_t attr;
slouken@1324
  1702
                  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
slouken@1324
  1703
                ],[
slouken@1324
  1704
                has_recursive_mutexes=yes
slouken@1361
  1705
                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX)
slouken@1324
  1706
                ])
slouken@1324
  1707
            fi
slouken@1324
  1708
            if test x$has_recursive_mutexes = xno; then
slouken@1324
  1709
                AC_TRY_COMPILE([
slouken@1324
  1710
                  #include <pthread.h>
slouken@1324
  1711
                ],[
slouken@1324
  1712
                  pthread_mutexattr_t attr;
slouken@1324
  1713
                  pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
slouken@1324
  1714
                ],[
slouken@1324
  1715
                has_recursive_mutexes=yes
slouken@1361
  1716
                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)
slouken@1324
  1717
                ])
slouken@1324
  1718
            fi
slouken@0
  1719
            AC_MSG_RESULT($has_recursive_mutexes)
slouken@0
  1720
slouken@94
  1721
            # Check to see if pthread semaphore support is missing
slouken@94
  1722
            if test x$enable_pthread_sem = xyes; then
slouken@94
  1723
                AC_MSG_CHECKING(for pthread semaphores)
slouken@94
  1724
                have_pthread_sem=no
slouken@94
  1725
                AC_TRY_COMPILE([
slouken@94
  1726
                  #include <pthread.h>
slouken@94
  1727
                  #include <semaphore.h>
slouken@94
  1728
                ],[
slouken@94
  1729
                ],[
slouken@94
  1730
                have_pthread_sem=yes
slouken@94
  1731
                ])
slouken@94
  1732
                AC_MSG_RESULT($have_pthread_sem)
slouken@94
  1733
            fi
slouken@94
  1734
slouken@1438
  1735
            # Restore the compiler flags and libraries
slouken@1438
  1736
            CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
slouken@1438
  1737
slouken@1361
  1738
            # Basic thread creation functions
slouken@1361
  1739
            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
slouken@0
  1740
slouken@1361
  1741
            # Semaphores
slouken@1361
  1742
            # We can fake these with mutexes and condition variables if necessary
slouken@1361
  1743
            if test x$have_pthread_sem = xyes; then
slouken@1361
  1744
                SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
slouken@1361
  1745
            else
slouken@1361
  1746
                SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
slouken@1361
  1747
            fi
slouken@0
  1748
slouken@1361
  1749
            # Mutexes
slouken@1361
  1750
            # We can fake these with semaphores if necessary
slouken@1361
  1751
            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
slouken@0
  1752
slouken@1361
  1753
            # Condition variables
slouken@1361
  1754
            # We can fake these with semaphores and mutexes if necessary
slouken@1361
  1755
            SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
slouken@399
  1756
slouken@1361
  1757
            have_threads=yes
slouken@185
  1758
        else
slouken@1361
  1759
            CheckPTH
slouken@814
  1760
        fi
slouken@814
  1761
    fi
slouken@814
  1762
}
slouken@814
  1763
slouken@0
  1764
dnl Determine whether the compiler can produce Win32 executables
slouken@0
  1765
CheckWIN32()
slouken@0
  1766
{
slouken@0
  1767
    AC_MSG_CHECKING(Win32 compiler)
slouken@0
  1768
    have_win32_gcc=no
slouken@0
  1769
    AC_TRY_COMPILE([
slouken@0
  1770
     #include <windows.h>
slouken@0
  1771
    ],[
slouken@0
  1772
    ],[
slouken@0
  1773
    have_win32_gcc=yes
slouken@0
  1774
    ])
slouken@0
  1775
    AC_MSG_RESULT($have_win32_gcc)
slouken@0
  1776
    if test x$have_win32_gcc != xyes; then
slouken@0
  1777
       AC_MSG_ERROR([
slouken@0
  1778
*** Your compiler ($CC) does not produce Win32 executables!
slouken@0
  1779
       ])
slouken@0
  1780
    fi
slouken@0
  1781
slouken@0
  1782
    dnl See if the user wants to redirect standard output to files
slouken@0
  1783
    AC_ARG_ENABLE(stdio-redirect,
slouken@1637
  1784
AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]),
slouken@0
  1785
                  , enable_stdio_redirect=yes)
slouken@0
  1786
    if test x$enable_stdio_redirect != xyes; then
slouken@1521
  1787
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_STDIO_REDIRECT"
slouken@1361
  1788
    fi
slouken@0
  1789
}
slouken@0
  1790
slouken@0
  1791
dnl Find the DirectX includes and libraries
slouken@0
  1792
CheckDIRECTX()
slouken@0
  1793
{
slouken@0
  1794
    AC_ARG_ENABLE(directx,
slouken@1637
  1795
AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=yes]]]),
slouken@0
  1796
                  , enable_directx=yes)
slouken@0
  1797
    if test x$enable_directx = xyes; then
slouken@1895
  1798
        AC_CHECK_HEADER(d3d9.h, have_d3d=yes)
slouken@1361
  1799
        AC_CHECK_HEADER(dsound.h, have_dsound=yes)
slouken@1361
  1800
        AC_CHECK_HEADER(dinput.h, use_dinput=yes)
slouken@0
  1801
    fi
slouken@158
  1802
}
slouken@158
  1803
slouken@294
  1804
dnl Check for the dlfcn.h interface for dynamically loading objects
slouken@294
  1805
CheckDLOPEN()
slouken@294
  1806
{
slouken@731
  1807
    AC_ARG_ENABLE(sdl-dlopen,
slouken@1637
  1808
AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
slouken@731
  1809
                  , enable_sdl_dlopen=yes)
slouken@731
  1810
    if test x$enable_sdl_dlopen = xyes; then
slouken@294
  1811
        AC_MSG_CHECKING(for dlopen)
slouken@1361
  1812
        have_dlopen=no
slouken@294
  1813
        AC_TRY_COMPILE([
slouken@294
  1814
         #include <dlfcn.h>
slouken@294
  1815
        ],[
slouken@1638
  1816
         #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED <= 1020
slouken@1638
  1817
         #error Use dlcompat for Mac OS X 10.2 compatibility
slouken@1638
  1818
         #endif
slouken@294
  1819
        ],[
slouken@1361
  1820
        have_dlopen=yes
slouken@294
  1821
        ])
slouken@1361
  1822
        AC_MSG_RESULT($have_dlopen)
slouken@294
  1823
slouken@1361
  1824
        if test x$have_dlopen = xyes; then
slouken@1521
  1825
            AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
slouken@1521
  1826
               AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
slouken@1521
  1827
                  AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
slouken@1361
  1828
            AC_CHECK_LIB(dl, dlvsym, have_dlvsym=yes)
slouken@1361
  1829
            if test x$have_dlvsym = xyes; then
slouken@1361
  1830
                AC_DEFINE(HAVE_DLVSYM)
slouken@1361
  1831
            fi
slouken@1361
  1832
            AC_DEFINE(SDL_LOADSO_DLOPEN)
slouken@1361
  1833
            SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
slouken@1361
  1834
            have_loadso=yes
slouken@294
  1835
        fi
slouken@294
  1836
    fi
slouken@294
  1837
}
slouken@294
  1838
patmandin@651
  1839
dnl Set up the Atari LDG (shared object loader)
patmandin@651
  1840
CheckAtariLdg()
patmandin@651
  1841
{
patmandin@651
  1842
    AC_ARG_ENABLE(atari-ldg,
slouken@1637
  1843
AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]),
patmandin@651
  1844
                  , enable_atari_ldg=yes)
patmandin@651
  1845
    if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
patmandin@651
  1846
        AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
patmandin@651
  1847
        AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
patmandin@651
  1848
        if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
slouken@1361
  1849
            AC_DEFINE(SDL_LOADSO_LDG)
slouken@1361
  1850
            SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
patmandin@1825
  1851
            SDL_LIBS="$SDL_LIBS -lldg -lgem"
icculus@1173
  1852
            have_loadso=yes
patmandin@651
  1853
        fi
patmandin@651
  1854
    fi
patmandin@651
  1855
}
patmandin@651
  1856
slouken@381
  1857
dnl Check for the usbhid(3) library on *BSD
slouken@381
  1858
CheckUSBHID()
slouken@381
  1859
{
slouken@381
  1860
    if test x$enable_joystick = xyes; then
slouken@1565
  1861
        AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
slouken@1565
  1862
        if test x$have_libusbhid = xyes; then
slouken@1565
  1863
            AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
slouken@1565
  1864
            AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
slouken@1565
  1865
            USB_LIBS="$USB_LIBS -lusbhid"
slouken@1565
  1866
        else
slouken@1565
  1867
            AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
slouken@1565
  1868
            AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
slouken@1565
  1869
            AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
slouken@1565
  1870
        fi
slouken@1361
  1871
            
slouken@1361
  1872
        save_CFLAGS="$CFLAGS"
slouken@1361
  1873
        CFLAGS="$CFLAGS $USB_CFLAGS"
slouken@381
  1874
slouken@381
  1875
        AC_MSG_CHECKING(for usbhid)
slouken@381
  1876
        have_usbhid=no
slouken@381
  1877
        AC_TRY_COMPILE([
slouken@404
  1878
          #include <sys/types.h>
slouken@403
  1879
          #if defined(HAVE_USB_H)
slouken@403
  1880
          #include <usb.h>
slouken@403
  1881
          #endif
slouken@1565
  1882
          #ifdef __DragonFly__
slouken@1565
  1883
          # include <bus/usb/usb.h>
slouken@1565
  1884
          # include <bus/usb/usbhid.h>
slouken@1565
  1885
          #else
slouken@1565
  1886
          # include <dev/usb/usb.h>
slouken@1565
  1887
          # include <dev/usb/usbhid.h>
slouken@1565
  1888
          #endif
slouken@381
  1889
          #if defined(HAVE_USBHID_H)
slouken@381
  1890
          #include <usbhid.h>
slouken@381
  1891
          #elif defined(HAVE_LIBUSB_H)
slouken@381
  1892
          #include <libusb.h>
slouken@381
  1893
          #elif defined(HAVE_LIBUSBHID_H)
slouken@381
  1894
          #include <libusbhid.h>
slouken@404
  1895
          #endif
slouken@381
  1896
        ],[
slouken@381
  1897
          struct report_desc *repdesc;
slouken@381
  1898
          struct usb_ctl_report *repbuf;
slouken@402
  1899
          hid_kind_t hidkind;
slouken@381
  1900
        ],[
slouken@381
  1901
        have_usbhid=yes
slouken@381
  1902
        ])
slouken@381
  1903
        AC_MSG_RESULT($have_usbhid)
slouken@381
  1904
slouken@381
  1905
        if test x$have_usbhid = xyes; then
slouken@381
  1906
            AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
slouken@381
  1907
            have_usbhid_ucr_data=no
slouken@381
  1908
            AC_TRY_COMPILE([
slouken@404
  1909
              #include <sys/types.h>
slouken@404
  1910
              #if defined(HAVE_USB_H)
slouken@404
  1911
              #include <usb.h>
slouken@404
  1912
              #endif
slouken@1565
  1913
              #ifdef __DragonFly__
slouken@1565
  1914
              # include <bus/usb/usb.h>
slouken@1565
  1915
              # include <bus/usb/usbhid.h>
slouken@1565
  1916
              #else
slouken@1565
  1917
              # include <dev/usb/usb.h>
slouken@1565
  1918
              # include <dev/usb/usbhid.h>
slouken@1565
  1919
              #endif
slouken@381
  1920
              #if defined(HAVE_USBHID_H)
slouken@381
  1921
              #include <usbhid.h>
slouken@381
  1922
              #elif defined(HAVE_LIBUSB_H)
slouken@381
  1923
              #include <libusb.h>
slouken@381
  1924
              #elif defined(HAVE_LIBUSBHID_H)
slouken@381
  1925
              #include <libusbhid.h>
slouken@381
  1926
              #endif
slouken@381
  1927
            ],[
slouken@381
  1928
              struct usb_ctl_report buf;
slouken@381
  1929
              if (buf.ucr_data) { }
slouken@381
  1930
            ],[
slouken@381
  1931
            have_usbhid_ucr_data=yes
slouken@381
  1932
            ])
slouken@381
  1933
            if test x$have_usbhid_ucr_data = xyes; then
slouken@1361
  1934
                USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
slouken@381
  1935
            fi
slouken@381
  1936
            AC_MSG_RESULT($have_usbhid_ucr_data)
slouken@407
  1937
            
slouken@1361
  1938
            AC_MSG_CHECKING(for new usbhid API)
slouken@407
  1939
            have_usbhid_new=no
slouken@407
  1940
            AC_TRY_COMPILE([
slouken@407
  1941
              #include <sys/types.h>
slouken@407
  1942
              #if defined(HAVE_USB_H)
slouken@407
  1943
              #include <usb.h>
slouken@407
  1944
              #endif
slouken@2158
  1945
	      #ifdef __DragonFly__
slouken@2158
  1946
              #include <bus/usb/usb.h>
slouken@2158
  1947
              #include <bus/usb/usbhid.h>
slouken@2158
  1948
	      #else
slouken@407
  1949
              #include <dev/usb/usb.h>
slouken@407
  1950
              #include <dev/usb/usbhid.h>
slouken@2158
  1951
	      #endif
slouken@407
  1952
              #if defined(HAVE_USBHID_H)
slouken@407
  1953
              #include <usbhid.h>
slouken@407
  1954
              #elif defined(HAVE_LIBUSB_H)
slouken@407
  1955
              #include <libusb.h>
slouken@407
  1956
              #elif defined(HAVE_LIBUSBHID_H)
slouken@407
  1957
              #include <libusbhid.h>
slouken@407
  1958
              #endif
slouken@407
  1959
            ],[
slouken@407
  1960
              report_desc_t d;
slouken@1361
  1961
              hid_start_parse(d, 1, 1);
slouken@407
  1962
            ],[
slouken@407
  1963
            have_usbhid_new=yes
slouken@407
  1964
            ])
slouken@407
  1965
            if test x$have_usbhid_new = xyes; then
slouken@1361
  1966
                USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
slouken@407
  1967
            fi
slouken@407
  1968
            AC_MSG_RESULT($have_usbhid_new)
slouken@381
  1969
slouken@1565
  1970
            AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
slouken@1565
  1971
            have_machine_joystick=no
slouken@1565
  1972
            AC_TRY_COMPILE([
slouken@1565
  1973
              #include <machine/joystick.h>
slouken@1565
  1974
            ],[
slouken@1565
  1975
              struct joystick t;
slouken@1565
  1976
            ],[
slouken@1565
  1977
            have_machine_joystick=yes
slouken@1565
  1978
            ])
slouken@1565
  1979
            if test x$have_machine_joystick = xyes; then
slouken@1565
  1980
                AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
slouken@1565
  1981
            fi
slouken@1565
  1982
            AC_MSG_RESULT($have_machine_joystick)
slouken@1565
  1983
slouken@1361
  1984
            AC_DEFINE(SDL_JOYSTICK_USBHID)
slouken@1361
  1985
            SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
slouken@1521
  1986
            EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
slouken@1521
  1987
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
slouken@1361
  1988
            have_joystick=yes
slouken@381
  1989
        fi
slouken@1361
  1990
        CFLAGS="$save_CFLAGS"
slouken@381
  1991
    fi
slouken@381
  1992
}
slouken@381
  1993
slouken@1361
  1994
dnl Check for clock_gettime()
slouken@1361
  1995
CheckClockGettime()
slouken@795
  1996
{
slouken@1361
  1997
    AC_ARG_ENABLE(clock_gettime,
slouken@1637
  1998
AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=no]]]),
slouken@1361
  1999
                  , enable_clock_gettime=no)
slouken@1361
  2000
    if test x$enable_clock_gettime = xyes; then
slouken@1361
  2001
        AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
slouken@1361
  2002
        if test x$have_clock_gettime = xyes; then
slouken@1361
  2003
            AC_DEFINE(HAVE_CLOCK_GETTIME)
slouken@1521
  2004
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
icculus@1175
  2005
        fi
slouken@795
  2006
    fi
slouken@795
  2007
}
slouken@795
  2008
slouken@1062
  2009
dnl Check for a valid linux/version.h
slouken@1062
  2010
CheckLinuxVersion()
slouken@1062
  2011
{
slouken@1062
  2012
    AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
slouken@1062
  2013
    if test x$have_linux_version_h = xyes; then
slouken@1521
  2014
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
slouken@1062
  2015
    fi
slouken@1062
  2016
}
slouken@1062
  2017
slouken@1127
  2018
dnl Check if we want to use RPATH
slouken@1127
  2019
CheckRPATH()
slouken@1127
  2020
{
slouken@1127
  2021
    AC_ARG_ENABLE(rpath,
slouken@1637
  2022
AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
slouken@1127
  2023
                  , enable_rpath=yes)
slouken@1127
  2024
}
slouken@1127
  2025
slouken@1550
  2026
dnl Set up the configuration based on the host platform!
slouken@1550
  2027
case "$host" in
slouken@1361
  2028
    arm-*-elf*) # FIXME: Can we get more specific for iPodLinux?
slouken@1361
  2029
        ARCH=linux
slouken@1361
  2030
        CheckDummyVideo
slouken@1361
  2031
        CheckIPod
slouken@1361
  2032
        # Set up files for the timer library
icculus@1140
  2033
        if test x$enable_timers = xyes; then
slouken@1361
  2034
            AC_DEFINE(SDL_TIMER_UNIX)
slouken@1361
  2035
            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
slouken@1361
  2036
            have_timers=yes
icculus@1140
  2037
        fi
slouken@1361
  2038
        ;;
slouken@1820
  2039
    *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
slouken@1550
  2040
        case "$host" in
slouken@1361
  2041
            *-*-linux*)         ARCH=linux ;;
slouken@1820
  2042
            *-*-uclinux*)       ARCH=linux ;;
slouken@1361
  2043
            *-*-kfreebsd*-gnu)  ARCH=kfreebsd-gnu ;;
slouken@1361
  2044
            *-*-knetbsd*-gnu)   ARCH=knetbsd-gnu ;;
slouken@1361
  2045
            *-*-kopenbsd*-gnu)  ARCH=kopenbsd-gnu ;;
slouken@1361
  2046
            *-*-gnu*)           ARCH=gnu ;; # must be last of the gnu variants
slouken@1361
  2047
            *-*-bsdi*)          ARCH=bsdi ;;
slouken@1361
  2048
            *-*-freebsd*)       ARCH=freebsd ;;
slouken@1565
  2049
            *-*-dragonfly*)     ARCH=freebsd ;;
slouken@1361
  2050
            *-*-netbsd*)        ARCH=netbsd ;;
slouken@1361
  2051
            *-*-openbsd*)       ARCH=openbsd ;;
slouken@1361
  2052
            *-*-sysv5*)         ARCH=sysv5 ;;
slouken@1361
  2053
            *-*-solaris*)       ARCH=solaris ;;
slouken@1361
  2054
            *-*-hpux*)          ARCH=hpux ;;
slouken@1361
  2055
            *-*-irix*)          ARCH=irix ;;
slouken@1361
  2056
            *-*-aix*)           ARCH=aix ;;
slouken@1361
  2057
            *-*-osf*)           ARCH=osf ;;
slouken@795
  2058
        esac
icculus@1573
  2059
        CheckVisibilityHidden
slouken@1
  2060
        CheckDummyVideo
slouken@68
  2061
        CheckDiskAudio
icculus@1532
  2062
        CheckDummyAudio
slouken@371
  2063
        CheckDLOPEN
slouken@0
  2064
        CheckOSS
slouken@1361
  2065
        CheckDMEDIA
slouken@1438
  2066
        CheckMME
slouken@0
  2067
        CheckALSA
slouken@0
  2068
        CheckARTSC
slouken@0
  2069
        CheckESD
slouken@0
  2070
        CheckNAS
slouken@0
  2071
        CheckX11
slouken@30
  2072
        CheckNANOX
slouken@0
  2073
        CheckFBCON
slouken@167
  2074
        CheckDirectFB
slouken@70
  2075
        CheckPS2GS
slouken@0
  2076
        CheckSVGA
slouken@1361
  2077
        CheckVGL
slouken@1361
  2078
        CheckWscons
icculus@1191
  2079
        CheckOpenGLX11
slouken@0
  2080
        CheckInputEvents
icculus@1201
  2081
        CheckTslib
slouken@1361
  2082
        CheckUSBHID
slouken@0
  2083
        CheckPTHREAD
slouken@1361
  2084
        CheckClockGettime
slouken@1062
  2085
        CheckLinuxVersion
slouken@1127
  2086
        CheckRPATH
slouken@1361
  2087
        # Set up files for the audio library
slouken@1361
  2088
        if test x$enable_audio = xyes; then
slouken@1361
  2089
          case $ARCH in
slouken@1565
  2090
            sysv5|solaris|hpux)
slouken@1361
  2091
                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
slouken@1361
  2092
                SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
slouken@1361
  2093
                have_audio=yes
slouken@1361
  2094
            ;;
slouken@1565
  2095
            netbsd|openbsd)
slouken@1567
  2096
                AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
slouken@1567
  2097
                SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
slouken@1361
  2098
                have_audio=yes
slouken@1361
  2099
            ;;
slouken@1361
  2100
            aix)
icculus@2049
  2101
                AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO)
slouken@1361
  2102
                SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
slouken@1361
  2103
                have_audio=yes
slouken@1361
  2104
            ;;
slouken@1361
  2105
          esac
slouken@371
  2106
        fi
slouken@0
  2107
        # Set up files for the joystick library
slouken@0
  2108
        if test x$enable_joystick = xyes; then
slouken@1361
  2109
          case $ARCH in
slouken@1361
  2110
            linux)
slouken@1361
  2111
                AC_DEFINE(SDL_JOYSTICK_LINUX)
slouken@1361
  2112
                SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
slouken@1361
  2113
                have_joystick=yes
slouken@1361
  2114
            ;;
slouken@1361
  2115
          esac
slouken@0
  2116
        fi
slouken@0
  2117
        # Set up files for the cdrom library
slouken@0
  2118
        if test x$enable_cdrom = xyes; then
slouken@1361
  2119
          case $ARCH in
slouken@1361
  2120
            linux|solaris)
slouken@1361
  2121
                AC_DEFINE(SDL_CDROM_LINUX)
slouken@1361
  2122
                SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
slouken@1361
  2123
                have_cdrom=yes
slouken@1361
  2124
            ;;
slouken@1361
  2125
            *freebsd*)
slouken@1361
  2126
                AC_DEFINE(SDL_CDROM_FREEBSD)
slouken@1361
  2127
                SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
slouken@1361
  2128
                have_cdrom=yes
slouken@1361
  2129
            ;;
slouken@1383
  2130
            *openbsd*|*netbsd*)
slouken@1361
  2131
                AC_DEFINE(SDL_CDROM_OPENBSD)
slouken@1361
  2132
                SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
slouken@1361
  2133
                have_cdrom=yes
slouken@1361
  2134
            ;;
slouken@1361
  2135
            bsdi)
slouken@1361
  2136
                AC_DEFINE(SDL_CDROM_BSDI)
slouken@1361
  2137
                SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
slouken@1361
  2138
                have_cdrom=yes
slouken@1361
  2139
            ;;
slouken@1361
  2140
            aix)
slouken@1361
  2141
                AC_DEFINE(SDL_CDROM_AIX)
slouken@1361
  2142
                SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
slouken@1361
  2143
                have_cdrom=yes
slouken@1361
  2144
            ;;
slouken@1361
  2145
            osf)
slouken@1361
  2146
                AC_DEFINE(SDL_CDROM_OSF)
slouken@1361
  2147
                SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
slouken@1361
  2148
                have_cdrom=yes
slouken@1361
  2149
            ;;
slouken@1361
  2150
          esac
slouken@0
  2151
        fi
slouken@0
  2152
        # Set up files for the thread library
slouken@1361
  2153
        if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
slouken@1361
  2154
            AC_DEFINE(SDL_THREAD_SPROC)
slouken@1361
  2155
            SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
slouken@1361
  2156
            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
slouken@1361
  2157
            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
slouken@1361
  2158
            have_threads=yes
slouken@0
  2159
        fi
slouken@0
  2160
        # Set up files for the timer library
slouken@0
  2161
        if test x$enable_timers = xyes; then
slouken@1361
  2162
            AC_DEFINE(SDL_TIMER_UNIX)
slouken@1361
  2163
            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
slouken@1361
  2164
            have_timers=yes
slouken@0
  2165
        fi
slouken@0
  2166
        ;;
slouken@0
  2167
    *-*-qnx*)
slouken@0
  2168
        ARCH=qnx
slouken@1
  2169
        CheckDummyVideo
slouken@68
  2170
        CheckDiskAudio
icculus@1532
  2171
        CheckDummyAudio
slouken@371
  2172
        CheckDLOPEN
slouken@0
  2173
        CheckNAS
slouken@0
  2174
        CheckPHOTON
slouken@0
  2175
        CheckX11
icculus@1191
  2176
        CheckOpenGLX11
slouken@0
  2177
        CheckPTHREAD
slouken@0
  2178
        # Set up files for the audio library
slouken@0
  2179
        if test x$enable_audio = xyes; then
slouken@1361
  2180
            AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
slouken@1361
  2181
            SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
slouken@1521
  2182
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
slouken@1361
  2183
            have_audio=yes
slouken@0
  2184
        fi
slouken@0
  2185
        # Set up files for the cdrom library
slouken@0
  2186
        if test x$enable_cdrom = xyes; then
slouken@1361
  2187
            AC_DEFINE(SDL_CDROM_QNX)
slouken@1361
  2188
            SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
slouken@1361
  2189
            have_cdrom=yes
slouken@0
  2190
        fi
slouken@0
  2191
        # Set up files for the timer library
slouken@0
  2192
        if test x$enable_timers = xyes; then
slouken@1361
  2193
            AC_DEFINE(SDL_TIMER_UNIX)
slouken@1361
  2194
            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
slouken@1361
  2195
            have_timers=yes
slouken@0
  2196
        fi
slouken@0
  2197
        ;;
slouken@0
  2198
    *-*-cygwin* | *-*-mingw32*)
slouken@0
  2199
        ARCH=win32
slouken@1550
  2200
        if test "$build" != "$host"; then # cross-compiling
slouken@0
  2201
            # Default cross-compile location
slouken@2148
  2202
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32
slouken@0
  2203
        else
slouken@0
  2204
            # Look for the location of the tools and install there
slouken@750
  2205
            if test "$BUILD_PREFIX" != ""; then
slouken@1
  2206
                ac_default_prefix=$BUILD_PREFIX
slouken@1
  2207
            fi
slouken@0
  2208
        fi
slouken@1
  2209
        CheckDummyVideo
slouken@68
  2210
        CheckDiskAudio
icculus@1532
  2211
        CheckDummyAudio
slouken@0
  2212
        CheckWIN32
slouken@1361
  2213
        CheckWIN32GL
slouken@0
  2214
        CheckDIRECTX
slouken@1895
  2215
        # Set up files for the video library
slouken@1895
  2216
        if test x$enable_video = xyes; then
slouken@1895
  2217
            AC_DEFINE(SDL_VIDEO_DRIVER_WIN32)
slouken@1895
  2218
            SOURCES="$SOURCES $srcdir/src/video/win32/*.c"
slouken@1895
  2219
            have_video=yes
slouken@1895
  2220
            AC_ARG_ENABLE(render-gdi,
slouken@1895
  2221
AC_HELP_STRING([--enable-render-gdi], [enable the GDI render driver [[default=yes]]]),
slouken@1895
  2222
                                , enable_render_gdi=yes)
slouken@1895
  2223
            if test x$enable_render_gdi = xyes; then
slouken@1895
  2224
                AC_DEFINE(SDL_VIDEO_RENDER_GDI)
slouken@1895
  2225
            fi
slouken@1895
  2226
            AC_ARG_ENABLE(render-d3d,
slouken@1895
  2227
AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
slouken@1895
  2228
                                , enable_render_d3d=yes)
slouken@1895
  2229
            if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
slouken@1895
  2230
                AC_DEFINE(SDL_VIDEO_RENDER_D3D)
slouken@1895
  2231
            fi
slouken@1895
  2232
        fi
slouken@0
  2233
        # Set up files for the audio library
slouken@0
  2234
        if test x$enable_audio = xyes; then
icculus@2070
  2235
            AC_DEFINE(SDL_AUDIO_DRIVER_WINWAVEOUT)
slouken@1361
  2236
            SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
slouken@1895
  2237
            if test x$have_dsound = xyes; then
slouken@1361
  2238
                AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
slouken@1361
  2239
                SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
slouken@0
  2240
            fi
slouken@1361
  2241
            have_audio=yes
slouken@0
  2242
        fi
slouken@0
  2243
        # Set up files for the joystick library
slouken@0
  2244
        if test x$enable_joystick = xyes; then
slouken@1895
  2245
            if test x$have_dinput = xyes; then
slouken@1895
  2246
                AC_DEFINE(SDL_JOYSTICK_DINPUT)
slouken@1895
  2247
                SOURCES="$SOURCES $srcdir/src/joystick/win32/SDL_dxjoystick.c"
slouken@1895
  2248
            else
slouken@1895
  2249
                AC_DEFINE(SDL_JOYSTICK_WINMM)
slouken@1895
  2250
                SOURCES="$SOURCES $srcdir/src/joystick/win32/SDL_mmjoystick.c"
slouken@1895
  2251
            fi
slouken@1361
  2252
            have_joystick=yes
slouken@0
  2253
        fi
slouken@0
  2254
        # Set up files for the cdrom library
slouken@0
  2255
        if test x$enable_cdrom = xyes; then
slouken@1361
  2256
            AC_DEFINE(SDL_CDROM_WIN32)
slouken@1361
  2257
            SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
slouken@1361
  2258
            have_cdrom=yes
slouken@0
  2259
        fi
slouken@0
  2260
        # Set up files for the thread library
slouken@0
  2261
        if test x$enable_threads = xyes; then
slouken@1361
  2262
            AC_DEFINE(SDL_THREAD_WIN32)
slouken@1361
  2263
            SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
slouken@1361
  2264
            SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
slouken@1361
  2265
            SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
slouken@1361
  2266
            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
slouken@1361
  2267
            have_threads=yes
slouken@0
  2268
        fi
slouken@0
  2269
        # Set up files for the timer library
slouken@0
  2270
        if test x$enable_timers = xyes; then
slouken@1361
  2271
            AC_DEFINE(SDL_TIMER_WIN32)
slouken@1361
  2272
            SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
slouken@1361
  2273
            have_timers=yes
slouken@1361
  2274
        fi
slouken@1361
  2275
        # Set up files for the shared object loading library
slouken@1361
  2276
        if test x$enable_loadso = xyes; then
slouken@1361
  2277
            AC_DEFINE(SDL_LOADSO_WIN32)
slouken@1361
  2278
            SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
slouken@1361
  2279
            have_loadso=yes
slouken@1361
  2280
        fi
slouken@1361
  2281
        # Set up the system libraries we need
slouken@2148
  2282
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lunicows -luser32 -lgdi32 -lmsimg32 -lwinmm"
slouken@0
  2283
        # The Win32 platform requires special setup
slouken@2204
  2284
        SOURCES="$SOURCES $srcdir/src/main/win32/*.rc"
slouken@1397
  2285
        SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
slouken@0
  2286
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@1363
  2287
        SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
slouken@0
  2288
        ;;
slouken@0
  2289
    *-*-beos*)
slouken@0
  2290
        ARCH=beos
slouken@0
  2291
        ac_default_prefix=/boot/develop/tools/gnupro
slouken@1
  2292
        CheckDummyVideo
slouken@68
  2293
        CheckDiskAudio
icculus@1532
  2294
        CheckDummyAudio
slouken@0
  2295
        CheckBWINDOW
slouken@0
  2296
        CheckBeGL
slouken@0
  2297
        # Set up files for the audio library
slouken@0
  2298
        if test x$enable_audio = xyes; then
icculus@2049
  2299
            AC_DEFINE(SDL_AUDIO_DRIVER_BEOSAUDIO)
slouken@1361
  2300
            SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
slouken@1361
  2301
            have_audio=yes
slouken@0
  2302
        fi
slouken@0
  2303
        # Set up files for the joystick library
slouken@0
  2304
        if test x$enable_joystick = xyes; then
slouken@1361
  2305
            AC_DEFINE(SDL_JOYSTICK_BEOS)
slouken@1361
  2306
            SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
slouken@1361
  2307
            have_joystick=yes
slouken@0
  2308
        fi
slouken@0
  2309
        # Set up files for the cdrom library
slouken@0
  2310
        if test x$enable_cdrom = xyes; then
slouken@1361
  2311
            AC_DEFINE(SDL_CDROM_BEOS)
slouken@1361
  2312
            SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
slouken@1361
  2313
            have_cdrom=yes
slouken@0
  2314
        fi
slouken@0
  2315
        # Set up files for the thread library
slouken@0
  2316
        if test x$enable_threads = xyes; then
slouken@1361
  2317
            AC_DEFINE(SDL_THREAD_BEOS)
slouken@1361
  2318
            SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
slouken@1361
  2319
            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
slouken@1361
  2320
            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
slouken@1361
  2321
            have_threads=yes
slouken@0
  2322
        fi
slouken@0
  2323
        # Set up files for the timer library
slouken@0
  2324
        if test x$enable_timers = xyes; then
slouken@1361
  2325
            AC_DEFINE(SDL_TIMER_BEOS)
slouken@1361
  2326
            SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
slouken@1361
  2327
            have_timers=yes
slouken@1361
  2328
        fi
slouken@1361
  2329
        # Set up files for the shared object loading library
slouken@1361
  2330
        if test x$enable_loadso = xyes; then
slouken@1361
  2331
            AC_DEFINE(SDL_LOADSO_BEOS)
slouken@1361
  2332
            SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
slouken@1361
  2333
            have_loadso=yes
slouken@0
  2334
        fi
slouken@1367
  2335
        # The BeOS platform requires special setup.
slouken@1367
  2336
        SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
slouken@1521
  2337
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
slouken@0
  2338
        ;;
slouken@0
  2339
    *-*-darwin* )
icculus@1133
  2340
        # This could be either full "Mac OS X", or plain "Darwin" which is
slouken@158
  2341
        # just the OS X kernel sans upper layers like Carbon and Cocoa.
icculus@1133
  2342
        # Next line is broken, and a few files below require Mac OS X (full)
slouken@158
  2343
        ARCH=macosx
slouken@1624
  2344
slouken@1628
  2345
        # Mac OS X builds with both the Carbon and OSX APIs at the moment
slouken@1638
  2346
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
slouken@1638
  2347
        EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
slouken@1628
  2348
slouken@1628
  2349
        # HACK: Reset EXTRA_LDFLAGS; the only thing it contains at this point
slouken@1628
  2350
        # is -lm which is not needed under Mac OS X. But for some reasons it
slouken@1628
  2351
        # also tends to contain spurious -L switches, which we don't want to
slouken@1628
  2352
        # use here or in sdl-config. Hence we reset it.
slouken@1624
  2353
        EXTRA_LDFLAGS=""
slouken@1624
  2354
slouken@1742
  2355
        CheckVisibilityHidden
slouken@1
  2356
        CheckDummyVideo
slouken@68
  2357
        CheckDiskAudio
icculus@1532
  2358
        CheckDummyAudio
slouken@1638
  2359
        CheckDLOPEN
slouken@1889
  2360
slouken@1648
  2361
        # Set up files for the shared object loading library
slouken@1648
  2362
        # (this needs to be done before the dynamic X11 check)
slouken@1648
  2363
        if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
slouken@1648
  2364
            AC_DEFINE(SDL_LOADSO_DLCOMPAT)
slouken@1648
  2365
            SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
slouken@1648
  2366
            have_loadso=yes
slouken@1648
  2367
        fi
slouken@1648
  2368
icculus@1133
  2369
        CheckCOCOA
icculus@1174
  2370
        CheckX11
slouken@0
  2371
        CheckMacGL
icculus@1191
  2372
        CheckOpenGLX11
slouken@0
  2373
        CheckPTHREAD
icculus@1445
  2374
slouken@2238
  2375
        # Good optimization on Mac OS X, yes...
slouken@2238
  2376
        EXTRA_CFLAGS="$EXTRA_CFLAGS -falign-loops=16"
slouken@2238
  2377
icculus@1445
  2378
        # Need this or things might misbuild on a G3.
slouken@1521
  2379
        EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
icculus@1445
  2380
slouken@0
  2381
        # Set up files for the audio library
slouken@0
  2382
        if test x$enable_audio = xyes; then
slouken@1361
  2383
            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
slouken@1361
  2384
            SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
slouken@1361
  2385
            AC_DEFINE(SDL_AUDIO_DRIVER_SNDMGR)
slouken@1361
  2386
            SOURCES="$SOURCES $srcdir/src/audio/macrom/*.c"
slouken@1361
  2387
            have_audio=yes
slouken@0
  2388
        fi
slouken@0
  2389
        # Set up files for the joystick library
slouken@0
  2390
        if test x$enable_joystick = xyes; then
slouken@1361
  2391
            AC_DEFINE(SDL_JOYSTICK_IOKIT)
slouken@1361
  2392
            SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
slouken@1361
  2393
            have_joystick=yes
slouken@0
  2394
        fi
slouken@0
  2395
        # Set up files for the cdrom library
slouken@0
  2396
        if test x$enable_cdrom = xyes; then
slouken@1361
  2397
            AC_DEFINE(SDL_CDROM_MACOSX)
slouken@1361
  2398
            SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
slouken@1361
  2399
            have_cdrom=yes
slouken@0
  2400
        fi
slouken@0
  2401
        # Set up files for the timer library
slouken@0
  2402
        if test x$enable_timers = xyes; then
slouken@1361
  2403
            AC_DEFINE(SDL_TIMER_UNIX)
slouken@1361
  2404
            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
slouken@1361
  2405
            have_timers=yes
slouken@1361
  2406
        fi
slouken@1621
  2407
        # The Mac OS X platform requires special setup.
slouken@1521
  2408
        EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
slouken@1910
  2409
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
slouken@1910
  2410
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
icculus@2104
  2411
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
slouken@1361
  2412
        # If either the audio or CD driver is used, add the AudioUnit framework
slouken@1361
  2413
        if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
icculus@2049
  2414
            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -framework,AudioToolbox -Wl,-framework,AudioUnit"
slouken@1361
  2415
        fi
slouken@0
  2416
        ;;
slouken@281
  2417
    *-*-mint*)
slouken@281
  2418
        ARCH=mint
slouken@281
  2419
        CheckDummyVideo
slouken@281
  2420
        CheckDiskAudio
icculus@1532
  2421
        CheckDummyAudio
slouken@281
  2422
        CheckAtariBiosEvent
slouken@281
  2423
        CheckAtariXbiosVideo
slouken@281
  2424
        CheckAtariGemVideo
slouken@398
  2425
        CheckAtariAudio
patmandin@651
  2426
        CheckAtariLdg
slouken@1361
  2427
        CheckAtariOSMesa
slouken@281
  2428
        CheckPTH
slouken@281
  2429
        # Set up files for the audio library
slouken@398
  2430
        if test x$enable_threads = xyes -a x$enable_pth = xyes; then
slouken@398
  2431
            if test x$enable_audio = xyes; then
slouken@1361
  2432
                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
slouken@1361
  2433
                SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
slouken@1361
  2434
                have_audio=yes
slouken@398
  2435
            fi
slouken@281
  2436
        fi
slouken@281
  2437
        # Set up files for the joystick library
slouken@281
  2438
        if test x$enable_joystick = xyes; then
slouken@1361
  2439
            AC_DEFINE(SDL_JOYSTICK_MINT)
slouken@1361
  2440
            SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
slouken@1361
  2441
            have_joystick=yes
slouken@281
  2442
        fi
slouken@281
  2443
        # Set up files for the cdrom library
slouken@281
  2444
        if test x$enable_cdrom = xyes; then
slouken@1361
  2445
            AC_DEFINE(SDL_CDROM_MINT)
slouken@1361
  2446
            SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
slouken@1361
  2447
            have_cdrom=yes
slouken@281
  2448
        fi
slouken@281
  2449
        # Set up files for the timer library
slouken@281
  2450
        if test x$enable_timers = xyes; then
slouken@557
  2451
            if test x$enable_threads = xyes -a x$enable_pth = xyes; then
slouken@1361
  2452
                AC_DEFINE(SDL_TIMER_UNIX)
slouken@1361
  2453
                SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
slouken@557
  2454
            else
slouken@1361
  2455
                AC_DEFINE(SDL_TIMER_MINT)
slouken@1361
  2456
                SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
patmandin@1477
  2457
                SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
slouken@557
  2458
            fi
slouken@1361
  2459
            have_timers=yes
slouken@281
  2460
        fi
slouken@281
  2461
        ;;
slouken@1035
  2462
    *-riscos)
slouken@687
  2463
        ARCH=riscos
slouken@1361
  2464
        CheckOSS
slouken@1361
  2465
        CheckPTHREAD
slouken@955
  2466
        # Set up files for the video library
slouken@955
  2467
        if test x$enable_video = xyes; then
slouken@1361
  2468
            AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
slouken@1361
  2469
            SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
slouken@1459
  2470
            SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
slouken@1361
  2471
            have_video=yes
slouken@955
  2472
        fi
slouken@955
  2473
        # Set up files for the joystick library
slouken@955
  2474
        if test x$enable_joystick = xyes; then
slouken@1361
  2475
            AC_DEFINE(SDL_JOYSTICK_RISCOS)
slouken@1361
  2476
            SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
slouken@1361
  2477
            have_joystick=yes
slouken@955
  2478
        fi
slouken@955
  2479
        # Set up files for the timer library
slouken@955
  2480
        if test x$enable_timers = xyes; then
slouken@1361
  2481
            AC_DEFINE(SDL_TIMER_RISCOS)
slouken@1361
  2482
            SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
slouken@1361
  2483
            have_timers=yes
slouken@955
  2484
        fi
slouken@1361
  2485
        # The RISC OS platform requires special setup.
slouken@1521
  2486
        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
slouken@687
  2487
        ;;
slouken@0
  2488
    *)
slouken@1361
  2489
        AC_MSG_ERROR([
slouken@1550
  2490
*** Unsupported host:  Please add to configure.in
slouken@1361
  2491
        ])
slouken@0
  2492
        ;;
slouken@0
  2493
esac
slouken@0
  2494
slouken@1361
  2495
# Verify that we have all the platform specific files we need
icculus@2066
  2496
icculus@2066
  2497
if test x$enable_joystick = xyes; then
icculus@2066
  2498
  if test x$have_joystick != xyes; then
icculus@2066
  2499
    # Wants joystick subsystem, but doesn't have a platform-specific backend...
slouken@1361
  2500
    SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
icculus@2066
  2501
  fi
slouken@1361
  2502
fi
slouken@1361
  2503
if test x$have_cdrom != xyes; then
slouken@1361
  2504
    if test x$enable_cdrom = xyes; then
slouken@1361
  2505
        AC_DEFINE(SDL_CDROM_DISABLED)
slouken@1361
  2506
    fi
slouken@1361
  2507
    SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
slouken@1361
  2508
fi
slouken@1361
  2509
if test x$have_threads != xyes; then
slouken@1361
  2510
    if test x$enable_threads = xyes; then
slouken@1361
  2511
        AC_DEFINE(SDL_THREADS_DISABLED)
slouken@1361
  2512
    fi
slouken@1361
  2513
    SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
slouken@1361
  2514
fi
slouken@1361
  2515
if test x$have_timers != xyes; then
slouken@1361
  2516
    if test x$enable_timers = xyes; then
slouken@1361
  2517
        AC_DEFINE(SDL_TIMERS_DISABLED)
slouken@1361
  2518
    fi
slouken@1361
  2519
    SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
slouken@1361
  2520
fi
slouken@1361
  2521
if test x$have_loadso != xyes; then
slouken@1361
  2522
    if test x$enable_loadso = xyes; then
slouken@1361
  2523
        AC_DEFINE(SDL_LOADSO_DISABLED)
slouken@1361
  2524
    fi
slouken@1361
  2525
    SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
slouken@1361
  2526
fi
slouken@1397
  2527
if test x$SDLMAIN_SOURCES = x; then
slouken@1397
  2528
    SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
slouken@1397
  2529
fi
slouken@0
  2530
slouken@1361
  2531
OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
slouken@1361
  2532
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
slouken@1361
  2533
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
slouken@1361
  2534
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
slouken@1459
  2535
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'`
slouken@2204
  2536
OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'`
slouken@0
  2537
slouken@1397
  2538
SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.o,g'`
slouken@1397
  2539
SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
slouken@1397
  2540
slouken@0
  2541
# Set runtime shared library paths as needed
slouken@0
  2542
slouken@1127
  2543
if test "x$enable_rpath" = "xyes"; then
slouken@1565
  2544
  if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then
slouken@2040
  2545
    SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
slouken@1127
  2546
  fi
slouken@1127
  2547
  if test $ARCH = solaris; then
slouken@2040
  2548
    SDL_RLD_FLAGS="-R\${libdir}"
slouken@1127
  2549
  fi
slouken@1127
  2550
else
slouken@1127
  2551
  SDL_RLD_FLAGS=""
slouken@0
  2552
fi
slouken@387
  2553
slouken@387
  2554
case "$ARCH" in
slouken@387
  2555
  macosx)
slouken@807
  2556
    # Evil hack to allow static linking on Mac OS X
slouken@2040
  2557
    SDL_STATIC_LIBS="\${libdir}/libSDL.a $EXTRA_LDFLAGS"
slouken@807
  2558
    ;;
slouken@807
  2559
  *)
slouken@807
  2560
    SDL_STATIC_LIBS="$SDL_LIBS"
slouken@807
  2561
    ;;
slouken@807
  2562
esac
slouken@807
  2563
slouken@0
  2564
dnl Expand the cflags and libraries needed by apps using SDL
slouken@0
  2565
AC_SUBST(SDL_CFLAGS)
slouken@0
  2566
AC_SUBST(SDL_LIBS)
slouken@807
  2567
AC_SUBST(SDL_STATIC_LIBS)
slouken@0
  2568
AC_SUBST(SDL_RLD_FLAGS)
slouken@1361
  2569
if test x$enable_shared = xyes; then
slouken@1361
  2570
    ENABLE_SHARED_TRUE=
slouken@1361
  2571
    ENABLE_SHARED_FALSE="#"
slouken@1361
  2572
else
slouken@1361
  2573
    ENABLE_SHARED_TRUE="#"
slouken@1361
  2574
    ENABLE_SHARED_FALSE=
slouken@1361
  2575
fi
slouken@1361
  2576
if test x$enable_static = xyes; then
slouken@1361
  2577
    ENABLE_STATIC_TRUE=
slouken@1361
  2578
    ENABLE_STATIC_FALSE="#"
slouken@1361
  2579
else
slouken@1361
  2580
    ENABLE_STATIC_TRUE="#"
slouken@1361
  2581
    ENABLE_STATIC_FALSE=
slouken@1361
  2582
fi
slouken@1361
  2583
AC_SUBST(ENABLE_SHARED_TRUE)
slouken@1361
  2584
AC_SUBST(ENABLE_SHARED_FALSE)
slouken@1361
  2585
AC_SUBST(ENABLE_STATIC_TRUE)
slouken@1361
  2586
AC_SUBST(ENABLE_STATIC_FALSE)
slouken@0
  2587
slouken@1361
  2588
dnl Expand the sources and objects needed to build the library
slouken@1361
  2589
AC_SUBST(ac_aux_dir)
slouken@1361
  2590
AC_SUBST(INCLUDE)
slouken@1361
  2591
AC_SUBST(SOURCES)
slouken@1361
  2592
AC_SUBST(OBJECTS)
slouken@1397
  2593
AC_SUBST(SDLMAIN_SOURCES)
slouken@1397
  2594
AC_SUBST(SDLMAIN_OBJECTS)
slouken@1361
  2595
AC_SUBST(BUILD_CFLAGS)
slouken@1521
  2596
AC_SUBST(EXTRA_CFLAGS)
slouken@1393
  2597
AC_SUBST(BUILD_LDFLAGS)
slouken@1521
  2598
AC_SUBST(EXTRA_LDFLAGS)
slouken@2204
  2599
AC_SUBST(WINDRES)
slouken@0
  2600
slouken@0
  2601
AC_OUTPUT([
slouken@1865
  2602
    Makefile sdl-config SDL.spec SDL.qpg sdl.pc
slouken@1361
  2603
], [
slouken@1361
  2604
    : >build-deps
slouken@1640
  2605
    if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
slouken@1361
  2606
])