configure.in
author Sam Lantinga <slouken@libsdl.org>
Thu, 09 Feb 2006 09:38:05 +0000
changeset 1354 22f39393668a
parent 1353 7ba544e2888d
child 1361 19418e4422cb
permissions -rw-r--r--
Fixed build problem with SDL_string.c
Officially deprecated SDL_byteorder.h, SDL_getenv.h and SDL_types.h
Moved endian-related SDL_rwops code into SDL_rwops.c
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@0
    18
SDL_MINOR_VERSION=2
slouken@1222
    19
SDL_MICRO_VERSION=10
slouken@1222
    20
SDL_INTERFACE_AGE=3
slouken@1222
    21
SDL_BINARY_AGE=10
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@0
    42
dnl Detect the canonical host and target build environment
slouken@557
    43
AC_CANONICAL_SYSTEM
slouken@1354
    44
AC_C_BIGENDIAN
slouken@1354
    45
if test x$ac_cv_c_bigendian = xyes; then
slouken@1354
    46
    AC_DEFINE(SDL_BYTEORDER, 4321)
slouken@1354
    47
else
slouken@1354
    48
    AC_DEFINE(SDL_BYTEORDER, 1234)
slouken@1354
    49
fi
slouken@0
    50
slouken@51
    51
dnl Setup for automake
slouken@51
    52
AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
slouken@51
    53
slouken@1352
    54
dnl Disable autoheader
slouken@1352
    55
AUTOHEADER=:
slouken@1352
    56
slouken@0
    57
dnl Check for tools
slouken@0
    58
slouken@0
    59
AC_LIBTOOL_WIN32_DLL
slouken@0
    60
AM_PROG_LIBTOOL
slouken@0
    61
AC_PROG_MAKE_SET
slouken@0
    62
AC_PROG_CC
slouken@200
    63
AC_PROG_CXX
slouken@0
    64
AC_PROG_INSTALL
slouken@258
    65
ASFLAGS=""
slouken@258
    66
AC_SUBST(ASFLAGS)
slouken@436
    67
CCAS="$CC"
slouken@436
    68
AC_SUBST(CCAS)
slouken@436
    69
CCASFLAGS=""
slouken@436
    70
AC_SUBST(CCASFLAGS)
slouken@682
    71
AM_CONDITIONAL([am__fastdepOBJC], false)
slouken@0
    72
slouken@0
    73
dnl The alpha architecture needs special flags for binary portability
slouken@0
    74
case "$target" in
slouken@0
    75
    alpha*-*-linux*)
slouken@0
    76
        if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    77
            CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
slouken@0
    78
        fi
slouken@0
    79
        ;;
slouken@0
    80
esac
slouken@0
    81
slouken@0
    82
dnl Add compiler-specific optimization flags
slouken@0
    83
slouken@0
    84
dnl See if the user wants aggressive optimizations of the code
slouken@0
    85
AC_ARG_ENABLE(debug,
slouken@0
    86
[  --enable-debug          Disable aggressive optimizations [default=yes]],
slouken@0
    87
              , enable_debug=yes)
slouken@0
    88
if test x$enable_debug != xyes; then
slouken@0
    89
    if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    90
        CFLAGS="$CFLAGS -fexpensive-optimizations"
slouken@0
    91
        # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
slouken@0
    92
        # CFLAGS="$CFLAGS -fomit-frame-pointer"
slouken@0
    93
    fi
slouken@0
    94
    case "$target" in
slouken@0
    95
        i486-*-*)
slouken@0
    96
            if test x$ac_cv_prog_gcc = xyes; then
slouken@802
    97
                CFLAGS="$CFLAGS -march=i486"
slouken@0
    98
            fi
slouken@0
    99
            ;;
slouken@0
   100
        i?86-*-*)
slouken@0
   101
            if test x$ac_cv_prog_gcc = xyes; then
slouken@0
   102
                CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
slouken@0
   103
            fi
slouken@0
   104
            ;;
slouken@0
   105
        *-*-osf*)
slouken@0
   106
            if test x$ac_cv_prog_gcc != xyes; then
slouken@0
   107
                CFLAGS="-g3 -fast -arch host"
slouken@0
   108
            fi
slouken@0
   109
            ;;
slouken@0
   110
    esac
slouken@0
   111
fi
slouken@0
   112
slouken@0
   113
dnl Add verbose warnings by default, and allow ANSI compliance checking
slouken@0
   114
AC_ARG_ENABLE(strict-ansi,
slouken@0
   115
[  --enable-strict-ansi    Enable strict ANSI compliance build [default=no]],
slouken@0
   116
              , enable_strict_ansi=no)
slouken@0
   117
if test x$ac_cv_prog_gcc = xyes; then
slouken@0
   118
    CFLAGS="$CFLAGS -Wall"
slouken@0
   119
    if test x$enable_strict_ansi = xyes; then
slouken@0
   120
        CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
slouken@0
   121
    fi
slouken@0
   122
fi
slouken@0
   123
slouken@1341
   124
dnl See whether we are allowed to use the system C library
slouken@1341
   125
AC_ARG_ENABLE(libc,
slouken@1341
   126
[  --enable-libc           Use the system C library [default=yes]],
slouken@1354
   127
              , AC_DEFINE(HAVE_LIBC))
slouken@1341
   128
slouken@1353
   129
dnl Check for compiler characteristics
slouken@1341
   130
AC_C_CONST
slouken@1341
   131
AC_C_INLINE
slouken@1353
   132
AC_C_VOLATILE
slouken@1353
   133
slouken@1353
   134
dnl Check for header files
slouken@1353
   135
AC_HEADER_STDC
slouken@1353
   136
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 signal.h)
slouken@1353
   137
slouken@1353
   138
dnl Check for typedefs, structures, etc.
slouken@1341
   139
AC_TYPE_SIZE_T
slouken@1353
   140
if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
slouken@1353
   141
    AC_CHECK_TYPE(int64_t)
slouken@1353
   142
    if test x$ac_cv_type_int64_t = xyes; then
slouken@1353
   143
        AC_DEFINE(SDL_HAS_64BIT_TYPE)
slouken@1353
   144
    fi
slouken@1353
   145
else
slouken@1353
   146
    AC_CHECK_SIZEOF(char, 1)
slouken@1353
   147
    AC_CHECK_SIZEOF(short, 2)
slouken@1353
   148
    AC_CHECK_SIZEOF(int, 4)
slouken@1353
   149
    AC_CHECK_SIZEOF(long, 4)
slouken@1353
   150
    AC_CHECK_SIZEOF(long long, 8)
slouken@1353
   151
    if test x$ac_cv_sizeof_char = x1; then
slouken@1353
   152
        AC_DEFINE(int8_t, signed char)
slouken@1353
   153
        AC_DEFINE(uint8_t, unsigned char)
slouken@1353
   154
    fi
slouken@1353
   155
    if test x$ac_cv_sizeof_short = x2; then
slouken@1353
   156
        AC_DEFINE(int16_t, signed short)
slouken@1353
   157
        AC_DEFINE(uint16_t, unsigned short)
slouken@1353
   158
    else
slouken@1353
   159
        if test x$ac_cv_sizeof_int = x2; then
slouken@1353
   160
            AC_DEFINE(int16_t, signed int)
slouken@1353
   161
            AC_DEFINE(uint16_t, unsigned int)
slouken@1353
   162
        fi
slouken@1353
   163
    fi
slouken@1353
   164
    if test x$ac_cv_sizeof_int = x4; then
slouken@1353
   165
        AC_DEFINE(int32_t, signed int)
slouken@1353
   166
        AC_DEFINE(uint32_t, unsigned int)
slouken@1353
   167
    else
slouken@1353
   168
        if test x$ac_cv_sizeof_long = x4; then
slouken@1353
   169
            AC_DEFINE(int32_t, signed long)
slouken@1353
   170
            AC_DEFINE(uint32_t, unsigned long)
slouken@1353
   171
        fi
slouken@1353
   172
    fi
slouken@1353
   173
    if test x$ac_cv_sizeof_long = x8; then
slouken@1353
   174
        AC_DEFINE(int64_t, signed long)
slouken@1353
   175
        AC_DEFINE(uint64_t, unsigned long)
slouken@1353
   176
        AC_DEFINE(SDL_HAS_64BIT_TYPE)
slouken@1353
   177
    else
slouken@1353
   178
        if test x$ac_cv_sizeof_long_long = x8; then
slouken@1353
   179
            AC_DEFINE(int64_t, signed long long)
slouken@1353
   180
            AC_DEFINE(uint64_t, unsigned long long)
slouken@1353
   181
            AC_DEFINE(SDL_HAS_64BIT_TYPE)
slouken@1353
   182
        fi
slouken@1353
   183
    fi
slouken@1353
   184
    AC_CHECK_TYPE(uintptr_t, unsigned long)
slouken@1353
   185
fi
slouken@1341
   186
slouken@1341
   187
dnl Checks for library functions.
slouken@1341
   188
AC_FUNC_ALLOCA
slouken@1353
   189
AC_FUNC_MEMCMP
slouken@1353
   190
if test x$ac_cv_func_memcmp_working = xyes; then
slouken@1353
   191
    AC_DEFINE(HAVE_MEMCMP)
slouken@1353
   192
fi
slouken@1353
   193
AC_FUNC_STRTOD
slouken@1353
   194
if test x$ac_cv_func_strtod = xyes; then
slouken@1353
   195
    AC_DEFINE(HAVE_STRTOD)
slouken@1353
   196
fi
slouken@1353
   197
AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strcpy strncpy strcat strncat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol _i64toa _ui64toa strtoll atoi atof strcmp strncmp stricmp strcasecmp sscanf snprintf vsnprint)
slouken@1353
   198
slouken@1341
   199
slouken@0
   200
dnl Initialize the compiler and linker flags for SDL applications
slouken@0
   201
slouken@0
   202
SDL_CFLAGS=""
slouken@0
   203
SDL_LIBS="-lSDL"
slouken@0
   204
slouken@0
   205
dnl Add the math library for the new gamma correction support
slouken@0
   206
slouken@0
   207
case "$target" in
slouken@0
   208
    *-*-cygwin* | *-*-mingw32*)
slouken@0
   209
        MATHLIB=""
slouken@0
   210
        ;;
slouken@0
   211
    *-*-beos*)
slouken@0
   212
        MATHLIB=""
slouken@0
   213
        ;;
slouken@0
   214
    *-*-darwin*)
slouken@0
   215
        MATHLIB=""
slouken@0
   216
        ;;
slouken@0
   217
    *)
slouken@0
   218
        MATHLIB="-lm"
slouken@0
   219
        ;;
slouken@0
   220
esac
slouken@0
   221
SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"
slouken@0
   222
slouken@0
   223
dnl Enable/disable various subsystems of the SDL library
slouken@0
   224
slouken@0
   225
AC_ARG_ENABLE(audio,
slouken@0
   226
[  --enable-audio          Enable the audio subsystem [default=yes]],
slouken@0
   227
              , enable_audio=yes)
slouken@0
   228
if test x$enable_audio = xyes; then
slouken@0
   229
    SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
slouken@0
   230
    SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
slouken@0
   231
else
slouken@0
   232
    CFLAGS="$CFLAGS -DDISABLE_AUDIO"
slouken@0
   233
fi
slouken@0
   234
AC_ARG_ENABLE(video,
slouken@0
   235
[  --enable-video          Enable the video subsystem [default=yes]],
slouken@0
   236
              , enable_video=yes)
slouken@0
   237
if test x$enable_video = xyes; then
slouken@0
   238
    SDL_EXTRADIRS="$SDL_EXTRADIRS video"
slouken@0
   239
    SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
slouken@0
   240
else
slouken@0
   241
    CFLAGS="$CFLAGS -DDISABLE_VIDEO"
slouken@0
   242
fi
slouken@0
   243
AC_ARG_ENABLE(events,
slouken@0
   244
[  --enable-events         Enable the events subsystem [default=yes]],
slouken@0
   245
              , enable_events=yes)
slouken@0
   246
if test x$enable_video = xyes -a x$enable_events = xyes; then
slouken@0
   247
    SDL_EXTRADIRS="$SDL_EXTRADIRS events"
slouken@0
   248
    SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
slouken@0
   249
else
slouken@0
   250
    CFLAGS="$CFLAGS -DDISABLE_EVENTS"
slouken@0
   251
fi
slouken@0
   252
AC_ARG_ENABLE(joystick,
slouken@0
   253
[  --enable-joystick       Enable the joystick subsystem [default=yes]],
slouken@0
   254
              , enable_joystick=yes)
slouken@0
   255
if test x$enable_joystick = xyes; then
slouken@0
   256
    SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
slouken@0
   257
    SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
slouken@0
   258
else
slouken@0
   259
    CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
slouken@0
   260
fi
slouken@0
   261
AC_ARG_ENABLE(cdrom,
slouken@0
   262
[  --enable-cdrom          Enable the cdrom subsystem [default=yes]],
slouken@0
   263
              , enable_cdrom=yes)
slouken@0
   264
if test x$enable_cdrom = xyes; then
slouken@0
   265
    SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
slouken@0
   266
    SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
slouken@0
   267
else
slouken@0
   268
    CFLAGS="$CFLAGS -DDISABLE_CDROM"
slouken@0
   269
fi
slouken@0
   270
AC_ARG_ENABLE(threads,
slouken@0
   271
[  --enable-threads        Enable the threading subsystem [default=yes]],
slouken@0
   272
              , enable_threads=yes)
slouken@0
   273
SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
slouken@0
   274
SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
slouken@0
   275
if test x$enable_threads != xyes; then
slouken@0
   276
    CFLAGS="$CFLAGS -DDISABLE_THREADS"
slouken@0
   277
    COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
slouken@0
   278
    COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
slouken@0
   279
    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
   280
    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
   281
    COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
   282
    COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
   283
    COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
   284
    COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
   285
fi
slouken@0
   286
AC_ARG_ENABLE(timers,
slouken@0
   287
[  --enable-timers         Enable the timer subsystem [default=yes]],
slouken@0
   288
              , enable_timers=yes)
slouken@0
   289
if test x$enable_timers = xyes; then
slouken@0
   290
    SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
slouken@0
   291
    SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
slouken@0
   292
else
slouken@0
   293
    CFLAGS="$CFLAGS -DDISABLE_TIMERS"
slouken@0
   294
fi
slouken@0
   295
AC_ARG_ENABLE(file,
slouken@0
   296
[  --enable-file           Enable the file subsystem [default=yes]],
slouken@0
   297
              , enable_file=yes)
slouken@0
   298
if test x$enable_file = xyes; then
slouken@0
   299
    SDL_EXTRADIRS="$SDL_EXTRADIRS file"
slouken@0
   300
    SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
slouken@0
   301
else
slouken@0
   302
    CFLAGS="$CFLAGS -DDISABLE_FILE"
slouken@0
   303
fi
slouken@740
   304
AC_ARG_ENABLE(cpuinfo,
slouken@740
   305
[  --enable-cpuinfo        Enable the cpuinfo subsystem [default=yes]],
slouken@740
   306
              , enable_cpuinfo=yes)
slouken@740
   307
if test x$enable_cpuinfo = xyes; then
slouken@740
   308
    SDL_EXTRADIRS="$SDL_EXTRADIRS cpuinfo"
slouken@740
   309
    SDL_EXTRALIBS="$SDL_EXTRALIBS cpuinfo/libcpuinfo.la"
slouken@740
   310
else
slouken@740
   311
    CFLAGS="$CFLAGS -DDISABLE_CPUINFO"
slouken@740
   312
fi
slouken@0
   313
slouken@0
   314
dnl See if the OSS audio interface is supported
slouken@0
   315
CheckOSS()
slouken@0
   316
{
slouken@0
   317
    AC_ARG_ENABLE(oss,
slouken@0
   318
[  --enable-oss            support the OSS audio API [default=yes]],
slouken@0
   319
                  , enable_oss=yes)
slouken@0
   320
    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
slouken@0
   321
        AC_MSG_CHECKING(for OSS audio support)
slouken@0
   322
        have_oss=no
slouken@94
   323
        if test x$have_oss != xyes; then
slouken@94
   324
            AC_TRY_COMPILE([
slouken@94
   325
              #include <sys/soundcard.h>
slouken@94
   326
            ],[
slouken@94
   327
              int arg = SNDCTL_DSP_SETFRAGMENT;
slouken@94
   328
            ],[
slouken@94
   329
            have_oss=yes
slouken@94
   330
            ])
slouken@94
   331
        fi
slouken@94
   332
        if test x$have_oss != xyes; then
slouken@94
   333
            AC_TRY_COMPILE([
slouken@94
   334
              #include <soundcard.h>
slouken@94
   335
            ],[
slouken@94
   336
              int arg = SNDCTL_DSP_SETFRAGMENT;
slouken@94
   337
            ],[
slouken@94
   338
            have_oss=yes
slouken@94
   339
            CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H"
slouken@94
   340
            ])
slouken@94
   341
        fi
slouken@0
   342
        AC_MSG_RESULT($have_oss)
slouken@0
   343
        if test x$have_oss = xyes; then
slouken@0
   344
            CFLAGS="$CFLAGS -DOSS_SUPPORT"
slouken@0
   345
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
slouken@0
   346
            AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
slouken@0
   347
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
slouken@0
   348
            AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
slouken@0
   349
        fi
slouken@0
   350
    fi
slouken@0
   351
}
slouken@0
   352
slouken@0
   353
dnl See if the ALSA audio interface is supported
slouken@0
   354
