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