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