CheckALSA()
slouken@0
   355
{
slouken@0
   356
    AC_ARG_ENABLE(alsa,
slouken@0
   357
[  --enable-alsa           support the ALSA audio API [default=yes]],
slouken@0
   358
                  , enable_alsa=yes)
slouken@0
   359
    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
slouken@948
   360
        AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
slouken@1009
   361
        # Restore all flags from before the ALSA detection runs
slouken@1009
   362
        CFLAGS="$alsa_save_CFLAGS"
slouken@1009
   363
        LDFLAGS="$alsa_save_LDFLAGS"
slouken@1009
   364
        LIBS="$alsa_save_LIBS"
slouken@354
   365
        if test x$have_alsa = xyes; then
slouken@865
   366
            AC_ARG_ENABLE(alsa-shared,
slouken@865
   367
[  --enable-alsa-shared     dynamically load ALSA audio support [default=yes]],
slouken@865
   368
                          , enable_alsa_shared=yes)
slouken@939
   369
            if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
slouken@973
   370
                if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
slouken@973
   371
                    ALSA_LIBS="-L/lib $ALSA_LIBS"
slouken@973
   372
                elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
slouken@939
   373
                    ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
slouken@973
   374
                elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
slouken@939
   375
                    ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
slouken@973
   376
                fi
slouken@939
   377
            fi
slouken@939
   378
            alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
slouken@939
   379
            alsa_lib=`ls $alsa_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
slouken@939
   380
            echo "-- $alsa_lib_spec -> $alsa_lib"
slouken@939
   381
icculus@1173
   382
            if test x$have_loadso != xyes && \
slouken@865
   383
               test x$enable_alsa_shared = xyes; then
icculus@1173
   384
                AC_MSG_ERROR([You must have SDL_LoadObject() support])
slouken@865
   385
            fi
icculus@1173
   386
            if test x$have_loadso = xyes && \
slouken@865
   387
               test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
slouken@939
   388
                CFLAGS="$CFLAGS -DALSA_SUPPORT -DALSA_DYNAMIC=\$(alsa_lib) $ALSA_CFLAGS"
slouken@865
   389
                AC_SUBST(alsa_lib)
slouken@939
   390
slouken@939
   391
                use_dlvsym=no
icculus@1136
   392
                AC_CHECK_LIB(dl, dlvsym, [use_dlvsym=yes])
slouken@939
   393
                if test x$use_dlvsym = xyes; then
slouken@939
   394
                    CFLAGS="$CFLAGS -DUSE_DLVSYM"
slouken@939
   395
                fi
slouken@865
   396
            else
slouken@939
   397
                CFLAGS="$CFLAGS -DALSA_SUPPORT $ALSA_CFLAGS"
slouken@939
   398
                SYSTEM_LIBS="$SYSTEM_LIBS $ALSA_LIBS"
slouken@865
   399
            fi
slouken@0
   400
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
slouken@0
   401
            AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
slouken@0
   402
        fi
slouken@0
   403
    fi
slouken@0
   404
}
slouken@0
   405
slouken@148
   406
dnl Check whether we want to use IRIX 6.5+ native audio or not
slouken@148
   407
CheckDMEDIA()
slouken@148
   408
{
slouken@148
   409
    if test x$enable_audio = xyes; then
slouken@148
   410
        AC_MSG_CHECKING(for dmedia audio support)
slouken@148
   411
        have_dmedia=no
slouken@148
   412
        AC_TRY_COMPILE([
slouken@148
   413
          #include <dmedia/audio.h>
slouken@148
   414
        ],[
slouken@148
   415
          ALport audio_port;
slouken@148
   416
        ],[
slouken@148
   417
        have_dmedia=yes
slouken@148
   418
        ])
slouken@935
   419
        AC_MSG_RESULT($have_dmedia)
slouken@148
   420
        # Set up files for the audio library
slouken@148
   421
        if test x$have_dmedia = xyes; then
slouken@148
   422
            CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
slouken@148
   423
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
slouken@148
   424
            AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
slouken@148
   425
            SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
slouken@148
   426
        fi
slouken@148
   427
    fi
slouken@148
   428
}
slouken@148
   429
slouken@0
   430
dnl Find the ESD includes and libraries
slouken@0
   431
CheckESD()
slouken@0
   432
{
slouken@0
   433
    AC_ARG_ENABLE(esd,
slouken@0
   434
[  --enable-esd            support the Enlightened Sound Daemon [default=yes]],
slouken@0
   435
                  , enable_esd=yes)
slouken@0
   436
    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
slouken@948
   437
        AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
slouken@948
   438
        if test x$have_esd = xyes; then
slouken@294
   439
            AC_ARG_ENABLE(esd-shared,
slouken@678
   440
[  --enable-esd-shared     dynamically load ESD audio support [default=yes]],
slouken@678
   441
                          , enable_esd_shared=yes)
slouken@294
   442
            esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
slouken@868
   443
            esd_lib=`ls $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
slouken@371
   444
            echo "-- $esd_lib_spec -> $esd_lib"
icculus@1173
   445
            if test x$have_loadso != xyes && \
slouken@296
   446
               test x$enable_esd_shared = xyes; then
icculus@1173
   447
                AC_MSG_ERROR([You must have SDL_LoadObject() support])
slouken@296
   448
            fi
icculus@1173
   449
            if test x$have_loadso = xyes && \
slouken@294
   450
               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
slouken@294
   451
                CFLAGS="$CFLAGS -DESD_SUPPORT -DESD_DYNAMIC=\$(esd_lib) $ESD_CFLAGS"
slouken@371
   452
                AC_SUBST(esd_lib)
slouken@294
   453
            else
slouken@294
   454
                CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
slouken@294
   455
                SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
slouken@294
   456
            fi
slouken@0
   457
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
slouken@0
   458
            AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
slouken@294
   459
        fi
slouken@0
   460
    fi
slouken@0
   461
}
slouken@0
   462
slouken@0
   463
CheckARTSC()
slouken@0
   464
{
slouken@0
   465
    AC_ARG_ENABLE(arts,
slouken@0
   466
[  --enable-arts           support the Analog Real Time Synthesizer [default=yes]],
slouken@0
   467
                  , enable_arts=yes)
slouken@0
   468
    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
slouken@0
   469
        AC_PATH_PROG(ARTSCCONFIG, artsc-config)
slouken@0
   470
        if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
slouken@0
   471
            : # arts isn't installed
slouken@0
   472
        else
slouken@0
   473
            ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
slouken@0
   474
            ARTSC_LIBS=`$ARTSCCONFIG --libs`
slouken@856
   475
            ARTSC_PREFIX=`$ARTSCCONFIG --arts-prefix`
slouken@0
   476
            AC_MSG_CHECKING(for aRts development environment)
slouken@0
   477
            audio_arts=no
slouken@0
   478
            save_CFLAGS="$CFLAGS"
slouken@0
   479
            CFLAGS="$CFLAGS $ARTSC_CFLAGS"
slouken@0
   480
            AC_TRY_COMPILE([
slouken@0
   481
             #include <artsc.h>
slouken@0
   482
            ],[
slouken@0
   483
             arts_stream_t stream;
slouken@0
   484
            ],[
slouken@0
   485
            audio_arts=yes
slouken@0
   486
            ])
slouken@0
   487
            CFLAGS="$save_CFLAGS"
slouken@0
   488
            AC_MSG_RESULT($audio_arts)
slouken@0
   489
            if test x$audio_arts = xyes; then
slouken@294
   490
                AC_ARG_ENABLE(arts-shared,
slouken@678
   491
[  --enable-arts-shared    dynamically load aRts audio support [default=yes]],
slouken@678
   492
                              , enable_arts_shared=yes)
slouken@856
   493
                arts_lib_spec="$ARTSC_PREFIX/lib/libartsc.so.*"
slouken@868
   494
                arts_lib=`ls $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
slouken@371
   495
                echo "-- $arts_lib_spec -> $arts_lib"
icculus@1173
   496
                if test x$have_loadso != xyes && \
slouken@296
   497
                   test x$enable_arts_shared = xyes; then
icculus@1173
   498
                    AC_MSG_ERROR([You must have SDL_LoadObject() support])
slouken@296
   499
                fi
icculus@1173
   500
                if test x$have_loadso = xyes && \
slouken@294
   501
                   test x$enable_arts_shared = xyes && test x$arts_lib != x; then
slouken@294
   502
                    CFLAGS="$CFLAGS -DARTSC_SUPPORT -DARTSC_DYNAMIC=\$(arts_lib) $ARTSC_CFLAGS"
slouken@371
   503
                    AC_SUBST(arts_lib)
slouken@294
   504
                else
slouken@294
   505
                    CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
slouken@294
   506
                    SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
slouken@294
   507
                fi
slouken@0
   508
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
slouken@0
   509
                AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
slouken@0
   510
            fi
slouken@0
   511
        fi
slouken@0
   512
    fi
slouken@0
   513
}
slouken@0
   514
slouken@0
   515
dnl See if the NAS audio interface is supported
slouken@0
   516
CheckNAS()
slouken@0
   517
{
slouken@0
   518
    AC_ARG_ENABLE(nas,
patmandin@651
   519
[  --enable-nas            support the NAS audio API [default=yes]],
slouken@41
   520
                  , enable_nas=yes)
slouken@0
   521
    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
slouken@41
   522
        AC_MSG_CHECKING(for NAS audio support)
slouken@41
   523
        have_nas=no
slouken@41
   524
        if test -r /usr/X11R6/include/audio/audiolib.h; then
slouken@41
   525
            have_nas=yes
slouken@720
   526
            CFLAGS="$CFLAGS -DNAS_SUPPORT -I/usr/X11R6/include/"
slouken@41
   527
            SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
slouken@41
   528
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
slouken@41
   529
            AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
slouken@605
   530
slouken@605
   531
        dnl On IRIX, the NAS includes are in a different directory,
slouken@605
   532
        dnl and libnas must be explicitly linked in
slouken@605
   533
slouken@605
   534
        elif test -r /usr/freeware/include/nas/audiolib.h; then
slouken@605
   535
            have_nas=yes
slouken@605
   536
            CFLAGS="$CFLAGS -DNAS_SUPPORT"
slouken@605
   537
            SYSTEM_LIBS="$SYSTEM_LIBS -lnas -lXt"
slouken@605
   538
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
slouken@605
   539
            AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
slouken@41
   540
        fi
slouken@605
   541
        AC_MSG_RESULT($have_nas)
slouken@0
   542
    fi
slouken@0
   543
}
slouken@0
   544
slouken@68
   545
dnl rcg07142001 See if the user wants the disk writer audio driver...
slouken@68
   546
CheckDiskAudio()
slouken@68
   547
{
slouken@68
   548
    AC_ARG_ENABLE(diskaudio,
patmandin@651
   549
[  --enable-diskaudio      support the disk writer audio driver [default=yes]],
slouken@86
   550
                  , enable_diskaudio=yes)
slouken@68
   551
    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
slouken@68
   552
        CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
slouken@68
   553
        AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
slouken@68
   554
        AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
slouken@68
   555
    fi
slouken@68
   556
}
slouken@68
   557
slouken@398
   558
dnl Set up the Atari Audio driver
slouken@398
   559
CheckAtariAudio()
slouken@398
   560
{
slouken@398
   561
    AC_ARG_ENABLE(mintaudio,
slouken@398
   562
[  --enable-mintaudio      support Atari audio driver [default=yes]],
slouken@398
   563
                  , enable_mintaudio=yes)
slouken@398
   564
    if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
slouken@398
   565
        mintaudio=no
slouken@398
   566
        AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
slouken@398
   567
        if test x$have_mint_falcon_hdr = xyes; then
slouken@398
   568
            mintaudio=yes
slouken@398
   569
            CFLAGS="$CFLAGS -DMINTAUDIO_SUPPORT"
slouken@398
   570
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS mint"
slouken@398
   571
            AUDIO_DRIVERS="$AUDIO_DRIVERS mint/libaudio_mintaudio.la"
slouken@398
   572
        fi
slouken@398
   573
    fi
slouken@398
   574
}
slouken@398
   575
slouken@0
   576
dnl See if we can use x86 assembly blitters
slouken@212
   577
# NASM is available from: http://nasm.octium.net/
slouken@0
   578
CheckNASM()
slouken@0
   579
{
slouken@0
   580
    dnl Make sure we are running on an x86 platform
slouken@0
   581
    case $target in
slouken@0
   582
        i?86*)
slouken@0
   583
            ;;
slouken@0
   584
        *)
slouken@0
   585
        # Nope, bail early.
slouken@0
   586
            return
slouken@0
   587
            ;;
slouken@0
   588
    esac
slouken@0
   589
    dnl Check for NASM (for assembly blit routines)
slouken@0
   590
    AC_ARG_ENABLE(nasm,
slouken@0
   591
[  --enable-nasm           use nasm assembly blitters on x86 [default=yes]],
slouken@0
   592
                  , enable_nasm=yes)
slouken@0
   593
    if test x$enable_video = xyes -a x$enable_nasm = xyes; then
slouken@0
   594
        AC_PATH_PROG(NASM, nasm)
slouken@0
   595
        if test x$NASM = x -o x$NASM = x'"$NASM"'; then
slouken@0
   596
            : # nasm isn't installed
slouken@0
   597
        else
slouken@0
   598
            CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
slouken@0
   599
            case $ARCH in
slouken@0
   600
              win32)
slouken@0
   601
                  NASMFLAGS="-f win32"
slouken@0
   602
                  ;;
slouken@360
   603
              openbsd)
slouken@360
   604
                  NASMFLAGS="-f aoutb"
slouken@360
   605
                  ;;
slouken@0
   606
              *)
slouken@754
   607
                  NASMFLAGS="-f elf"
slouken@0
   608
                  ;;
slouken@0
   609
            esac
slouken@0
   610
            AC_SUBST(NASMFLAGS)
slouken@0
   611
            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
slouken@0
   612
            SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
slouken@0
   613
            SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
slouken@739
   614
            use_nasm=yes
slouken@886
   615
            
slouken@886
   616
            case "$target" in
slouken@886
   617
                # this line is needed for QNX, because it's not defined the __ELF__
slouken@886
   618
                *-*-qnx*) CFLAGS="$CFLAGS -D__ELF__"
slouken@886
   619
                          ;;
slouken@886
   620
slouken@886
   621
            esac
slouken@886
   622
slouken@0
   623
        fi
slouken@0
   624
    fi
slouken@0
   625
}
slouken@0
   626
icculus@1140
   627
dnl Do the iPod thing
icculus@1140
   628
CheckIPod()
icculus@1140
   629
{
icculus@1140
   630
    AC_ARG_ENABLE(ipod,
icculus@1140
   631
[  --enable-ipod          configure SDL to work with iPodLinux [default=yes on arm-elf]],
icculus@1140
   632
	, enable_ipod=yes)
icculus@1140
   633
icculus@1140
   634
    if test x$enable_ipod = xyes; then
icculus@1140
   635
	CFLAGS="$CFLAGS -DENABLE_IPOD -DIPOD"
icculus@1140
   636
	VIDEO_SUBDIRS="$VIDEO_SUBDIRS ipod"
icculus@1140
   637
	VIDEO_DRIVERS="$VIDEO_DRIVERS ipod/libvideo_ipod.la"
icculus@1140
   638
    fi
icculus@1140
   639
}	
icculus@1140
   640
slouken@30
   641
dnl Find the nanox include and library directories
slouken@30
   642
CheckNANOX()
slouken@30
   643
{
slouken@292
   644
    AC_ARG_ENABLE(video-nanox,
slouken@292
   645
        [  --enable-video-nanox use nanox video driver [default=no]],
slouken@292
   646
        , enable_video_nanox=no)
slouken@292
   647
    AC_ARG_ENABLE(nanox-debug,  
slouken@292
   648
        [  --enable-nanox-debug print debug messages [default=no]],
slouken@292
   649
        , enable_nanox_debug=no)
slouken@292
   650
    AC_ARG_ENABLE(nanox-share-memory,  
slouken@292
   651
        [  --enable-nanox-share-memory use share memory [default=no]],
slouken@292
   652
        , enable_nanox_share_memory=no)
slouken@471
   653
    AC_ARG_ENABLE(nanox_direct_fb, 
slouken@471
   654
        [  --enable-nanox-direct-fb use direct framebuffer access [default=no]],
slouken@471
   655
        , enable_nanox_direct_fb=no)
slouken@30
   656
slouken@292
   657
    if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
slouken@292
   658
        if test x$enable_nanox_debug = xyes; then
slouken@292
   659
            CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
slouken@292
   660
        fi
slouken@30
   661
slouken@292
   662
        if test x$enable_nanox_share_memory = xyes; then
slouken@292
   663
            CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
slouken@292
   664
        fi
slouken@30
   665
slouken@471
   666
        if test x$enable_nanox_direct_fb = xyes; then
slouken@471
   667
            CFLAGS="$CFLAGS -DENABLE_NANOX_DIRECT_FB"
slouken@471
   668
        fi
slouken@30
   669
slouken@292
   670
        CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
slouken@292
   671
        SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
slouken@292
   672
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
slouken@292
   673
        VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
slouken@292
   674
    fi
slouken@30
   675
}
slouken@30
   676
slouken@0
   677
dnl Find the X11 include and library directories
slouken@0
   678
CheckX11()
slouken@0
   679
{
slouken@0
   680
    AC_ARG_ENABLE(video-x11,
slouken@0
   681
[  --enable-video-x11      use X11 video driver [default=yes]],
slouken@0
   682
                  , enable_video_x11=yes)
slouken@0
   683
    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
slouken@0
   684
        AC_PATH_X
slouken@0
   685
        AC_PATH_XTRA
slouken@0
   686
        if test x$have_x = xyes; then
icculus@1168
   687
            AC_ARG_ENABLE(x11-shared,
icculus@1168
   688
[  --enable-x11-shared     dynamically load X11 support [default=yes]],
icculus@1168
   689
                          , enable_x11_shared=yes)
icculus@1168
   690
icculus@1170
   691
            dnl !!! FIXME: if a platform needs more than this, fill it in!
icculus@1174
   692
            case "$target" in
icculus@1174
   693
                *-*-darwin* )
icculus@1174
   694
                    x11_lib='/usr/X11R6/lib/libX11.6.dylib'
icculus@1174
   695
                    x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
icculus@1174
   696
                    ;;
icculus@1299
   697
                *-*-osf* )
icculus@1299
   698
                    x11_lib='libX11.so'
icculus@1299
   699
                    x11ext_lib='libXext.so'
icculus@1299
   700
                    ;;
icculus@1174
   701
                *)
icculus@1174
   702
                    x11_lib='libX11.so.6'
icculus@1174
   703
                    x11ext_lib='libXext.so.6'
icculus@1174
   704
                    ;;
icculus@1174
   705
            esac
icculus@1168
   706
icculus@1173
   707
            if test x$have_loadso != xyes && \
icculus@1168
   708
               test x$enable_x11_shared = xyes; then
icculus@1173
   709
                AC_MSG_ERROR([You must have SDL_LoadObject() support])
icculus@1168
   710
            fi
icculus@1168
   711
icculus@1173
   712
            if test x$have_loadso = xyes && \
icculus@1170
   713
               test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
icculus@1168
   714
                CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -DX11_DYNAMIC=\$(x11_lib) -DX11EXT_DYNAMIC=\$(x11ext_lib) -I$srcdir/include -I$srcdir/src/video"
icculus@1168
   715
                SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS"
icculus@1174
   716
                echo "-- dynamic libX11 -> $x11_lib"
icculus@1174
   717
                echo "-- dynamic libX11ext -> $x11ext_lib"
icculus@1168
   718
                AC_SUBST(x11_lib)
icculus@1168
   719
                AC_SUBST(x11ext_lib)
icculus@1168
   720
            else
icculus@1168
   721
                CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
icculus@1168
   722
                SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
icculus@1168
   723
            fi
icculus@1168
   724
slouken@0
   725
            if test x$ac_cv_func_shmat != xyes; then
slouken@0
   726
                CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
slouken@0
   727
            fi
icculus@1168
   728
slouken@0
   729
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
slouken@0
   730
            VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
slouken@0
   731
slouken@1307
   732
            AC_ARG_ENABLE(dga,
slouken@1307
   733
[  --enable-dga            allow use of X11 DGA code [default=yes]],
slouken@1307
   734
                          , enable_dga=yes)
slouken@1307
   735
            if test x$enable_dga = xyes; then
slouken@1307
   736
                VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xxf86dga"
slouken@1311
   737
                VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xxf86dga/libXext_Xxf86dga.la"
slouken@1307
   738
            fi
slouken@1307
   739
            AC_ARG_ENABLE(video-dga,
slouken@1307
   740
[  --enable-video-dga      use DGA 2.0 video driver [default=yes]],
slouken@1307
   741
                  , enable_video_dga=yes)
slouken@1307
   742
            if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then
slouken@1307
   743
                CFLAGS="$CFLAGS -DENABLE_DGA"
slouken@1307
   744
                VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
slouken@1307
   745
                VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
slouken@1307
   746
            fi
slouken@1307
   747
            AC_ARG_ENABLE(video-x11-dgamouse,
slouken@1307
   748
[  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]],
slouken@1307
   749
                          , enable_video_x11_dgamouse=yes)
slouken@1307
   750
            if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then
slouken@1307
   751
                CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE -DDEFAULT_DGAMOUSE"
slouken@1307
   752
            fi
slouken@0
   753
            AC_ARG_ENABLE(video-x11-vm,
slouken@0
   754
[  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]],
slouken@0
   755
                          , enable_video_x11_vm=yes)
slouken@0
   756
            if test x$enable_video_x11_vm = xyes; then
slouken@1307
   757
                CFLAGS="$CFLAGS -DXFREE86_VM -DXFREE86_VMGAMMA"
slouken@1307
   758
                VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xxf86vm"
slouken@1311
   759
                VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xxf86vm/libXext_Xxf86vm.la"
slouken@0
   760
            fi
slouken@0
   761
            AC_ARG_ENABLE(video-x11-xv,
slouken@0
   762
[  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]],
slouken@0
   763
                          , enable_video_x11_xv=yes)
slouken@0
   764
            if test x$enable_video_x11_xv = xyes; then
slouken@1307
   765
                CFLAGS="$CFLAGS -DXFREE86_XV"
slouken@1307
   766
                VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xv"
slouken@1311
   767
                VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xv/libXext_Xv.la"
slouken@0
   768
            fi
slouken@227
   769
            AC_ARG_ENABLE(video-x11-xinerama,
slouken@227
   770
[  --enable-video-x11-xinerama   enable X11 Xinerama support [default=yes]],
slouken@227
   771
                            , enable_video_x11_xinerama=yes)
slouken@227
   772
            if test x$enable_video_x11_xinerama = xyes; then
slouken@1307
   773
                CFLAGS="$CFLAGS -DHAVE_XINERAMA"
slouken@1307
   774
                VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/Xinerama"
slouken@1311
   775
                VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/Xinerama/libXext_Xinerama.la"
slouken@227
   776
            fi
slouken@242
   777
            AC_ARG_ENABLE(video-x11-xme,
slouken@242
   778
[  --enable-video-x11-xme  enable Xi Graphics XME for fullscreen [default=yes]],
slouken@242
   779
                            , enable_video_x11_xme=yes)
slouken@242
   780
            if test x$enable_video_x11_xme = xyes; then
slouken@1307
   781
                CFLAGS="$CFLAGS -DHAVE_XIGXME"
slouken@1307
   782
                VIDEO_SUBDIRS="$VIDEO_SUBDIRS Xext/XME"
slouken@1307
   783
                VIDEO_DRIVERS="$VIDEO_DRIVERS Xext/XME/libXME.la"
slouken@242
   784
            fi
slouken@0
   785
        fi
slouken@0
   786
    fi
slouken@0
   787
}
slouken@279
   788
slouken@0
   789
CheckPHOTON()
slouken@0
   790
{
slouken@0
   791
    AC_ARG_ENABLE(video-photon,
slouken@72
   792
[  --enable-video-photon   use QNX Photon video driver [default=yes]],
slouken@0
   793
                  , enable_video_photon=yes)
slouken@0
   794
    if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
slouken@0
   795
        AC_MSG_CHECKING(for QNX Photon support)
slouken@0
   796
        video_photon=no
slouken@0
   797
        AC_TRY_COMPILE([
slouken@0
   798
          #include <Ph.h>
slouken@0
   799
          #include <Pt.h>
slouken@0
   800
          #include <photon/Pg.h>
slouken@0
   801
          #include <photon/PdDirect.h>
slouken@0
   802
        ],[
slouken@0
   803
         PgDisplaySettings_t *visual;
slouken@0
   804
        ],[
slouken@0
   805
        video_photon=yes
slouken@0
   806
        ])
slouken@0
   807
        AC_MSG_RESULT($video_photon)
slouken@0
   808
        if test x$video_photon = xyes; then
slouken@19
   809
            CFLAGS="$CFLAGS -DENABLE_PHOTON"
slouken@0
   810
            SYSTEM_LIBS="$SYSTEM_LIBS -lph"
slouken@0
   811
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
slouken@0
   812
            VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
slouken@279
   813
            CheckOpenGLQNX
slouken@0
   814
        fi
slouken@0
   815
    fi
slouken@0
   816
}
slouken@0
   817
slouken@0
   818
dnl Find the framebuffer console includes
slouken@0
   819
CheckFBCON()
slouken@0
   820
{
slouken@0
   821
    AC_ARG_ENABLE(video-fbcon,
slouken@0
   822
[  --enable-video-fbcon    use framebuffer console video driver [default=yes]],
slouken@0
   823
                  , enable_video_fbcon=yes)
slouken@0
   824
    if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
slouken@0
   825
        AC_MSG_CHECKING(for framebuffer console support)
slouken@0
   826
        video_fbcon=no
slouken@0
   827
        AC_TRY_COMPILE([
slouken@0
   828
         #include <linux/fb.h>
slouken@0
   829
         #include <linux/kd.h>
slouken@0
   830
         #include <linux/keyboard.h>
slouken@0
   831
        ],[
slouken@0
   832
        ],[
slouken@0
   833
        video_fbcon=yes
slouken@0
   834
        ])
slouken@0
   835
        AC_MSG_RESULT($video_fbcon)
slouken@0
   836
        if test x$video_fbcon = xyes; then
slouken@0
   837
            CFLAGS="$CFLAGS -DENABLE_FBCON"
slouken@0
   838
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
slouken@0
   839
            VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
slouken@0
   840
        fi
slouken@0
   841
    fi
slouken@0
   842
}
slouken@0
   843
slouken@167
   844
dnl Find DirectFB
slouken@167
   845
CheckDirectFB()
slouken@167
   846
{
slouken@167
   847
    AC_ARG_ENABLE(video-directfb,
slouken@678
   848
[  --enable-video-directfb use DirectFB video driver [default=no]],
slouken@678
   849
                  , enable_video_directfb=no)
slouken@167
   850
    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
slouken@167
   851
        video_directfb=no
slouken@167
   852
slouken@167
   853
        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
slouken@167
   854
        if test x$PKG_CONFIG = xno ; then
slouken@167
   855
            AC_MSG_WARN([*** pkg-config is required to build the DirectFB video driver.])
slouken@167
   856
        else
slouken@167
   857
            AC_MSG_CHECKING(for DirectFB support)
slouken@167
   858
slouken@477
   859
            if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
slouken@477
   860
                AC_MSG_ERROR([*** pkg-config too old; version 0.7 or better required.])
slouken@167
   861
            fi
slouken@167
   862
slouken@546
   863
            DIRECTFB_REQUIRED_VERSION=0.9.15
slouken@167
   864
slouken@167
   865
            if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
slouken@167
   866
                DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
slouken@167
   867
                DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
slouken@167
   868
                video_directfb=yes
slouken@167
   869
            fi
slouken@167
   870
        fi
slouken@167
   871
slouken@167
   872
        AC_MSG_RESULT($video_directfb)
slouken@167
   873
        if test x$video_directfb = xyes; then
slouken@167
   874
            CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
slouken@167
   875
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
slouken@167
   876
            VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"
slouken@167
   877
slouken@167
   878
            AC_SUBST(DIRECTFB_CFLAGS)
slouken@167
   879
            AC_SUBST(DIRECTFB_LIBS)
slouken@167
   880
        fi
slouken@167
   881
    fi
slouken@167
   882
}
slouken@167
   883
slouken@70
   884
dnl See if we're running on PlayStation 2 hardware
slouken@70
   885
CheckPS2GS()
slouken@70
   886
{
slouken@72
   887
    AC_ARG_ENABLE(video-ps2gs,
slouken@72
   888
[  --enable-video-ps2gs    use PlayStation 2 GS video driver [default=yes]],
slouken@72
   889
                  , enable_video_ps2gs=yes)
slouken@70
   890
    if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
slouken@72
   891
        AC_MSG_CHECKING(for PlayStation 2 GS support)
slouken@70
   892
        video_ps2gs=no
slouken@70
   893
        AC_TRY_COMPILE([
slouken@70
   894
         #include <linux/ps2/dev.h>
slouken@70
   895
         #include <linux/ps2/gs.h>
slouken@70
   896
        ],[
slouken@70
   897
        ],[
slouken@70
   898
        video_ps2gs=yes
slouken@70
   899
        ])
slouken@72
   900
        AC_MSG_RESULT($video_ps2gs)
slouken@70
   901
        if test x$video_ps2gs = xyes; then
slouken@70
   902
            CFLAGS="$CFLAGS -DENABLE_PS2GS"
slouken@70
   903
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
slouken@70
   904
            VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
slouken@70
   905
        fi
slouken@70
   906
    fi
slouken@70
   907
}
slouken@70
   908
slouken@0
   909
dnl Find the GGI includes
slouken@0
   910
CheckGGI()
slouken@0
   911
{
slouken@0
   912
    AC_ARG_ENABLE(video-ggi,
slouken@0
   913
[  --enable-video-ggi      use GGI video driver [default=no]],
slouken@0
   914
                  , enable_video_ggi=no)
slouken@0
   915
    if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
slouken@0
   916
        AC_MSG_CHECKING(for GGI support)
slouken@0
   917
        video_ggi=no
slouken@0
   918
        AC_TRY_COMPILE([
slouken@0
   919
         #include <ggi/ggi.h>
slouken@0
   920
         #include <ggi/gii.h>
slouken@0
   921
        ],[
slouken@0
   922
        ],[
slouken@0
   923
        video_ggi=yes
slouken@0
   924
        ])
slouken@0
   925
        AC_MSG_RESULT($video_ggi)
slouken@0
   926
        if test x$video_ggi = xyes; then
slouken@0
   927
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
slouken@0
   928
            SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
slouken@0
   929
slouken@0
   930
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
slouken@0
   931
            VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
slouken@0
   932
        fi
slouken@0
   933
    fi
slouken@0
   934
}
slouken@0
   935
slouken@0
   936
dnl Find the SVGAlib includes and libraries
slouken@0
   937
CheckSVGA()
slouken@0
   938
{
slouken@0
   939
    AC_ARG_ENABLE(video-svga,
slouken@0
   940
[  --enable-video-svga     use SVGAlib video driver [default=no]],
slouken@0
   941
                  , enable_video_svga=no)
slouken@0
   942
    if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
slouken@0
   943
        AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
slouken@0
   944
        video_svga=no
slouken@0
   945
        AC_TRY_COMPILE([
slouken@0
   946
         #include <vga.h>
slouken@0
   947
         #include <vgamouse.h>
slouken@0
   948
         #include <vgakeyboard.h>
slouken@0
   949
        ],[
slouken@0
   950
         if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
slouken@0
   951
             exit(0);
slouken@0
   952
         }
slouken@0
   953
        ],[
slouken@0
   954
        video_svga=yes
slouken@0
   955
        ])
slouken@0
   956
        AC_MSG_RESULT($video_svga)
slouken@0
   957
        if test x$video_svga = xyes; then
slouken@0
   958
            CFLAGS="$CFLAGS -DENABLE_SVGALIB"
slouken@0
   959
            SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
slouken@0
   960
slouken@0
   961
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
slouken@0
   962
            VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
slouken@0
   963
        fi
slouken@0
   964
    fi
slouken@0
   965
}
slouken@0
   966
slouken@75
   967
dnl Find the VGL includes and libraries
slouken@75
   968
CheckVGL()
slouken@75
   969
{
slouken@75
   970
    AC_ARG_ENABLE(video-vgl,
patmandin@651
   971
[  --enable-video-vgl      use VGL video driver [default=no]],
slouken@75
   972
                  , enable_video_vgl=no)
slouken@75
   973
    if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
slouken@75
   974
        AC_MSG_CHECKING(for libVGL support)
slouken@75
   975
        video_vgl=no
slouken@75
   976
        AC_TRY_COMPILE([
slouken@75
   977
         #include <sys/fbio.h>
slouken@75
   978
         #include <sys/consio.h>
slouken@75
   979
         #include <sys/kbio.h>
slouken@75
   980
         #include <vgl.h>
slouken@75
   981
        ],[
slouken@75
   982
         VGLBitmap bitmap;
slouken@144
   983
         exit(bitmap.Bitmap);
slouken@75
   984
        ],[
slouken@75
   985
        video_vgl=yes
slouken@75
   986
        ])
slouken@75
   987
        AC_MSG_RESULT($video_vgl)
slouken@75
   988
        if test x$video_vgl = xyes; then
slouken@75
   989
            CFLAGS="$CFLAGS -DENABLE_VGL"
slouken@75
   990
            SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"
slouken@75
   991
slouken@75
   992
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
slouken@75
   993
            VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
slouken@75
   994
        fi
slouken@75
   995
    fi
slouken@75
   996
}
slouken@75
   997
slouken@0
   998
dnl Find the AAlib includes
slouken@0
   999
CheckAAlib()
slouken@0
  1000
{
slouken@0
  1001
    AC_ARG_ENABLE(video-aalib,
slouken@0
  1002
[  --enable-video-aalib    use AAlib video driver [default=no]],
slouken@0
  1003
                  , enable_video_aalib=no)
slouken@0
  1004
    if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
slouken@0
  1005
        AC_MSG_CHECKING(for AAlib support)
slouken@0
  1006
        video_aalib=no
slouken@0
  1007
        AC_TRY_COMPILE([
slouken@0
  1008
         #include <aalib.h>
slouken@0
  1009
        ],[
slouken@0
  1010
        ],[
slouken@0
  1011
        video_aalib=yes
slouken@0
  1012
        ])
slouken@0
  1013
        AC_MSG_RESULT($video_aalib)
slouken@0
  1014
        if test x$video_aalib = xyes; then
slouken@0
  1015
            CFLAGS="$CFLAGS -DENABLE_AALIB"
slouken@0
  1016
            SYSTEM_LIBS="$SYSTEM_LIBS -laa"
slouken@0
  1017
slouken@0
  1018
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
slouken@0
  1019
            VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
slouken@0
  1020
        fi
slouken@0
  1021
    fi
slouken@0
  1022
}
slouken@0
  1023
slouken@281
  1024
dnl Set up the Atari Xbios driver
slouken@281
  1025
CheckAtariXbiosVideo()
slouken@281
  1026
{
slouken@281
  1027
    AC_ARG_ENABLE(xbios,
slouken@281
  1028
[  --enable-video-xbios    use Atari Xbios video driver [default=yes]],
slouken@281
  1029
                  , enable_video_xbios=yes)
slouken@281
  1030
    video_xbios=no
slouken@281
  1031
    if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
slouken@281
  1032
        video_xbios=yes
slouken@281
  1033
        CFLAGS="$CFLAGS -DENABLE_XBIOS"
slouken@281
  1034
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
slouken@281
  1035
        VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
slouken@281
  1036
    fi
slouken@281
  1037
}
slouken@281
  1038
slouken@281
  1039
dnl Set up the Atari Gem driver
slouken@281
  1040
CheckAtariGemVideo()
slouken@281
  1041
{
slouken@281
  1042
    AC_ARG_ENABLE(gem,
slouken@281
  1043
[  --enable-video-gem      use Atari Gem video driver [default=yes]],
slouken@281
  1044
                  , enable_video_gem=yes)
slouken@281
  1045
    if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
slouken@281
  1046
        video_gem=no
slouken@281
  1047
        AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
slouken@281
  1048
        AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
slouken@281
  1049
        if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
slouken@281
  1050
            video_gem=yes
slouken@281
  1051
            CFLAGS="$CFLAGS -DENABLE_GEM"
slouken@281
  1052
            SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
slouken@281
  1053
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
slouken@281
  1054
            VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
slouken@281
  1055
        fi
slouken@281
  1056
    fi
slouken@281
  1057
}
slouken@281
  1058
slouken@281
  1059
dnl Set up the Atari Bios keyboard driver
slouken@281
  1060
CheckAtariBiosEvent()
slouken@281
  1061
{
slouken@281
  1062
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
slouken@281
  1063
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
slouken@281
  1064
    VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
slouken@281
  1065
}
slouken@281
  1066
slouken@1
  1067
dnl rcg04172001 Set up the Null video driver.
slouken@1
  1068
CheckDummyVideo()
slouken@1
  1069
{
slouken@1
  1070
    AC_ARG_ENABLE(video-dummy,
slouken@86
  1071
[  --enable-video-dummy    use dummy video driver [default=yes]],
slouken@86
  1072
                  , enable_video_dummy=yes)
slouken@1
  1073
    if test x$enable_video_dummy = xyes; then
slouken@1
  1074
      CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
slouken@1
  1075
      VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
slouken@1
  1076
      VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
slouken@1
  1077
    fi
slouken@1
  1078
}
slouken@1
  1079
slouken@0
  1080
dnl Check to see if OpenGL support is desired
slouken@0
  1081
AC_ARG_ENABLE(video-opengl,
slouken@0
  1082
[  --enable-video-opengl   include OpenGL context creation [default=yes]],
slouken@0
  1083
              , enable_video_opengl=yes)
slouken@0
  1084
slouken@0
  1085
dnl Find OpenGL
icculus@1191
  1086
CheckOpenGLX11()
slouken@0
  1087
{
slouken@0
  1088
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1089
        AC_MSG_CHECKING(for OpenGL (GLX) support)
slouken@0
  1090
        video_opengl=no
slouken@0
  1091
        AC_TRY_COMPILE([
slouken@0
  1092
         #include <GL/gl.h>
slouken@0
  1093
         #include <GL/glx.h>
slouken@0
  1094
         #include <dlfcn.h> /* For loading extensions */
slouken@0
  1095
        ],[
slouken@0
  1096
        ],[
slouken@0
  1097
        video_opengl=yes
slouken@0
  1098
        ])
slouken@0
  1099
        AC_MSG_RESULT($video_opengl)
slouken@0
  1100
        if test x$video_opengl = xyes; then
icculus@1191
  1101
            CFLAGS="$CFLAGS -DHAVE_OPENGL -DHAVE_OPENGL_X11"
icculus@1173
  1102
            if test x$have_loadso != xyes; then
slouken@296
  1103
                AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
slouken@296
  1104
            fi
slouken@0
  1105
        fi
slouken@0
  1106
    fi
slouken@0
  1107
}
slouken@0
  1108
slouken@279
  1109
dnl Find QNX RtP OpenGL
slouken@279
  1110
CheckOpenGLQNX()
slouken@279
  1111
{
slouken@279
  1112
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@279
  1113
        AC_MSG_CHECKING(for OpenGL (Photon) support)
slouken@279
  1114
        video_opengl=no
slouken@279
  1115
        AC_TRY_COMPILE([
slouken@279
  1116
         #include <GL/gl.h>
slouken@279
  1117
        ],[
slouken@279
  1118
        ],[
slouken@279
  1119
        video_opengl=yes
slouken@279
  1120
        ])
slouken@279
  1121
        AC_MSG_RESULT($video_opengl)
slouken@279
  1122
        if test x$video_opengl = xyes; then
slouken@279
  1123
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@279
  1124
            SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
icculus@1173
  1125
            if test x$have_loadso != xyes; then
slouken@666
  1126
                AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
slouken@570
  1127
            fi
slouken@279
  1128
        fi
slouken@279
  1129
    fi
slouken@279
  1130
}
slouken@279
  1131
slouken@0
  1132
dnl Check for BeOS OpenGL
slouken@0
  1133
CheckBeGL()
slouken@0
  1134
{
slouken@0
  1135
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1136
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
  1137
        SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
slouken@0
  1138
    fi
slouken@0
  1139
}
slouken@0
  1140
slouken@0
  1141
dnl Check for MacOS OpenGL
slouken@0
  1142
CheckMacGL()
slouken@0
  1143
{
slouken@0
  1144
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1145
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
  1146
        case "$target" in
slouken@0
  1147
            *-*-darwin*)
icculus@1133
  1148
                SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL"
icculus@1133
  1149
                # The following is probably not available in Darwin:
icculus@1133
  1150
                SYSTEM_LIBS="$SYSTEM_LIBS -framework AGL"
slouken@0
  1151
        esac
slouken@0
  1152
    fi
slouken@0
  1153
}
slouken@0
  1154
patmandin@978
  1155
dnl Check for Mesa offscreen rendering
patmandin@989
  1156
CheckAtariOSMesa()
patmandin@978
  1157
{
patmandin@989
  1158
    if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
patmandin@991
  1159
        AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
patmandin@991
  1160
        AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
patmandin@991
  1161
patmandin@991
  1162
        # Static linking to -lOSMesa
patmandin@989
  1163
        AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
patmandin@989
  1164
        if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
patmandin@991
  1165
            # -lOSMesa is really the static library
patmandin@989
  1166
            if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
patmandin@989
  1167
    	        CFLAGS="$CFLAGS -DHAVE_OPENGL"
patmandin@989
  1168
		    	SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa"
patmandin@989
  1169
            fi
patmandin@989
  1170
        else
patmandin@991
  1171
            # -lOSMesa is a loader for OSMesa.ldg
patmandin@989
  1172
            OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
patmandin@989
  1173
            OSMESA_LIBS=`$OSMESA_CONFIG --libs`
patmandin@991
  1174
            CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
patmandin@989
  1175
            SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS"
patmandin@978
  1176
        fi
patmandin@991
  1177
patmandin@991
  1178
        AC_ARG_ENABLE(osmesa-shared,
patmandin@991
  1179
[  --enable-osmesa-shared  dynamically load OSMesa OpenGL support [default=yes]],
patmandin@991
  1180
                              , enable_osmesa_shared=yes)
patmandin@991
  1181
        if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
patmandin@991
  1182
            # Dynamic linking
patmandin@991
  1183
            if test "x$have_osmesa_hdr" = "xyes"; then
patmandin@991
  1184
                CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED"
patmandin@991
  1185
            fi
patmandin@991
  1186
		fi
patmandin@978
  1187
    fi
patmandin@978
  1188
}
patmandin@978
  1189
slouken@0
  1190
dnl See if we can use the new unified event interface in Linux 2.4
slouken@0
  1191
CheckInputEvents()
slouken@0
  1192
{
slouken@0
  1193
    dnl Check for Linux 2.4 unified input event interface support
slouken@0
  1194
    AC_ARG_ENABLE(input-events,
slouken@211
  1195
[  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
slouken@211
  1196
                  , enable_input_events=yes)
slouken@0
  1197
    if test x$enable_input_events = xyes; then
slouken@0
  1198
        AC_MSG_CHECKING(for Linux 2.4 unified input interface)
slouken@0
  1199
        use_input_events=no
slouken@0
  1200
        AC_TRY_COMPILE([
slouken@0
  1201
          #include <linux/input.h>
slouken@0
  1202
        ],[
slouken@0
  1203
          #ifndef EVIOCGNAME
slouken@0
  1204
          #error EVIOCGNAME() ioctl not available
slouken@0
  1205
          #endif
slouken@0
  1206
        ],[
slouken@0
  1207
        use_input_events=yes
slouken@0
  1208
        ])
slouken@0
  1209
        AC_MSG_RESULT($use_input_events)
slouken@0
  1210
        if test x$use_input_events = xyes; then
slouken@0
  1211
            CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
slouken@0
  1212
        fi
slouken@0
  1213
    fi
slouken@0
  1214
}
slouken@0
  1215
icculus@1201
  1216
dnl See if we can use the Touchscreen input library
icculus@1201
  1217
CheckTslib()
icculus@1201
  1218
{
icculus@1201
  1219
    AC_ARG_ENABLE(input-tslib,
icculus@1201
  1220
[  --enable-input-tslib    use the Touchscreen library for input [default=yes]],
icculus@1201
  1221
                  , enable_input_tslib=yes)
icculus@1201
  1222
    if test x$enable_input_tslib = xyes; then
icculus@1201
  1223
        AC_MSG_CHECKING(for Touchscreen library support)
icculus@1201
  1224
        enable_input_tslib=no
icculus@1201
  1225
        AC_TRY_COMPILE([
icculus@1201
  1226
          #include "tslib.h"
icculus@1201
  1227
        ],[
icculus@1201
  1228
        ],[
icculus@1201
  1229
        enable_input_tslib=yes
icculus@1201
  1230
        ])
icculus@1201
  1231
        AC_MSG_RESULT($enable_input_tslib)
icculus@1201
  1232
        if test x$enable_input_tslib = xyes; then
icculus@1201
  1233
            CFLAGS="$CFLAGS -DHAVE_TSLIB"
icculus@1201
  1234
            SYSTEM_LIBS="$SYSTEM_LIBS -lts"
icculus@1201
  1235
        fi
icculus@1201
  1236
    fi
icculus@1201
  1237
}
icculus@1201
  1238
slouken@399
  1239
dnl See if we can use GNU pth library for threads
slouken@399
  1240
CheckPTH()
slouken@399
  1241
{
slouken@399
  1242
    dnl Check for pth support
slouken@399
  1243
    AC_ARG_ENABLE(pth,
slouken@399
  1244
[  --enable-pth            use GNU pth library for multi-threading [default=yes]],
slouken@399
  1245
                  , enable_pth=yes)
slouken@399
  1246
    if test x$enable_threads = xyes -a x$enable_pth = xyes; then
slouken@399
  1247
        AC_PATH_PROG(PTH_CONFIG, pth-config, no)
slouken@399
  1248
        if test "$PTH_CONFIG" = "no"; then
slouken@399
  1249
            use_pth=no
slouken@399
  1250
        else
slouken@399
  1251
            PTH_CFLAGS=`$PTH_CONFIG --cflags`
slouken@399
  1252
            PTH_LIBS=`$PTH_CONFIG --libs --all`
slouken@399
  1253
            SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
slouken@399
  1254
            SDL_LIBS="$SDL_LIBS $PTH_LIBS"
slouken@399
  1255
            CFLAGS="$CFLAGS -DENABLE_PTH"
slouken@399
  1256
            use_pth=yes
slouken@399
  1257
        fi
slouken@399
  1258
        AC_MSG_CHECKING(pth)
slouken@399
  1259
        if test "x$use_pth" = xyes; then
slouken@399
  1260
            AC_MSG_RESULT(yes)
slouken@399
  1261
        else
slouken@399
  1262
            AC_MSG_RESULT(no)
slouken@399
  1263
        fi
slouken@399
  1264
    fi
slouken@399
  1265
}
slouken@399
  1266
slouken@0
  1267
dnl See what type of thread model to use on Linux and Solaris
slouken@0
  1268
CheckPTHREAD()
slouken@0
  1269
{
slouken@0
  1270
    dnl Check for pthread support
slouken@0
  1271
    AC_ARG_ENABLE(pthreads,
slouken@0
  1272
[  --enable-pthreads       use POSIX threads for multi-threading [default=yes]],
slouken@0
  1273
                  , enable_pthreads=yes)
slouken@0
  1274
    dnl This is used on Linux for glibc binary compatibility (Doh!)
slouken@0
  1275
    AC_ARG_ENABLE(pthread-sem,
slouken@86
  1276
[  --enable-pthread-sem    use pthread semaphores [default=yes]],
slouken@0
  1277
                  , enable_pthread_sem=yes)
slouken@0
  1278
    case "$target" in
slouken@1324
  1279
        *-*-linux*)
slouken@1324
  1280
            pthread_cflags="-D_REENTRANT -D_GNU_SOURCE"
slouken@1324
  1281
            pthread_lib="-lpthread"
slouken@1324
  1282
            ;;
slouken@0
  1283
        *-*-bsdi*)
slouken@0
  1284
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1285
            pthread_lib=""
slouken@0
  1286
            ;;
slouken@0
  1287
        *-*-darwin*)
slouken@0
  1288
            pthread_cflags="-D_THREAD_SAFE"
slouken@0
  1289
# causes Carbon.p complaints?
slouken@0
  1290
#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1291
            ;;
slouken@0
  1292
        *-*-freebsd*)
slouken@0
  1293
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1294
            pthread_lib="-pthread"
slouken@0
  1295
            ;;
slouken@43
  1296
        *-*-netbsd*)
icculus@1200
  1297
            pthread_cflags="-I/usr/include -D_REENTRANT -D_THREAD_SAFE"
icculus@1200
  1298
            pthread_lib="-L/usr/lib -lpthread"
slouken@43
  1299
            ;;
slouken@0
  1300
        *-*-openbsd*)
slouken@0
  1301
            pthread_cflags="-D_REENTRANT"
slouken@0
  1302
            pthread_lib="-pthread"
slouken@0
  1303
            ;;
slouken@0
  1304
        *-*-solaris*)
slouken@0
  1305
            pthread_cflags="-D_REENTRANT"
slouken@0
  1306
            pthread_lib="-lpthread -lposix4"
slouken@0
  1307
            ;;
slouken@0
  1308
        *-*-sysv5*)
slouken@0
  1309
            pthread_cflags="-D_REENTRANT -Kthread"
slouken@0
  1310
            pthread_lib=""
slouken@0
  1311
            ;;
slouken@0
  1312
        *-*-irix*)
slouken@0
  1313
            pthread_cflags="-D_SGI_MP_SOURCE"
slouken@0
  1314
            pthread_lib="-lpthread"
slouken@0
  1315
            ;;
slouken@0
  1316
        *-*-aix*)
slouken@0
  1317
            pthread_cflags="-D_REENTRANT -mthreads"
slouken@0
  1318
            pthread_lib="-lpthread"
slouken@0
  1319
            ;;
icculus@425
  1320
        *-*-hpux11*)
icculus@425
  1321
            pthread_cflags="-D_REENTRANT"
icculus@425
  1322
            pthread_lib="-L/usr/lib -lpthread"
icculus@425
  1323
            ;;
slouken@0
  1324
        *-*-qnx*)
slouken@0
  1325
            pthread_cflags=""
slouken@0
  1326
            pthread_lib=""
slouken@0
  1327
            ;;
slouken@873
  1328
        *-*-osf*)
slouken@1019
  1329
            pthread_cflags="-D_REENTRANT"
slouken@873
  1330
            if test x$ac_cv_prog_gcc = xyes; then
slouken@873
  1331
                pthread_lib="-lpthread -lrt"
slouken@873
  1332
            else
slouken@1019
  1333
                pthread_lib="-lpthread -lexc -lrt"
slouken@873
  1334
            fi
slouken@873
  1335
            ;;
slouken@0
  1336
        *)
slouken@0
  1337
            pthread_cflags="-D_REENTRANT"
slouken@0
  1338
            pthread_lib="-lpthread"
slouken@0
  1339
            ;;
slouken@0
  1340
    esac
icculus@1140
  1341
    if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
slouken@415
  1342
        # Save the original compiler flags and libraries
slouken@415
  1343
        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
slouken@415
  1344
        # Add the pthread compiler flags and libraries
slouken@415
  1345
        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
slouken@415
  1346
        # Check to see if we have pthread support on this system
slouken@0
  1347
        AC_MSG_CHECKING(for pthreads)
slouken@0
  1348
        use_pthreads=no
slouken@0
  1349
        AC_TRY_LINK([
slouken@0
  1350
         #include <pthread.h>
slouken@0
  1351
        ],[
slouken@0
  1352
         pthread_attr_t type;
slouken@0
  1353
         pthread_attr_init(&type);
slouken@0
  1354
        ],[
slouken@0
  1355
        use_pthreads=yes
slouken@0
  1356
        ])
slouken@0
  1357
        AC_MSG_RESULT($use_pthreads)
slouken@415
  1358
        # Restore the compiler flags and libraries
slouken@415
  1359
        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
slouken@415
  1360
        # Do futher testing if we have pthread support...
slouken@0
  1361
        if test x$use_pthreads = xyes; then
slouken@0
  1362
            CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
slouken@846
  1363
            LIBS="$LIBS $pthread_lib"
slouken@0
  1364
            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
slouken@0
  1365
            SDL_LIBS="$SDL_LIBS $pthread_lib"
slouken@0
  1366
slouken@0
  1367
            # Check to see if recursive mutexes are available
slouken@0
  1368
            AC_MSG_CHECKING(for recursive mutexes)
slouken@0
  1369
            has_recursive_mutexes=no
slouken@1324
  1370
            if test x$has_recursive_mutexes = xno; then
slouken@1324
  1371
                AC_TRY_COMPILE([
slouken@1324
  1372
                  #include <pthread.h>
slouken@1324
  1373
                ],[
slouken@1324
  1374
                  pthread_mutexattr_t attr;
slouken@1324
  1375
                  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
slouken@1324
  1376
                ],[
slouken@1324
  1377
                has_recursive_mutexes=yes
slouken@1324
  1378
                CFLAGS="$CFLAGS -DPTHREAD_RECURSIVE_MUTEX"
slouken@1324
  1379
                ])
slouken@1324
  1380
            fi
slouken@1324
  1381
            if test x$has_recursive_mutexes = xno; then
slouken@1324
  1382
                AC_TRY_COMPILE([
slouken@1324
  1383
                  #include <pthread.h>
slouken@1324
  1384
                ],[
slouken@1324
  1385
                  pthread_mutexattr_t attr;
slouken@1324
  1386
                  pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
slouken@1324
  1387
                ],[
slouken@1324
  1388
                has_recursive_mutexes=yes
slouken@1324
  1389
                CFLAGS="$CFLAGS -DPTHREAD_RECURSIVE_MUTEX_NP"
slouken@1324
  1390
                ])
slouken@1324
  1391
            fi
slouken@0
  1392
            AC_MSG_RESULT($has_recursive_mutexes)
slouken@1324
  1393
            if test x$has_recursive_mutexes = xno; then
slouken@0
  1394
                CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
slouken@0
  1395
            fi
slouken@0
  1396
slouken@94
  1397
            # Check to see if pthread semaphore support is missing
slouken@94
  1398
            if test x$enable_pthread_sem = xyes; then
slouken@94
  1399
                AC_MSG_CHECKING(for pthread semaphores)
slouken@94
  1400
                have_pthread_sem=no
slouken@94
  1401
                AC_TRY_COMPILE([
slouken@94
  1402
                  #include <pthread.h>
slouken@94
  1403
                  #include <semaphore.h>
slouken@94
  1404
                ],[
slouken@94
  1405
                ],[
slouken@94
  1406
                have_pthread_sem=yes
slouken@94
  1407
                ])
slouken@94
  1408
                AC_MSG_RESULT($have_pthread_sem)
slouken@94
  1409
            fi
slouken@94
  1410
slouken@0
  1411
            # Check to see if this is broken glibc 2.0 pthreads
slouken@0
  1412
            case "$target" in
slouken@0
  1413
                *-*-linux*)
slouken@0
  1414
                    AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
slouken@0
  1415
                    glibc20_pthreads=no
slouken@0
  1416
                    AC_TRY_COMPILE([
slouken@0
  1417
                      #include <features.h>
slouken@0
  1418
                      #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
slouken@0
  1419
                      #warning Working around a bug in glibc 2.0 pthreads
slouken@0
  1420
                      #else
slouken@0
  1421
                      #error pthread implementation okay
slouken@0
  1422
                      #endif /* glibc 2.0 */
slouken@0
  1423
                    ],[
slouken@0
  1424
                    ],[
slouken@0
  1425
                    glibc20_pthreads=yes
slouken@0
  1426
                    ])
slouken@0
  1427
                    AC_MSG_RESULT($glibc20_pthreads)
slouken@0
  1428
            esac
slouken@0
  1429
        fi
slouken@0
  1430
    fi
slouken@0
  1431
slouken@0
  1432
    AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
slouken@0
  1433
    have_semun=no
slouken@0
  1434
    AC_TRY_COMPILE([
slouken@0
  1435
      #include <sys/types.h>
slouken@0
  1436
      #include <sys/sem.h>
slouken@0
  1437
    ],[
slouken@0
  1438
      union semun t;
slouken@0
  1439
    ],[
slouken@0
  1440
    have_semun=yes
slouken@0
  1441
    ])
slouken@0
  1442
    AC_MSG_RESULT($have_semun)
slouken@0
  1443
    if test x$have_semun = xyes; then
slouken@0
  1444
        CFLAGS="$CFLAGS -DHAVE_SEMUN"
slouken@0
  1445
    fi
slouken@0
  1446
slouken@399
  1447
    # See if we can use GNU Pth or clone() on Linux directly
slouken@0
  1448
    if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
slouken@399
  1449
        CheckPTH
slouken@399
  1450
        if test x$use_pth != xyes; then
slouken@399
  1451
            case "$target" in
slouken@399
  1452
                *-*-linux*)
slouken@399
  1453
                    use_clone=yes
slouken@399
  1454
                    ;;
slouken@399
  1455
            esac
slouken@399
  1456
        fi
slouken@0
  1457
    fi
slouken@0
  1458
}
slouken@0
  1459
slouken@399
  1460
# Note that we need to have either semaphores or to have mutexes and
slouken@399
  1461
# condition variables to implement all thread synchronization primitives
slouken@399
  1462
CopyUnixThreadSource()
slouken@185
  1463
{
slouken@399
  1464
    if test x$use_pthreads = xyes -o x$use_clone = xyes; then
slouken@399
  1465
        # Basic thread creation functions
slouken@399
  1466
        COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@399
  1467
        COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@399
  1468
slouken@399
  1469
        # Semaphores
slouken@399
  1470
        # We can fake these with mutexes and condition variables if necessary
slouken@399
  1471
        if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@399
  1472
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@185
  1473
        else
slouken@399
  1474
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@185
  1475
        fi
slouken@399
  1476
        COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@399
  1477
slouken@399
  1478
        # Mutexes
slouken@399
  1479
        # We can fake these with semaphores if necessary
slouken@399
  1480
        case "$target" in
slouken@399
  1481
            *-*-bsdi*)
slouken@399
  1482
                COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
slouken@399
  1483
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@599
  1484
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@599
  1485
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@399
  1486
                ;;
slouken@399
  1487
            *)
slouken@399
  1488
                if test x$glibc20_pthreads = xyes; then
slouken@399
  1489
                    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@399
  1490
                    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@399
  1491
                else
slouken@399
  1492
                    COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@399
  1493
                    COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@399
  1494
                fi
slouken@399
  1495
                ;;
slouken@399
  1496
        esac
slouken@399
  1497
slouken@399
  1498
        # Condition variables
slouken@399
  1499
        # We can fake these with semaphores and mutexes if necessary
slouken@399
  1500
        if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
slouken@399
  1501
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@185
  1502
        else
slouken@399
  1503
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@185
  1504
        fi
slouken@399
  1505
        COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@399
  1506
slouken@400
  1507
    elif test x$use_pth = xyes; then
slouken@399
  1508
        COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
slouken@399
  1509
        COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
slouken@399
  1510
        COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
slouken@399
  1511
        COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
slouken@399
  1512
        COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
slouken@399
  1513
        COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
slouken@399
  1514
        COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@399
  1515
        COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@399
  1516
    else
slouken@399
  1517
       AC_MSG_ERROR([
slouken@399
  1518
*** No thread support detected
slouken@399
  1519
       ])
slouken@185
  1520
    fi
slouken@185
  1521
}
slouken@185
  1522
slouken@814
  1523
dnl See if we can use sigaction() instead of signal()
slouken@814
  1524
CheckSIGACTION()
slouken@814
  1525
{
slouken@814
  1526
    dnl Check for sigaction support
slouken@814
  1527
    AC_ARG_ENABLE(sigaction,
slouken@814
  1528
[  --enable-sigaction      use sigaction instead of signal [default=yes]],
slouken@814
  1529
                  , enable_sigaction=yes)
slouken@814
  1530
    if test x$enable_sigaction = xyes; then
slouken@814
  1531
        AC_MSG_CHECKING(sigaction)
slouken@814
  1532
        have_sigaction=no
slouken@814
  1533
        AC_TRY_COMPILE([
slouken@814
  1534
         #include <signal.h>
slouken@814
  1535
        ],[
slouken@814
  1536
         struct sigaction junk;
slouken@814
  1537
         sigaction(0, &junk, &junk);
slouken@814
  1538
        ],[
slouken@814
  1539
        have_sigaction=yes
slouken@814
  1540
        ])
slouken@814
  1541
        AC_MSG_RESULT($have_sigaction)
slouken@814
  1542
        if test x$have_sigaction = xyes; then
slouken@814
  1543
            CFLAGS="$CFLAGS -DHAVE_SIGACTION"
slouken@814
  1544
        fi
slouken@814
  1545
    fi
slouken@814
  1546
}
slouken@814
  1547
slouken@0
  1548
dnl Determine whether the compiler can produce Win32 executables
slouken@0
  1549
CheckWIN32()
slouken@0
  1550
{
slouken@0
  1551
    AC_MSG_CHECKING(Win32 compiler)
slouken@0
  1552
    have_win32_gcc=no
slouken@0
  1553
    AC_TRY_COMPILE([
slouken@0
  1554
     #include <windows.h>
slouken@0
  1555
    ],[
slouken@0
  1556
    ],[
slouken@0
  1557
    have_win32_gcc=yes
slouken@0
  1558
    ])
slouken@0
  1559
    AC_MSG_RESULT($have_win32_gcc)
slouken@0
  1560
    if test x$have_win32_gcc != xyes; then
slouken@0
  1561
       AC_MSG_ERROR([
slouken@0
  1562
*** Your compiler ($CC) does not produce Win32 executables!
slouken@0
  1563
       ])
slouken@0
  1564
    fi
slouken@0
  1565
slouken@0
  1566
    dnl See if the user wants to redirect standard output to files
slouken@0
  1567
    AC_ARG_ENABLE(stdio-redirect,
slouken@0
  1568
[  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
slouken@0
  1569
                  , enable_stdio_redirect=yes)
slouken@0
  1570
    if test x$enable_stdio_redirect != xyes; then
slouken@0
  1571
        CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
slouken@0
  1572
    fi
slouken@0
  1573
}
slouken@0
  1574
slouken@0
  1575
dnl Find the DirectX includes and libraries
slouken@0
  1576
CheckDIRECTX()
slouken@0
  1577
{
slouken@0
  1578
    AC_ARG_ENABLE(directx,
slouken@0
  1579
[  --enable-directx        use DirectX for Win32 audio/video [default=yes]],
slouken@0
  1580
                  , enable_directx=yes)
slouken@0
  1581
    if test x$enable_directx = xyes; then
slouken@0
  1582
        AC_MSG_CHECKING(for DirectX headers and libraries)
slouken@0
  1583
        use_directx=no
patmandin@780
  1584
        tmp_cflags=$CFLAGS
patmandin@780
  1585
        CFLAGS="$CFLAGS -I$srcdir"
slouken@0
  1586
        AC_TRY_COMPILE([
slouken@0
  1587
         #include "src/video/windx5/directx.h"
slouken@0
  1588
        ],[
slouken@0
  1589
        ],[
slouken@0
  1590
        use_directx=yes
slouken@0
  1591
        ])
patmandin@780
  1592
        CFLAGS=$tmp_cflags
slouken@0
  1593
        AC_MSG_RESULT($use_directx)
slouken@0
  1594
    fi
slouken@0
  1595
slouken@0
  1596
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
slouken@0
  1597
    SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
slouken@0
  1598
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
slouken@0
  1599
    VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
slouken@0
  1600
    # Enable the DIB driver
slouken@0
  1601
    CFLAGS="$CFLAGS -DENABLE_WINDIB"
slouken@0
  1602
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
slouken@0
  1603
    VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
slouken@0
  1604
    # See if we should enable the DirectX driver
slouken@0
  1605
    if test x$use_directx = xyes; then
slouken@0
  1606
        CFLAGS="$CFLAGS -DENABLE_DIRECTX"
slouken@0
  1607
        SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
slouken@0
  1608
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
slouken@0
  1609
        VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
slouken@0
  1610
    fi
slouken@0
  1611
}
slouken@0
  1612
slouken@0
  1613
dnl Set up the BWindow video driver on BeOS
slouken@0
  1614
CheckBWINDOW()
slouken@0
  1615
{
slouken@0
  1616
    CFLAGS="$CFLAGS -DENABLE_BWINDOW"
slouken@0
  1617
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
slouken@0
  1618
    VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
slouken@0
  1619
}
slouken@0
  1620
slouken@371
  1621
dnl Set up the QTopia video driver if enabled
slouken@371
  1622
CheckQtopia()
slouken@371
  1623
{
slouken@371
  1624
    AC_ARG_ENABLE(video-qtopia,
slouken@371
  1625
[  --enable-video-qtopia   use Qtopia video driver [default=no]],
slouken@371
  1626
                  , enable_video_qtopia=no)
slouken@371
  1627
    if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
slouken@371
  1628
        AC_MSG_CHECKING(for Qtopia support)
slouken@371
  1629
        video_qtopia=no
slouken@371
  1630
        AC_LANG_CPLUSPLUS
slouken@371
  1631
        OLD_CXX="$CXXFLAGS"
slouken@371
  1632
        CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
slouken@371
  1633
        AC_TRY_COMPILE([
slouken@371
  1634
         #include <qpe/qpeapplication.h>
slouken@371
  1635
        ],[
slouken@371
  1636
        ],[
slouken@371
  1637
        video_qtopia=yes
slouken@371
  1638
        ])
slouken@371
  1639
        CXXFLAGS="$OLD_CXX"
slouken@371
  1640
        AC_MSG_RESULT($video_qtopia)
slouken@371
  1641
        if test x$video_qtopia = xyes; then
slouken@371
  1642
            CFLAGS="$CFLAGS -DENABLE_QTOPIA -DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
slouken@378
  1643
            SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
slouken@567
  1644
            SDL_CFLAGS="$SDL_CFLAGS -DQWS"	  
slouken@371
  1645
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
slouken@371
  1646
            VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
slouken@567
  1647
        else
slouken@567
  1648
	AC_MSG_ERROR([
slouken@567
  1649
*** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR
slouken@567
  1650
*** environment variables are set correctly.])
slouken@371
  1651
        fi
slouken@371
  1652
        AC_LANG_C
slouken@371
  1653
    fi
slouken@371
  1654
}
slouken@371
  1655
icculus@1187
  1656
dnl Set up the wscons video driver if enabled
icculus@1187
  1657
CheckWscons()
icculus@1187
  1658
{
icculus@1187
  1659
    AC_ARG_ENABLE(video-wscons,
icculus@1187
  1660
[  --enable-video-wscons   use wscons video driver [default=no]],
icculus@1187
  1661
                  , enable_video_wscons=no)
icculus@1187
  1662
    if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
icculus@1187
  1663
        AC_MSG_CHECKING(for wscons support)
icculus@1187
  1664
        video_wscons=no
icculus@1187
  1665
        AC_LANG_C
icculus@1187
  1666
        AC_TRY_COMPILE([
icculus@1187
  1667
       #include <sys/time.h>
icculus@1187
  1668
       #include <dev/wscons/wsconsio.h>
icculus@1187
  1669
        ],[
icculus@1187
  1670
        ],[
icculus@1187
  1671
        video_wscons=yes
icculus@1187
  1672
        ])
icculus@1187
  1673
        AC_MSG_RESULT($video_wscons)
icculus@1187
  1674
        if test x$video_wscons = xyes; then
icculus@1187
  1675
            CFLAGS="$CFLAGS -DENABLE_WSCONS"
icculus@1187
  1676
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS wscons"
icculus@1187
  1677
            VIDEO_DRIVERS="$VIDEO_DRIVERS wscons/libvideo_wscons.la"
icculus@1187
  1678
        else
icculus@1187
  1679
      AC_MSG_ERROR([
icculus@1187
  1680
*** Failed to find wscons includes.])
icculus@1187
  1681
        fi
icculus@1187
  1682
      AC_LANG_C
icculus@1187
  1683
    fi
icculus@1187
  1684
}
icculus@1187
  1685
icculus@1187
  1686
slouken@433
  1687
dnl Set up the PicoGUI video driver if enabled
slouken@433
  1688
CheckPicoGUI()
slouken@433
  1689
{
slouken@433
  1690
    AC_ARG_ENABLE(video-picogui,
slouken@433
  1691
[  --enable-video-picogui  use PicoGUI video driver [default=no]],
slouken@433
  1692
                  , enable_video_picogui=no)
slouken@433
  1693
    if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
slouken@433
  1694
        AC_MSG_CHECKING(for PicoGUI support)
slouken@433
  1695
        video_picogui=no
slouken@433
  1696
        AC_TRY_COMPILE([
slouken@433
  1697
         #include <picogui.h>
slouken@433
  1698
        ],[
slouken@433
  1699
        ],[
slouken@433
  1700
        video_picogui=yes
slouken@433
  1701
        ])
slouken@433
  1702
        AC_MSG_RESULT($video_picogui)
slouken@433
  1703
        if test x$video_picogui = xyes; then
slouken@433
  1704
	    SDL_LIBS="$SDL_LIBS -lpgui"
slouken@433
  1705
            CFLAGS="$CFLAGS -DENABLE_PICOGUI"
slouken@433
  1706
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui"
slouken@433
  1707
            VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la"
slouken@433
  1708
        fi
slouken@433
  1709
        AC_LANG_C
slouken@433
  1710
    fi
slouken@433
  1711
}
slouken@433
  1712
slouken@0
  1713
dnl Set up the Mac toolbox video driver for Mac OS 7-9
slouken@0
  1714
CheckTOOLBOX()
slouken@0
  1715
{
icculus@1133
  1716
    CFLAGS="$CFLAGS -DENABLE_TOOLBOX -DENABLE_DRAWSPROCKET"
slouken@0
  1717
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1718
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1719
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1720
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
icculus@1133
  1721
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
icculus@1133
  1722
    VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
slouken@0
  1723
}
slouken@0
  1724
icculus@1133
  1725
dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
slouken@0
  1726
CheckCARBON()
slouken@0
  1727
{
icculus@1133
  1728
    AC_ARG_ENABLE(video-carbon,
icculus@1133
  1729
[  --enable-video-carbon   use Carbon/QuickDraw video driver [default=no]],
icculus@1133
  1730
                  , enable_video_carbon=no)
icculus@1133
  1731
  if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
icculus@1133
  1732
    AC_MSG_CHECKING(for Carbon framework)
icculus@1133
  1733
    have_carbon=no
icculus@1133
  1734
    if test x$have_carbon != xyes; then
icculus@1133
  1735
        AC_TRY_COMPILE([
icculus@1133
  1736
          #include <Carbon/Carbon.h>
icculus@1133
  1737
        ],[
icculus@1133
  1738
        ],[
icculus@1133
  1739
        have_carbon=yes
icculus@1133
  1740
        ])
icculus@1133
  1741
    fi
icculus@1133
  1742
    AC_MSG_RESULT($have_carbon)
icculus@1133
  1743
    if test x$have_carbon = xyes; then
slouken@0
  1744
    # "MACOSX" is not an official definition, but it's commonly
slouken@0
  1745
    # accepted as a way to differentiate between what runs on X
slouken@0
  1746
    # and what runs on older Macs - while in theory "Carbon" defns
slouken@0
  1747
    # are consistent between the two, in practice Carbon is still
slouken@0
  1748
    # changing. -sts Aug 2000
slouken@0
  1749
    mac_autoconf_target_workaround="MAC"
slouken@0
  1750
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
slouken@0
  1751
      -fpascal-strings -DENABLE_TOOLBOX -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/maccommon -I\$(top_srcdir)/src/video/macrom -I\$(top_srcdir)/src/video/macdsp"
slouken@0
  1752
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1753
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1754
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1755
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
icculus@1133
  1756
    #VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
icculus@1133
  1757
    #VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
icculus@1133
  1758
    fi
icculus@1133
  1759
  fi
slouken@0
  1760
}
slouken@0
  1761
icculus@1133
  1762
dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
icculus@1133
  1763
CheckCOCOA()
slouken@158
  1764
{
icculus@1133
  1765
    AC_ARG_ENABLE(video-cocoa,
icculus@1133
  1766
[  --enable-video-cocoa    use Cocoa/Quartz video driver [default=yes]],
icculus@1133
  1767
                  , enable_video_cocoa=yes)
icculus@1133
  1768
  if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
icculus@1133
  1769
    old_CFLAGS="$CFLAGS"
icculus@1133
  1770
    dnl work around that we don't have Objective-C support in autoconf
icculus@1133
  1771
    CFLAGS="$CFLAGS -x objective-c"
icculus@1133
  1772
    AC_MSG_CHECKING(for Cocoa framework)
icculus@1133
  1773
    have_cocoa=no
icculus@1133
  1774
    if test x$have_cocoa != xyes; then
icculus@1133
  1775
        AC_TRY_COMPILE([
icculus@1133
  1776
          #import <Cocoa/Cocoa.h>
icculus@1133
  1777
        ],[
icculus@1133
  1778
        ],[
icculus@1133
  1779
        have_cocoa=yes
icculus@1133
  1780
        ])
icculus@1133
  1781
    fi
icculus@1133
  1782
    AC_MSG_RESULT($have_cocoa)
icculus@1133
  1783
    CFLAGS="$old_CFLAGS"
icculus@1133
  1784
    if test x$have_cocoa = xyes; then
slouken@158
  1785
    # "MACOSX" is not an official definition, but it's commonly
slouken@158
  1786
    # accepted as a way to differentiate between what runs on X
slouken@158
  1787
    # and what runs on older Macs - while in theory "Carbon" defns
slouken@158
  1788
    # are consistent between the two, in practice Carbon is still
slouken@158
  1789
    # changing. -sts Aug 2000
slouken@166
  1790
    mac_autoconf_target_workaround="MAC"
slouken@158
  1791
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
slouken@158
  1792
      -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
slouken@166
  1793
      -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
slouken@158
  1794
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
slouken@158
  1795
    VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
icculus@1133
  1796
    fi
icculus@1133
  1797
  fi
slouken@158
  1798
}
slouken@158
  1799
slouken@294
  1800
dnl Check for the dlfcn.h interface for dynamically loading objects
slouken@294
  1801
CheckDLOPEN()
slouken@294
  1802
{
slouken@731
  1803
    AC_ARG_ENABLE(sdl-dlopen,
slouken@731
  1804
[  --enable-sdl-dlopen     use dlopen for shared object loading [default=yes]],
slouken@731
  1805
                  , enable_sdl_dlopen=yes)
slouken@731
  1806
    if test x$enable_sdl_dlopen = xyes; then
slouken@294
  1807
        AC_MSG_CHECKING(for dlopen)
icculus@1173
  1808
        have_loadso=no
slouken@294
  1809
        AC_TRY_COMPILE([
slouken@294
  1810
         #include <dlfcn.h>
slouken@294
  1811
        ],[
slouken@294
  1812
        ],[
icculus@1173
  1813
        have_loadso=yes
slouken@294
  1814
        ])
icculus@1173
  1815
        AC_MSG_RESULT($have_loadso)
slouken@294
  1816
icculus@1173
  1817
        if test x$have_loadso = xyes; then
slouken@294
  1818
            CFLAGS="$CFLAGS -DUSE_DLOPEN"
slouken@753
  1819
            AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
slouken@753
  1820
               AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
slouken@753
  1821
                  AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")))
slouken@294
  1822
        fi
slouken@294
  1823
    fi
slouken@294
  1824
}
slouken@294
  1825
patmandin@651
  1826
dnl Set up the Atari LDG (shared object loader)
patmandin@651
  1827
CheckAtariLdg()
patmandin@651
  1828
{
patmandin@651
  1829
    AC_ARG_ENABLE(atari-ldg,
patmandin@651
  1830
[  --enable-atari-ldg      use Atari LDG for shared object loading [default=yes]],
patmandin@651
  1831
                  , enable_atari_ldg=yes)
patmandin@651
  1832
    if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
patmandin@651
  1833
        AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
patmandin@651
  1834
        AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
patmandin@651
  1835
        if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
icculus@1173
  1836
            have_loadso=yes
patmandin@651
  1837
            CFLAGS="$CFLAGS -DENABLE_LDG"
patmandin@824
  1838
            SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem"
patmandin@651
  1839
        fi
patmandin@651
  1840
    fi
patmandin@651
  1841
}
patmandin@651
  1842
slouken@381
  1843
dnl Check for the usbhid(3) library on *BSD
slouken@381
  1844
CheckUSBHID()
slouken@381
  1845
{
slouken@381
  1846
    if test x$enable_joystick = xyes; then
slouken@381
  1847
        have_libusbhid=no
slouken@381
  1848
        have_libusb=no
slouken@381
  1849
        AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
slouken@381
  1850
        AC_CHECK_LIB(usb, hid_init, have_libusb=yes)
slouken@381
  1851
        if test x$have_libusbhid = xyes; then
slouken@381
  1852
            SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
slouken@381
  1853
        fi
slouken@381
  1854
        if test x$have_libusb = xyes; then
slouken@381
  1855
            SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
slouken@381
  1856
        fi
slouken@381
  1857
slouken@403
  1858
        AC_CHECK_HEADER(usb.h, have_usb_h=yes)
slouken@381
  1859
        AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes)
slouken@381
  1860
        AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
slouken@381
  1861
        AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes)
slouken@403
  1862
        if test x$have_usb_h = xyes; then
slouken@403
  1863
            CFLAGS="$CFLAGS -DHAVE_USB_H"
slouken@403
  1864
        fi
slouken@381
  1865
        if test x$have_usbhid_h = xyes; then
slouken@381
  1866
            CFLAGS="$CFLAGS -DHAVE_USBHID_H"
slouken@381
  1867
        fi
slouken@381
  1868
        if test x$have_libusb_h = xyes; then
slouken@381
  1869
            CFLAGS="$CFLAGS -DHAVE_LIBUSB_H"
slouken@381
  1870
        fi
slouken@381
  1871
        if test x$have_libusbhid_h = xyes; then
slouken@381
  1872
            CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H"
slouken@381
  1873
        fi
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@381
  1882
          #include <dev/usb/usb.h>
slouken@381
  1883
          #include <dev/usb/usbhid.h>
slouken@381
  1884
          #if defined(HAVE_USBHID_H)
slouken@381
  1885
          #include <usbhid.h>
slouken@381
  1886
          #elif defined(HAVE_LIBUSB_H)
slouken@381
  1887
          #include <libusb.h>
slouken@381
  1888
          #elif defined(HAVE_LIBUSBHID_H)
slouken@381
  1889
          #include <libusbhid.h>
slouken@404
  1890
          #endif
slouken@381
  1891
        ],[
slouken@381
  1892
          struct report_desc *repdesc;
slouken@381
  1893
          struct usb_ctl_report *repbuf;
slouken@402
  1894
          hid_kind_t hidkind;
slouken@381
  1895
        ],[
slouken@381
  1896
        have_usbhid=yes
slouken@381
  1897
        ])
slouken@381
  1898
        AC_MSG_RESULT($have_usbhid)
slouken@381
  1899
slouken@381
  1900
        if test x$have_usbhid = xyes; then
slouken@381
  1901
            AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
slouken@381
  1902
            have_usbhid_ucr_data=no
slouken@381
  1903
            AC_TRY_COMPILE([
slouken@404
  1904
              #include <sys/types.h>
slouken@404
  1905
              #if defined(HAVE_USB_H)
slouken@404
  1906
              #include <usb.h>
slouken@404
  1907
              #endif
slouken@381
  1908
              #include <dev/usb/usb.h>
slouken@381
  1909
              #include <dev/usb/usbhid.h>
slouken@381
  1910
              #if defined(HAVE_USBHID_H)
slouken@381
  1911
              #include <usbhid.h>
slouken@381
  1912
              #elif defined(HAVE_LIBUSB_H)
slouken@381
  1913
              #include <libusb.h>
slouken@381
  1914
              #elif defined(HAVE_LIBUSBHID_H)
slouken@381
  1915
              #include <libusbhid.h>
slouken@381
  1916
              #endif
slouken@381
  1917
            ],[
slouken@381
  1918
              struct usb_ctl_report buf;
slouken@381
  1919
              if (buf.ucr_data) { }
slouken@381
  1920
            ],[
slouken@381
  1921
            have_usbhid_ucr_data=yes
slouken@381
  1922
            ])
slouken@381
  1923
            if test x$have_usbhid_ucr_data = xyes; then
slouken@381
  1924
                CFLAGS="$CFLAGS -DUSBHID_UCR_DATA"
slouken@381
  1925
            fi
slouken@381
  1926
            AC_MSG_RESULT($have_usbhid_ucr_data)
slouken@407
  1927
            
slouken@407
  1928
	    AC_MSG_CHECKING(for new usbhid API)
slouken@407
  1929
            have_usbhid_new=no
slouken@407
  1930
            AC_TRY_COMPILE([
slouken@407
  1931
              #include <sys/types.h>
slouken@407
  1932
              #if defined(HAVE_USB_H)
slouken@407
  1933
              #include <usb.h>
slouken@407
  1934
              #endif
slouken@407
  1935
              #include <dev/usb/usb.h>
slouken@407
  1936
              #include <dev/usb/usbhid.h>
slouken@407
  1937
              #if defined(HAVE_USBHID_H)
slouken@407
  1938
              #include <usbhid.h>
slouken@407
  1939
              #elif defined(HAVE_LIBUSB_H)
slouken@407
  1940
              #include <libusb.h>
slouken@407
  1941
              #elif defined(HAVE_LIBUSBHID_H)
slouken@407
  1942
              #include <libusbhid.h>
slouken@407
  1943
              #endif
slouken@407
  1944
            ],[
slouken@407
  1945
              report_desc_t d;
slouken@407
  1946
	      hid_start_parse(d, 1, 1);
slouken@407
  1947
            ],[
slouken@407
  1948
            have_usbhid_new=yes
slouken@407
  1949
            ])
slouken@407
  1950
            if test x$have_usbhid_new = xyes; then
slouken@407
  1951
                CFLAGS="$CFLAGS -DUSBHID_NEW"
slouken@407
  1952
            fi
slouken@407
  1953
            AC_MSG_RESULT($have_usbhid_new)
slouken@381
  1954
slouken@381
  1955
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@381
  1956
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@381
  1957
        fi
slouken@381
  1958
    fi
slouken@381
  1959
}
slouken@381
  1960
slouken@795
  1961
dnl Check for altivec instruction support using gas syntax
slouken@795
  1962
CheckAltivec()
slouken@795
  1963
{
icculus@1175
  1964
    have_altivec_h_hdr=no
icculus@1175
  1965
    AC_CHECK_HEADER(altivec.h, have_altivec_h_hdr=yes)
icculus@1162
  1966
icculus@1162
  1967
    save_CFLAGS="${CFLAGS}"
slouken@795
  1968
    have_gcc_altivec=no
icculus@1162
  1969
    AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
icculus@1162
  1970
    CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -maltivec"
icculus@1175
  1971
icculus@1175
  1972
    if test x$have_altivec_h_hdr = xyes; then
icculus@1175
  1973
      AC_TRY_COMPILE([
icculus@1175
  1974
      #include <altivec.h>
icculus@1175
  1975
      vector unsigned int vzero() {
icculus@1175
  1976
          return vec_splat_u32(0);
icculus@1175
  1977
      }
icculus@1175
  1978
      ],[
icculus@1175
  1979
      ],[
icculus@1175
  1980
      have_gcc_altivec=yes
icculus@1175
  1981
      ])
icculus@1175
  1982
      AC_MSG_RESULT($have_gcc_altivec)
icculus@1175
  1983
    else
icculus@1175
  1984
      AC_TRY_COMPILE([
icculus@1175
  1985
      vector unsigned int vzero() {
icculus@1175
  1986
          return vec_splat_u32(0);
icculus@1175
  1987
      }
icculus@1175
  1988
      ],[
icculus@1175
  1989
      ],[
icculus@1175
  1990
      have_gcc_altivec=yes
icculus@1175
  1991
      ])
icculus@1175
  1992
      AC_MSG_RESULT($have_gcc_altivec)
icculus@1175
  1993
    fi
icculus@1162
  1994
icculus@1162
  1995
    if test x$have_gcc_altivec = xno; then
icculus@1162
  1996
        AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
icculus@1175
  1997
        CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec"
icculus@1175
  1998
        if test x$have_altivec_h_hdr = xyes; then
icculus@1175
  1999
          AC_TRY_COMPILE([
icculus@1175
  2000
          #include <altivec.h>
icculus@1175
  2001
          vector unsigned int vzero() {
icculus@1175
  2002
              return vec_splat_u32(0);
icculus@1175
  2003
          }
icculus@1175
  2004
          ],[
icculus@1175
  2005
          ],[
icculus@1175
  2006
          have_gcc_altivec=yes
icculus@1175
  2007
          ])
icculus@1175
  2008
          AC_MSG_RESULT($have_gcc_altivec)
icculus@1175
  2009
        else
icculus@1175
  2010
          AC_TRY_COMPILE([
icculus@1175
  2011
          vector unsigned int vzero() {
icculus@1175
  2012
              return vec_splat_u32(0);
icculus@1175
  2013
          }
icculus@1175
  2014
          ],[
icculus@1175
  2015
          ],[
icculus@1175
  2016
          have_gcc_altivec=yes
icculus@1175
  2017
          ])
icculus@1175
  2018
          AC_MSG_RESULT($have_gcc_altivec)
icculus@1175
  2019
        fi
icculus@1162
  2020
    fi
icculus@1162
  2021
icculus@1047
  2022
    if test x$have_gcc_altivec = xno; then
icculus@1047
  2023
        CFLAGS="${save_CFLAGS}"
icculus@1175
  2024
    else
icculus@1175
  2025
        if test x$have_altivec_h_hdr = xyes; then
icculus@1175
  2026
          CFLAGS="${CFLAGS} -DHAVE_ALTIVEC_H"
icculus@1175
  2027
        fi
slouken@795
  2028
    fi
slouken@795
  2029
}
slouken@795
  2030
slouken@1062
  2031
dnl Check for a valid linux/version.h
slouken@1062
  2032
CheckLinuxVersion()
slouken@1062
  2033
{
slouken@1062
  2034
    AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
slouken@1062
  2035
    if test x$have_linux_version_h = xyes; then
slouken@1062
  2036
        CFLAGS="$CFLAGS -DHAVE_LINUX_VERSION_H"
slouken@1062
  2037
    fi
slouken@1062
  2038
}
slouken@1062
  2039
slouken@1127
  2040
dnl Check if we want to use RPATH
slouken@1127
  2041
CheckRPATH()
slouken@1127
  2042
{
slouken@1127
  2043
    AC_ARG_ENABLE(rpath,
slouken@1127
  2044
[  --enable-rpath          use an rpath when linking SDL [default=yes]],
slouken@1127
  2045
                  , enable_rpath=yes)
slouken@1127
  2046
}
slouken@1127
  2047
icculus@1173
  2048
have_loadso=no
slouken@0
  2049
case "$target" in
icculus@1140
  2050
    arm-*-elf*)
icculus@1140
  2051
	ARCH=linux
icculus@1140
  2052
	CheckDummyVideo
icculus@1140
  2053
	CheckIPod
icculus@1140
  2054
	# Set up files for the timer library
icculus@1140
  2055
        if test x$enable_timers = xyes; then
icculus@1140
  2056
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
icculus@1140
  2057
        fi
icculus@1140
  2058
	;;
slouken@719
  2059
    *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
slouken@719
  2060
        case "$target" in
slouken@795
  2061
          *-*-linux*) ARCH=linux ;;
slouken@795
  2062
          *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
slouken@795
  2063
          *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
slouken@795
  2064
          *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
slouken@795
  2065
          *-*-gnu*) ARCH=gnu ;; # must be last
slouken@795
  2066
        esac
slouken@1
  2067
        CheckDummyVideo
slouken@68
  2068
        CheckDiskAudio
slouken@371
  2069
        CheckDLOPEN
slouken@0
  2070
        CheckNASM
slouken@0
  2071
        CheckOSS
slouken@0
  2072
        CheckALSA
slouken@0
  2073
        CheckARTSC
slouken@0
  2074
        CheckESD
slouken@0
  2075
        CheckNAS
slouken@0
  2076
        CheckX11
slouken@30
  2077
        CheckNANOX
slouken@0
  2078
        CheckFBCON
slouken@167
  2079
        CheckDirectFB
slouken@70
  2080
        CheckPS2GS
slouken@0
  2081
        CheckGGI
slouken@0
  2082
        CheckSVGA
slouken@0
  2083
        CheckAAlib
slouken@371
  2084
        CheckQtopia
slouken@433
  2085
        CheckPicoGUI
icculus@1191
  2086
        CheckOpenGLX11
slouken@0
  2087
        CheckInputEvents
icculus@1201
  2088
        CheckTslib
slouken@0
  2089
        CheckPTHREAD
slouken@814
  2090
        CheckSIGACTION
slouken@795
  2091
        CheckAltivec
slouken@1062
  2092
        CheckLinuxVersion
slouken@1127
  2093
        CheckRPATH
slouken@1062
  2094
slouken@0
  2095
        # Set up files for the main() stub
slouken@371
  2096
        if test "x$video_qtopia" = "xyes"; then
slouken@371
  2097
          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@371
  2098
          SDL_LIBS="-lSDLmain $SDL_LIBS"
slouken@371
  2099
        fi
slouken@0
  2100
        # Set up files for the audio library
slouken@0
  2101
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  2102
        #if test x$enable_audio = xyes; then
slouken@148
  2103
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2104
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2105
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2106
        #fi
slouken@0
  2107
        # Set up files for the joystick library
slouken@0
  2108
        if test x$enable_joystick = xyes; then
slouken@719
  2109
	  case $ARCH in
slouken@719
  2110
	    linux)
slouken@719
  2111
              JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
slouken@719
  2112
              JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
slouken@719
  2113
	    ;;
slouken@719
  2114
	    gnu)
slouken@719
  2115
              JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@719
  2116
              JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@719
  2117
	    ;;
slouken@719
  2118
	    k*bsd-gnu)
slouken@719
  2119
              JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@719
  2120
              JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@719
  2121
	    ;;
slouken@719
  2122
	  esac
slouken@0
  2123
        fi
slouken@0
  2124
        # Set up files for the cdrom library
slouken@0
  2125
        if test x$enable_cdrom = xyes; then
slouken@719
  2126
	  case $ARCH in
slouken@719
  2127
	    linux)
slouken@719
  2128
              CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
slouken@719
  2129
              CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
slouken@719
  2130
	    ;;
slouken@719
  2131
	    gnu)
slouken@719
  2132
              CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@719
  2133
              CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@719
  2134
	    ;;
slouken@719
  2135
	    kfreebsd-gnu)
slouken@719
  2136
              CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
slouken@719
  2137
              CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
slouken@719
  2138
	    ;;
slouken@719
  2139
	    knetbsd-gnu|kopenbsd-gnu)
slouken@719
  2140
              CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@719
  2141
              CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@719
  2142
	    ;;
slouken@719
  2143
	  esac
slouken@0
  2144
        fi
slouken@0
  2145
        # Set up files for the thread library
slouken@0
  2146
        if test x$enable_threads = xyes; then
slouken@399
  2147
            CopyUnixThreadSource
slouken@0
  2148
        fi
slouken@0
  2149
        # Set up files for the timer library
slouken@0
  2150
        if test x$enable_timers = xyes; then
slouken@0
  2151
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2152
        fi
slouken@0
  2153
        ;;
slouken@0
  2154
    *-*-bsdi*)
slouken@0
  2155
        ARCH=bsdi
slouken@1
  2156
        CheckDummyVideo
slouken@68
  2157
        CheckDiskAudio
slouken@371
  2158
        CheckDLOPEN
slouken@0
  2159
        CheckNASM
slouken@0
  2160
        CheckOSS
slouken@35
  2161
        CheckARTSC
slouken@35
  2162
        CheckESD
slouken@0
  2163
        CheckNAS
slouken@0
  2164
        CheckX11
slouken@0
  2165
        CheckSVGA
slouken@0
  2166
        CheckAAlib
icculus@1191
  2167
        CheckOpenGLX11
slouken@0
  2168
        CheckPTHREAD
slouken@814
  2169
        CheckSIGACTION
slouken@1127
  2170
        CheckRPATH
slouken@148
  2171
        # Set up files for the audio library
slouken@148
  2172
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@148
  2173
        #if test x$enable_audio = xyes; then
slouken@148
  2174
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@148
  2175
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@148
  2176
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@148
  2177
        #fi
slouken@0
  2178
        # Set up files for the joystick library
slouken@0
  2179
        # (No joystick support yet)
slouken@0
  2180
        if test x$enable_joystick = xyes; then
slouken@0
  2181
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2182
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2183
        fi
slouken@0
  2184
        # Set up files for the cdrom library
slouken@0
  2185
        if test x$enable_cdrom = xyes; then
slouken@178
  2186
            CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
slouken@178
  2187
            CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
slouken@0
  2188
        fi
slouken@0
  2189
        # Set up files for the thread library
slouken@0
  2190
        if test x$enable_threads = xyes; then
slouken@399
  2191
            CopyUnixThreadSource
slouken@0
  2192
        fi
slouken@0
  2193
        # Set up files for the timer library
slouken@0
  2194
        if test x$enable_timers = xyes; then
slouken@0
  2195
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2196
        fi
slouken@0
  2197
        ;;
slouken@0
  2198
    *-*-freebsd*)
slouken@0
  2199
        ARCH=freebsd
slouken@1
  2200
        CheckDummyVideo
slouken@68
  2201
        CheckDiskAudio
slouken@371
  2202
        CheckDLOPEN
slouken@129
  2203
        CheckVGL
slouken@0
  2204
        CheckNASM
slouken@0
  2205
        CheckOSS
slouken@0
  2206
        CheckARTSC
slouken@0
  2207
        CheckESD
slouken@0
  2208
        CheckNAS
slouken@0
  2209
        CheckX11
slouken@0
  2210
        CheckSVGA
slouken@0
  2211
        CheckAAlib
icculus@1191
  2212
        CheckOpenGLX11
slouken@0
  2213
        CheckPTHREAD
slouken@814
  2214
        CheckSIGACTION
slouken@381
  2215
        CheckUSBHID
slouken@1127
  2216
        CheckRPATH
slouken@0
  2217
        # Set up files for the audio library
slouken@0
  2218
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  2219
        #if test x$enable_audio = xyes; then
slouken@148
  2220
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2221
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2222
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2223
        #fi
slouken@0
  2224
        # Set up files for the cdrom library
slouken@0
  2225
        if test x$enable_cdrom = xyes; then
slouken@153
  2226
            CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
slouken@153
  2227
            CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
slouken@0
  2228
        fi
slouken@0
  2229
        # Set up files for the thread library
slouken@0
  2230
        if test x$enable_threads = xyes; then
slouken@399
  2231
            CopyUnixThreadSource
slouken@0
  2232
        fi
slouken@0
  2233
        # Set up files for the timer library
slouken@0
  2234
        if test x$enable_timers = xyes; then
slouken@0
  2235
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2236
        fi
slouken@0
  2237
        ;;
slouken@0
  2238
    *-*-netbsd*)
slouken@0
  2239
        ARCH=netbsd
slouken@1
  2240
        CheckDummyVideo
slouken@68
  2241
        CheckDiskAudio
slouken@371
  2242
        CheckDLOPEN
slouken@0
  2243
        CheckNASM
slouken@0
  2244
        CheckOSS
slouken@0
  2245
        CheckARTSC
slouken@0
  2246
        CheckESD
slouken@0
  2247
        CheckNAS
slouken@0
  2248
        CheckX11
slouken@0
  2249
        CheckAAlib
icculus@1187
  2250
	CheckWscons
icculus@1191
  2251
        CheckOpenGLX11
slouken@0
  2252
        CheckPTHREAD
slouken@814
  2253
        CheckSIGACTION
slouken@381
  2254
        CheckUSBHID
slouken@1127
  2255
        CheckRPATH
slouken@0
  2256
        # Set up files for the audio library
slouken@0
  2257
        if test x$enable_audio = xyes; then
slouken@148
  2258
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2259
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2260
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2261
        fi
slouken@0
  2262
        # Set up files for the cdrom library
slouken@0
  2263
        if test x$enable_cdrom = xyes; then
slouken@153
  2264
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@153
  2265
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@0
  2266
        fi
slouken@0
  2267
        # Set up files for the thread library
slouken@0
  2268
        if test x$enable_threads = xyes; then
slouken@401
  2269
            if test x$use_pthreads = xyes; then
slouken@401
  2270
                CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1"
slouken@401
  2271
            fi
slouken@399
  2272
            CopyUnixThreadSource
slouken@0
  2273
        fi
slouken@0
  2274
        # Set up files for the timer library
slouken@0
  2275
        if test x$enable_timers = xyes; then
slouken@0
  2276
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2277
        fi
slouken@0
  2278
        # NetBSD does not define "unix"
slouken@401
  2279
        CFLAGS="$CFLAGS -Dunix"
slouken@0
  2280
        ;;
slouken@0
  2281
    *-*-openbsd*)
slouken@0
  2282
        ARCH=openbsd
slouken@1
  2283
        CheckDummyVideo
slouken@68
  2284
        CheckDiskAudio
slouken@371
  2285
        CheckDLOPEN
slouken@0
  2286
        CheckNASM
slouken@0
  2287
        CheckOSS
slouken@0
  2288
        CheckARTSC
slouken@0
  2289
        CheckESD
slouken@0
  2290
        CheckNAS
slouken@0
  2291
        CheckX11
slouken@0
  2292
        CheckAAlib
icculus@1191
  2293
        CheckOpenGLX11
slouken@0
  2294
        CheckPTHREAD
slouken@814
  2295
        CheckSIGACTION
slouken@381
  2296
        CheckUSBHID
slouken@1127
  2297
        CheckRPATH
slouken@0
  2298
        # Set up files for the audio library
slouken@360
  2299
        if test x$enable_audio = xyes; then
slouken@360
  2300
            CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
slouken@360
  2301
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
slouken@360
  2302
            AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
slouken@360
  2303
        fi
slouken@94
  2304
        # OpenBSD needs linking with ossaudio emulation library
slouken@94
  2305
        if test x$have_oss = xyes; then
slouken@94
  2306
            SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
slouken@94
  2307
        fi
slouken@0
  2308
        # Set up files for the cdrom library
slouken@0
  2309
        if test x$enable_cdrom = xyes; then
slouken@153
  2310
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@153
  2311
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@0
  2312
        fi
slouken@0
  2313
        # Set up files for the thread library
slouken@0
  2314
        if test x$enable_threads = xyes; then
slouken@399
  2315
            CopyUnixThreadSource
slouken@0
  2316
        fi
slouken@0
  2317
        # Set up files for the timer library
slouken@0
  2318
        if test x$enable_timers = xyes; then
slouken@0
  2319
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2320
        fi
slouken@37
  2321
        # OpenBSD does not define "unix"
slouken@37
  2322
        CFLAGS="$CFLAGS -Dunix"
slouken@0
  2323
        ;;
slouken@0
  2324
    *-*-sysv5*)
slouken@0
  2325
        ARCH=sysv5
slouken@1
  2326
        CheckDummyVideo
slouken@68
  2327
        CheckDiskAudio
slouken@371
  2328
        CheckDLOPEN
slouken@0
  2329
        CheckNASM
slouken@0
  2330
        CheckOSS
slouken@0
  2331
        CheckARTSC
slouken@0
  2332
        CheckESD
slouken@0
  2333
        CheckNAS
slouken@0
  2334
        CheckX11
slouken@0
  2335
        CheckAAlib
icculus@1191
  2336
        CheckOpenGLX11
slouken@0
  2337
        CheckPTHREAD
slouken@814
  2338
        CheckSIGACTION
slouken@1127
  2339
        CheckRPATH
slouken@0
  2340
        # Set up files for the audio library
slouken@0
  2341
        if test x$enable_audio = xyes; then
slouken@148
  2342
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2343
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2344
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2345
        fi
slouken@0
  2346
        # Set up files for the joystick library
slouken@0
  2347
        # (No joystick support yet)
slouken@0
  2348
        if test x$enable_joystick = xyes; then
slouken@0
  2349
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2350
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2351
        fi
slouken@0
  2352
        # Set up files for the cdrom library
slouken@0
  2353
        if test x$enable_cdrom = xyes; then
slouken@153
  2354
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  2355
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  2356
        fi
slouken@0
  2357
        # Set up files for the thread library
slouken@0
  2358
        if test x$enable_threads = xyes; then
slouken@399
  2359
            CopyUnixThreadSource
slouken@0
  2360
        fi
slouken@0
  2361
        # Set up files for the timer library
slouken@0
  2362
        if test x$enable_timers = xyes; then
slouken@0
  2363
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2364
        fi
slouken@0
  2365
        ;;
slouken@0
  2366
    *-*-solaris*)
slouken@0
  2367
        ARCH=solaris
slouken@1
  2368
        CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
slouken@1
  2369
        CheckDummyVideo
slouken@68
  2370
        CheckDiskAudio
slouken@371
  2371
        CheckDLOPEN
slouken@0
  2372
        CheckNASM
slouken@35
  2373
        CheckOSS
slouken@0
  2374
        CheckARTSC
slouken@0
  2375
        CheckESD
slouken@0
  2376
        CheckNAS
slouken@0
  2377
        CheckX11
slouken@0
  2378
        CheckAAlib
icculus@1191
  2379
        CheckOpenGLX11
slouken@0
  2380
        CheckPTHREAD
slouken@814
  2381
        CheckSIGACTION
slouken@1127
  2382
        CheckRPATH
slouken@0
  2383
        # Set up files for the audio library
slouken@0
  2384
        if test x$enable_audio = xyes; then
slouken@148
  2385
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2386
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2387
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2388
        fi
slouken@0
  2389
        # Set up files for the joystick library
slouken@0
  2390
        # (No joystick support yet)
slouken@0
  2391
        if test x$enable_joystick = xyes; then
slouken@0
  2392
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2393
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
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@153
  2397
            CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
slouken@153
  2398
            CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
slouken@0
  2399
        fi
slouken@0
  2400
        # Set up files for the thread library
slouken@0
  2401
        if test x$enable_threads = xyes; then
slouken@399
  2402
            CopyUnixThreadSource
slouken@0
  2403
        fi
slouken@0
  2404
        # Set up files for the timer library
slouken@0
  2405
        if test x$enable_timers = xyes; then
slouken@0
  2406
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2407
        fi
slouken@0
  2408
        ;;
slouken@0
  2409
    *-*-irix*)
slouken@0
  2410
        ARCH=irix
slouken@1
  2411
        CheckDummyVideo
slouken@68
  2412
        CheckDiskAudio
slouken@371
  2413
        CheckDLOPEN
slouken@148
  2414
        CheckDMEDIA
slouken@148
  2415
        CheckESD
slouken@0
  2416
        CheckNAS
slouken@0
  2417
        CheckX11
slouken@0
  2418
        CheckAAlib
icculus@1191
  2419
        CheckOpenGLX11
slouken@0
  2420
        CheckPTHREAD
slouken@814
  2421
        CheckSIGACTION
slouken@148
  2422
        # We use the dmedia audio API, not the Sun audio API
slouken@148
  2423
        #if test x$enable_audio = xyes; then
slouken@148
  2424
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@148
  2425
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@148
  2426
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@148
  2427
        #fi
slouken@0
  2428
        # Set up files for the joystick library
slouken@0
  2429
        # (No joystick support yet)
slouken@0
  2430
        if test x$enable_joystick = xyes; then
slouken@0
  2431
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2432
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2433
        fi
slouken@0
  2434
        # Set up files for the cdrom library
slouken@0
  2435
        # (No CD-ROM support yet)
slouken@0
  2436
        if test x$enable_cdrom = xyes; then
slouken@153
  2437
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  2438
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  2439
        fi
slouken@0
  2440
        # Set up files for the thread library
slouken@0
  2441
        if test x$enable_threads = xyes; then
slouken@399
  2442
            if test x$use_pthreads = xyes -o x$use_pth = xyes; then
slouken@399
  2443
                CopyUnixThreadSource
slouken@0
  2444
            else
slouken@0
  2445
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
slouken@0
  2446
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
slouken@0
  2447
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  2448
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  2449
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  2450
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2451
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2452
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2453
            fi
slouken@0
  2454
        fi
slouken@0
  2455
        # Set up files for the timer library
slouken@0
  2456
        if test x$enable_timers = xyes; then
slouken@0
  2457
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2458
        fi
slouken@0
  2459
        ;;
slouken@0
  2460
    *-*-hpux*)
slouken@0
  2461
        ARCH=hpux
slouken@1
  2462
        CheckDummyVideo
slouken@68
  2463
        CheckDiskAudio
slouken@371
  2464
        CheckDLOPEN
slouken@35
  2465
        CheckOSS
slouken@0
  2466
        CheckNAS
slouken@0
  2467
        CheckX11
slouken@0
  2468
        CheckGGI
slouken@0
  2469
        CheckAAlib
icculus@1191
  2470
        CheckOpenGLX11
slouken@0
  2471
        CheckPTHREAD
slouken@814
  2472
        CheckSIGACTION
slouken@0
  2473
        # Set up files for the audio library
slouken@0
  2474
        if test x$enable_audio = xyes; then
slouken@148
  2475
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2476
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2477
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2478
        fi
slouken@0
  2479
        # Set up files for the joystick library
slouken@0
  2480
        # (No joystick support yet)
slouken@0
  2481
        if test x$enable_joystick = xyes; then
slouken@0
  2482
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2483
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2484
        fi
slouken@0
  2485
        # Set up files for the cdrom library
slouken@0
  2486
        # (No CD-ROM support yet)
slouken@0
  2487
        if test x$enable_cdrom = xyes; then
slouken@153
  2488
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  2489
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  2490
        fi
slouken@0
  2491
        # Set up files for the thread library
slouken@0
  2492
        if test x$enable_threads = xyes; then
slouken@399
  2493
            CopyUnixThreadSource
slouken@0
  2494
        fi
slouken@0
  2495
        # Set up files for the timer library
slouken@0
  2496
        if test x$enable_timers = xyes; then
slouken@0
  2497
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2498
        fi
slouken@0
  2499
        ;;
slouken@0
  2500
    *-*-aix*)
slouken@0
  2501
        ARCH=aix
slouken@1
  2502
        CheckDummyVideo
slouken@68
  2503
        CheckDiskAudio
slouken@371
  2504
        CheckDLOPEN
slouken@35
  2505
        CheckOSS
slouken@0
  2506
        CheckNAS
slouken@0
  2507
        CheckX11
slouken@0
  2508
        CheckGGI
slouken@0
  2509
        CheckAAlib
icculus@1191
  2510
        CheckOpenGLX11
slouken@0
  2511
        CheckPTHREAD
slouken@814
  2512
        CheckSIGACTION
slouken@0
  2513
        # Set up files for the audio library
slouken@0
  2514
        if test x$enable_audio = xyes; then
slouken@0
  2515
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
slouken@0
  2516
            AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
slouken@0
  2517
        fi
slouken@0
  2518
        # Set up files for the joystick library
slouken@0
  2519
        # (No joystick support yet)
slouken@0
  2520
        if test x$enable_joystick = xyes; then
slouken@0
  2521
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2522
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2523
        fi
slouken@0
  2524
        # Set up files for the cdrom library
slouken@0
  2525
        if test x$enable_cdrom = xyes; then
slouken@153
  2526
            CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
slouken@153
  2527
            CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
slouken@0
  2528
        fi
slouken@0
  2529
        # Set up files for the thread library
slouken@0
  2530
        if test x$enable_threads = xyes; then
slouken@399
  2531
            CopyUnixThreadSource
slouken@0
  2532
        fi
slouken@0
  2533
        # Set up files for the timer library
slouken@0
  2534
        if test x$enable_timers = xyes; then
slouken@0
  2535
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2536
        fi
slouken@0
  2537
        ;;
slouken@0
  2538
    *-*-osf*)
slouken@0
  2539
        ARCH=osf
slouken@1
  2540
        CheckDummyVideo
slouken@68
  2541
        CheckDiskAudio
slouken@371
  2542
        CheckDLOPEN
slouken@0
  2543
        CheckNAS
slouken@0
  2544
        CheckX11
slouken@0
  2545
        CheckGGI
slouken@0
  2546
        CheckAAlib
icculus@1191
  2547
        CheckOpenGLX11
slouken@0
  2548
        CheckPTHREAD
slouken@814
  2549
        CheckSIGACTION
slouken@0
  2550
        # Set up files for the audio library
slouken@0
  2551
        if test x$enable_audio = xyes; then
slouken@654
  2552
            CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT"
slouken@654
  2553
            SYSTEM_LIBS="$SYSTEM_LIBS -lmme"
slouken@654
  2554
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS mme"
slouken@654
  2555
            AUDIO_DRIVERS="$AUDIO_DRIVERS mme/libaudio_mme.la"
slouken@0
  2556
        fi
slouken@0
  2557
        # Set up files for the joystick library
slouken@0
  2558
        # (No joystick support yet)
slouken@0
  2559
        if test x$enable_joystick = xyes; then
slouken@0
  2560
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2561
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2562
        fi
slouken@0
  2563
        # Set up files for the cdrom library
slouken@0
  2564
        # (No cdrom support yet)
slouken@0
  2565
        if test x$enable_cdrom = xyes; then
slouken@654
  2566
            CDROM_SUBDIRS="$CDROM_SUBDIRS osf"
slouken@654
  2567
            CDROM_DRIVERS="$CDROM_DRIVERS osf/libcdrom_osf.la"
slouken@0
  2568
        fi
slouken@0
  2569
        # Set up files for the thread library
slouken@0
  2570
        if test x$enable_threads = xyes; then
slouken@399
  2571
            CopyUnixThreadSource
slouken@0
  2572
        fi
slouken@0
  2573
        # Set up files for the timer library
slouken@0
  2574
        if test x$enable_timers = xyes; then
slouken@0
  2575
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2576
        fi
icculus@1299
  2577
        # FIXME: If building without -lX11, you get the following messages.
icculus@1299
  2578
        # Xlib: connection to ":0.0" refused by server
icculus@1299
  2579
        # Xlib: XDM authorization key matches an existing client!
icculus@1299
  2580
        # It only has to run xhost +localhost in a such case.
icculus@1299
  2581
        #if test x$enable_x11_shared = xyes; then
icculus@1299
  2582
        #    SYSTEM_LIBS="$SYSTEM_LIBS -lX11"
icculus@1299
  2583
        #fi
slouken@0
  2584
        ;;
slouken@0
  2585
    *-*-qnx*)
slouken@0
  2586
        ARCH=qnx
slouken@1
  2587
        CheckDummyVideo
slouken@68
  2588
        CheckDiskAudio
slouken@886
  2589
        # CheckNASM
slouken@371
  2590
        CheckDLOPEN
slouken@0
  2591
        CheckNAS
slouken@0
  2592
        CheckPHOTON
slouken@0
  2593
        CheckX11
icculus@1191
  2594
        CheckOpenGLX11
slouken@0
  2595
        CheckPTHREAD
slouken@814
  2596
        CheckSIGACTION
slouken@0
  2597
        # Set up files for the audio library
slouken@0
  2598
        if test x$enable_audio = xyes; then
slouken@666
  2599
            CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT"
slouken@0
  2600
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
slouken@0
  2601
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
slouken@0
  2602
            AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
slouken@0
  2603
        fi
slouken@0
  2604
        # Set up files for the joystick library
slouken@0
  2605
        if test x$enable_joystick = xyes; then
slouken@0
  2606
        # (No joystick support yet)
slouken@0
  2607
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2608
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2609
        fi
slouken@0
  2610
        # Set up files for the cdrom library
slouken@0
  2611
        if test x$enable_cdrom = xyes; then
slouken@153
  2612
            CDROM_SUBDIRS="$CDROM_SUBDIRS qnx"
slouken@153
  2613
            CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la"
slouken@0
  2614
        fi
slouken@0
  2615
        # Set up files for the thread library
slouken@0
  2616
        if test x$enable_threads = xyes; then
slouken@399
  2617
            CopyUnixThreadSource
slouken@0
  2618
        fi
slouken@0
  2619
        # Set up files for the timer library
slouken@0
  2620
        if test x$enable_timers = xyes; then
slouken@0
  2621
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2622
        fi
slouken@0
  2623
        ;;
slouken@0
  2624
    *-*-cygwin* | *-*-mingw32*)
slouken@0
  2625
        ARCH=win32
icculus@1173
  2626
        have_loadso=yes
slouken@0
  2627
        if test "$build" != "$target"; then # cross-compiling
slouken@0
  2628
            # Default cross-compile location
slouken@0
  2629
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
slouken@0
  2630
        else
slouken@0
  2631
            # Look for the location of the tools and install there
slouken@750
  2632
            if test "$BUILD_PREFIX" != ""; then
slouken@1
  2633
                ac_default_prefix=$BUILD_PREFIX
slouken@1
  2634
            fi
slouken@0
  2635
        fi
slouken@1
  2636
        CheckDummyVideo
slouken@68
  2637
        CheckDiskAudio
slouken@0
  2638
        CheckWIN32
slouken@0
  2639
        CheckDIRECTX
slouken@0
  2640
        CheckNASM
slouken@0
  2641
        # Set up files for the audio library
slouken@0
  2642
        if test x$enable_audio = xyes; then
slouken@0
  2643
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
slouken@0
  2644
            AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
slouken@0
  2645
            if test x$use_directx = xyes; then
slouken@41
  2646
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
slouken@41
  2647
                AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
slouken@0
  2648
            fi
slouken@0
  2649
        fi
slouken@0
  2650
        # Set up files for the joystick library
slouken@0
  2651
        if test x$enable_joystick = xyes; then
slouken@0
  2652
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
slouken@0
  2653
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
slouken@0
  2654
        fi
slouken@0
  2655
        # Set up files for the cdrom library
slouken@0
  2656
        if test x$enable_cdrom = xyes; then
slouken@153
  2657
            CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
slouken@153
  2658
            CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
slouken@0
  2659
        fi
slouken@0
  2660
        # Set up files for the thread library
slouken@0
  2661
        if test x$enable_threads = xyes; then
slouken@0
  2662
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
slouken@0
  2663
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
slouken@0
  2664
            COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
slouken@0
  2665
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2666
            COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
slouken@0
  2667
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2668
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2669
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2670
        fi
slouken@0
  2671
        # Set up files for the timer library
slouken@0
  2672
        if test x$enable_timers = xyes; then
slouken@0
  2673
            COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
slouken@0
  2674
        fi
slouken@0
  2675
        # The Win32 platform requires special setup
slouken@0
  2676
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@1
  2677
        case "$target" in
slouken@1
  2678
            *-*-cygwin*)
slouken@263
  2679
                CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
slouken@263
  2680
                SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
slouken@1
  2681
                LIBS="$LIBS -mno-cygwin"
slouken@1
  2682
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
slouken@1
  2683
                ;;
slouken@1
  2684
            *-*-mingw32*)
slouken@1
  2685
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
slouken@1
  2686
                ;;
slouken@1
  2687
        esac
slouken@0
  2688
        ;;
slouken@0
  2689
    *-*-beos*)
slouken@0
  2690
        ARCH=beos
slouken@0
  2691
        ac_default_prefix=/boot/develop/tools/gnupro
icculus@1173
  2692
        have_loadso=yes
slouken@1
  2693
        CheckDummyVideo
slouken@68
  2694
        CheckDiskAudio
slouken@0
  2695
        CheckNASM
slouken@0
  2696
        CheckBWINDOW
slouken@0
  2697
        CheckBeGL
slouken@0
  2698
        # Set up files for the audio library
slouken@0
  2699
        if test x$enable_audio = xyes; then
slouken@0
  2700
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
slouken@0
  2701
            AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
slouken@0
  2702
        fi
slouken@0
  2703
        # Set up files for the joystick library
slouken@0
  2704
        if test x$enable_joystick = xyes; then
slouken@0
  2705
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
slouken@0
  2706
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
slouken@0
  2707
        fi
slouken@0
  2708
        # Set up files for the cdrom library
slouken@0
  2709
        if test x$enable_cdrom = xyes; then
slouken@153
  2710
            CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
slouken@153
  2711
            CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
slouken@0
  2712
        fi
slouken@0
  2713
        # Set up files for the thread library
slouken@0
  2714
        if test x$enable_threads = xyes; then
slouken@0
  2715
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
slouken@0
  2716
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
slouken@0
  2717
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  2718
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2719
            COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
slouken@0
  2720
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2721
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2722
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2723
        fi
slouken@0
  2724
        # Set up files for the timer library
slouken@0
  2725
        if test x$enable_timers = xyes; then
slouken@0
  2726
            COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
slouken@0
  2727
        fi
slouken@0
  2728
        # The BeOS platform requires special libraries
slouken@0
  2729
        SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
slouken@0
  2730
        ;;
slouken@0
  2731
    *-*-macos*)
slouken@0
  2732
        # This would be used if cross-compiling to MacOS 9.  No way to
slouken@0
  2733
        # use it at present, but Apple is working on a X-to-9 compiler
slouken@0
  2734
        # for which this case would be handy.
slouken@0
  2735
        ARCH=macos
icculus@1173
  2736
        have_loadso=yes
slouken@1
  2737
        CheckDummyVideo
slouken@68
  2738
        CheckDiskAudio
slouken@0
  2739
        CheckTOOLBOX
slouken@0
  2740
        CheckMacGL
slouken@0
  2741
        # Set up files for the audio library
slouken@0
  2742
        if test x$enable_audio = xyes; then
slouken@0
  2743
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  2744
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
slouken@0
  2745
        fi
slouken@0
  2746
        # Set up files for the joystick library
slouken@0
  2747
        if test x$enable_joystick = xyes; then
slouken@0
  2748
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
slouken@0
  2749
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
slouken@0
  2750
        fi
slouken@0
  2751
        # Set up files for the cdrom library
slouken@0
  2752
        if test x$enable_cdrom = xyes; then
slouken@153
  2753
            CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
slouken@153
  2754
            CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
slouken@0
  2755
        fi
slouken@0
  2756
        # Set up files for the thread library
slouken@0
  2757
        if test x$enable_threads = xyes; then
slouken@0
  2758
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
slouken@0
  2759
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
slouken@0
  2760
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  2761
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2762
            COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
slouken@0
  2763
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2764
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2765
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2766
        fi
slouken@0
  2767
        # Set up files for the timer library
slouken@0
  2768
        if test x$enable_timers = xyes; then
slouken@0
  2769
            COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
slouken@0
  2770
        fi
slouken@0
  2771
        # The MacOS platform requires special setup
slouken@0
  2772
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@0
  2773
        SDL_LIBS="-lSDLmain $SDL_LIBS"
slouken@0
  2774
        ;;
slouken@0
  2775
    *-*-darwin* )
icculus@1133
  2776
        # This could be either full "Mac OS X", or plain "Darwin" which is
slouken@158
  2777
        # just the OS X kernel sans upper layers like Carbon and Cocoa.
icculus@1133
  2778
        # Next line is broken, and a few files below require Mac OS X (full)
slouken@158
  2779
        ARCH=macosx
icculus@1173
  2780
        have_loadso=yes
slouken@1
  2781
        CheckDummyVideo
slouken@68
  2782
        CheckDiskAudio
icculus@1133
  2783
        CheckCOCOA
icculus@1133
  2784
        CheckCARBON
icculus@1174
  2785
        CheckX11
slouken@0
  2786
        CheckMacGL
icculus@1191
  2787
        CheckOpenGLX11
slouken@0
  2788
        CheckPTHREAD
slouken@814
  2789
        CheckSIGACTION
icculus@1047
  2790
        CheckAltivec
slouken@935
  2791
        # If either the audio or CD driver is used, add the AudioUnit framework
slouken@935
  2792
        if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
slouken@935
  2793
            SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit"
slouken@935
  2794
        fi
slouken@0
  2795
        # Set up files for the audio library
slouken@0
  2796
        if test x$enable_audio = xyes; then
slouken@936
  2797
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macosx"
slouken@936
  2798
            AUDIO_DRIVERS="$AUDIO_DRIVERS macosx/libaudio_macosx.la"
slouken@0
  2799
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  2800
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
slouken@0
  2801
        fi
slouken@0
  2802
        # Set up files for the joystick library
slouken@0
  2803
        if test x$enable_joystick = xyes; then
slouken@172
  2804
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
slouken@172
  2805
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
slouken@387
  2806
            SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit"
slouken@0
  2807
        fi
slouken@0
  2808
        # Set up files for the cdrom library
slouken@0
  2809
        if test x$enable_cdrom = xyes; then
slouken@768
  2810
            CDROM_SUBDIRS="$CDROM_SUBDIRS macosx"
slouken@768
  2811
            CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la"
slouken@0
  2812
        fi
slouken@0
  2813
        # Set up files for the thread library
slouken@0
  2814
        if test x$enable_threads = xyes; then
slouken@399
  2815
            CopyUnixThreadSource
slouken@0
  2816
        fi
slouken@0
  2817
        # Set up files for the timer library
slouken@0
  2818
        if test x$enable_timers = xyes; then
slouken@0
  2819
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2820
        fi
slouken@387
  2821
        # The MacOS X platform requires special setup.
slouken@387
  2822
        SDL_LIBS="-lSDLmain $SDL_LIBS"
icculus@1133
  2823
        if test x$enable_video_cocoa = xyes; then
icculus@1133
  2824
            SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa"
icculus@1133
  2825
        fi
icculus@1133
  2826
        if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
icculus@1133
  2827
            # The Cocoa backend still needs Carbon, an