configure.in
author Ryan C. Gordon <icculus@icculus.org>
Tue, 08 Nov 2005 01:34:28 +0000
changeset 1170 bb1a52a8d3d6
parent 1168 045f186426e1
child 1173 e9cf8c1b4590
permissions -rw-r--r--
Use the right libs in dynamic X11 loading.
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@1024
    17
SDL_MICRO_VERSION=9
slouken@1024
    18
SDL_INTERFACE_AGE=2
slouken@1024
    19
SDL_BINARY_AGE=9
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
slouken@865
   307
            if test x$use_dlopen != xyes && \
slouken@865
   308
               test x$enable_alsa_shared = xyes; then
slouken@865
   309
                AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
slouken@865
   310
            fi
slouken@865
   311
            if test x$use_dlopen = 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"
slouken@731
   370
            if test x$use_dlopen != xyes && \
slouken@296
   371
               test x$enable_esd_shared = xyes; then
slouken@296
   372
                AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
slouken@296
   373
            fi
slouken@731
   374
            if test x$use_dlopen = 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"
slouken@731
   421
                if test x$use_dlopen != xyes && \
slouken@296
   422
                   test x$enable_arts_shared = xyes; then
slouken@296
   423
                    AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
slouken@296
   424
                fi
slouken@731
   425
                if test x$use_dlopen = 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@1168
   617
            x11_lib='libX11.so.6'
icculus@1170
   618
            x11ext_lib='libXext.so.6'
icculus@1168
   619
icculus@1168
   620
            if test x$use_dlopen != xyes && \
icculus@1168
   621
               test x$enable_x11_shared = xyes; then
icculus@1168
   622
                AC_MSG_ERROR([You must have dlopen() support and use the --enable-dlopen option])
icculus@1168
   623
            fi
icculus@1168
   624
icculus@1168
   625
            if test x$use_dlopen = xyes && \
icculus@1170
   626
               test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
icculus@1168
   627
                CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -DX11_DYNAMIC=\$(x11_lib) -DX11EXT_DYNAMIC=\$(x11ext_lib) -I$srcdir/include -I$srcdir/src/video"
icculus@1168
   628
                SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS"
icculus@1168
   629
                AC_SUBST(x11_lib)
icculus@1168
   630
                AC_SUBST(x11ext_lib)
icculus@1168
   631
            else
icculus@1168
   632
                CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
icculus@1168
   633
                SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
icculus@1168
   634
            fi
icculus@1168
   635
slouken@0
   636
            if test x$ac_cv_func_shmat != xyes; then
slouken@0
   637
                CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
slouken@0
   638
            fi
icculus@1168
   639
slouken@0
   640
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
slouken@0
   641
            VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
slouken@0
   642
slouken@0
   643
            AC_ARG_ENABLE(video-x11-vm,
slouken@0
   644
[  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]],
slouken@0
   645
                          , enable_video_x11_vm=yes)
slouken@0
   646
            if test x$enable_video_x11_vm = xyes; then
slouken@0
   647
                AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
slouken@0
   648
                video_x11_vm=no
slouken@0
   649
                AC_TRY_COMPILE([
slouken@0
   650
                 #include <X11/Xlib.h>
slouken@292
   651
                 #include <XFree86/extensions/xf86vmode.h>
slouken@0
   652
                ],[
slouken@0
   653
                ],[
slouken@0
   654
                video_x11_vm=yes
slouken@0
   655
                ])
slouken@0
   656
                AC_MSG_RESULT($video_x11_vm)
slouken@0
   657
                if test x$video_x11_vm = xyes; then
slouken@0
   658
                    CFLAGS="$CFLAGS -DXFREE86_VM"
slouken@292
   659
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
slouken@292
   660
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
slouken@0
   661
                    AC_MSG_CHECKING(for XFree86 VidMode gamma support)
slouken@0
   662
                    video_x11_vmgamma=no
slouken@0
   663
                    AC_TRY_COMPILE([
slouken@0
   664
                     #include <X11/Xlib.h>
slouken@292
   665
                     #include <XFree86/extensions/xf86vmode.h>
slouken@0
   666
                    ],[
slouken@292
   667
                     SDL_NAME(XF86VidModeGamma) gamma;
slouken@0
   668
                    ],[
slouken@0
   669
                    video_x11_vmgamma=yes
slouken@0
   670
                    ])
slouken@0
   671
                    AC_MSG_RESULT($video_x11_vmgamma)
slouken@0
   672
                    if test x$video_x11_vmgamma = xyes; then
slouken@0
   673
                        CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
slouken@0
   674
                    fi
slouken@0
   675
                fi
slouken@0
   676
            fi
slouken@16
   677
            AC_ARG_ENABLE(dga,
slouken@16
   678
[  --enable-dga            allow use of X11 DGA code [default=yes]],
slouken@16
   679
                          , enable_dga=yes)
slouken@0
   680
            AC_ARG_ENABLE(video-x11-dgamouse,
slouken@0
   681
[  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]],
slouken@0
   682
                          , enable_video_x11_dgamouse=yes)
slouken@16
   683
            if test x$enable_dga = xyes; then
slouken@16
   684
                AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
slouken@16
   685
                video_x11_dga=no
slouken@16
   686
                AC_TRY_COMPILE([
slouken@16
   687
                 #include <X11/Xlib.h>
slouken@292
   688
                 #include <XFree86/extensions/xf86dga.h>
slouken@16
   689
                ],[
slouken@16
   690
                ],[
slouken@16
   691
                video_x11_dga=yes
slouken@16
   692
                ])
slouken@16
   693
                AC_MSG_RESULT($video_x11_dga)
slouken@16
   694
                if test x$video_x11_dga = xyes; then
slouken@16
   695
                    CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
slouken@16
   696
                    if test x$enable_video_x11_dgamouse = xyes; then
slouken@16
   697
                        CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
slouken@16
   698
                    fi
slouken@292
   699
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
slouken@292
   700
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
slouken@0
   701
                fi
slouken@0
   702
            fi
slouken@0
   703
            AC_ARG_ENABLE(video-x11-xv,
slouken@0
   704
[  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]],
slouken@0
   705
                          , enable_video_x11_xv=yes)
slouken@0
   706
            if test x$enable_video_x11_xv = xyes; then
slouken@0
   707
                AC_MSG_CHECKING(for XFree86 XvImage support)
slouken@0
   708
                video_x11_xv=no
slouken@0
   709
                AC_TRY_COMPILE([
slouken@0
   710
                 #include <X11/Xlib.h>
slouken@0
   711
                 #include <sys/ipc.h>
slouken@0
   712
                 #include <sys/shm.h>
slouken@0
   713
                 #include <X11/extensions/XShm.h>
slouken@292
   714
                 #include <XFree86/extensions/Xvlib.h>
slouken@0
   715
                ],[
slouken@292
   716
                 SDL_NAME(XvImage) *image;
slouken@0
   717
                ],[
slouken@0
   718
                video_x11_xv=yes
slouken@0
   719
                ])
slouken@0
   720
                AC_MSG_RESULT($video_x11_xv)
slouken@0
   721
                if test x$video_x11_xv = xyes; then
slouken@0
   722
                    CFLAGS="$CFLAGS -DXFREE86_XV"
slouken@292
   723
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
slouken@292
   724
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
slouken@0
   725
                fi
slouken@0
   726
            fi
slouken@227
   727
            AC_ARG_ENABLE(video-x11-xinerama,
slouken@227
   728
[  --enable-video-x11-xinerama   enable X11 Xinerama support [default=yes]],
slouken@227
   729
                            , enable_video_x11_xinerama=yes)
slouken@227
   730
            if test x$enable_video_x11_xinerama = xyes; then
slouken@227
   731
                AC_MSG_CHECKING(for X11 Xinerama support)
slouken@227
   732
                video_x11_xinerama=no
slouken@227
   733
                AC_TRY_COMPILE([
slouken@227
   734
                 #include <X11/Xlib.h>
slouken@292
   735
                 #include <XFree86/extensions/Xinerama.h>
slouken@227
   736
                ],[
slouken@292
   737
                 SDL_NAME(XineramaScreenInfo) *xinerama;
slouken@227
   738
                ],[
slouken@227
   739
                video_x11_xinerama=yes
slouken@227
   740
                ])
slouken@227
   741
                AC_MSG_RESULT($video_x11_xinerama)
slouken@227
   742
                if test x$video_x11_xinerama = xyes; then
slouken@227
   743
                    CFLAGS="$CFLAGS -DHAVE_XINERAMA"
slouken@292
   744
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
slouken@292
   745
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
slouken@227
   746
                fi
slouken@227
   747
            fi
slouken@242
   748
            AC_ARG_ENABLE(video-x11-xme,
slouken@242
   749
[  --enable-video-x11-xme  enable Xi Graphics XME for fullscreen [default=yes]],
slouken@242
   750
                            , enable_video_x11_xme=yes)
slouken@242
   751
            if test x$enable_video_x11_xme = xyes; then
slouken@242
   752
                AC_MSG_CHECKING(for Xi Graphics XiGMiscExtension support)
slouken@242
   753
                video_x11_xme=no
slouken@242
   754
                AC_TRY_COMPILE([
slouken@242
   755
                 #include <X11/Xlib.h>
slouken@242
   756
                 #include <X11/extensions/xme.h>
slouken@242
   757
                ],[
slouken@242
   758
                 XiGMiscResolutionInfo *resolutions;
slouken@242
   759
                ],[
slouken@242
   760
                video_x11_xme=yes
slouken@242
   761
                ])
slouken@242
   762
                AC_MSG_RESULT($video_x11_xme)
slouken@242
   763
                if test x$video_x11_xme = xyes; then
slouken@242
   764
                    CFLAGS="$CFLAGS -DHAVE_XIGXME"
slouken@242
   765
                    SYSTEM_LIBS="$SYSTEM_LIBS -lxme"
slouken@242
   766
                fi
slouken@242
   767
            fi
slouken@0
   768
        fi
slouken@0
   769
    fi
slouken@0
   770
}
slouken@279
   771
icculus@1133
   772
icculus@1133
   773
dnl Check for X11 on Mac OS X / Darwin
icculus@1133
   774
CheckMacX11()
icculus@1133
   775
{
icculus@1133
   776
    AC_ARG_ENABLE(video-x11,
icculus@1133
   777
[  --enable-video-x11      use X11 video driver [default=no]],
icculus@1133
   778
                  , enable_video_x11=no)
icculus@1133
   779
    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
icculus@1133
   780
        AC_PATH_X
icculus@1133
   781
        AC_PATH_XTRA
icculus@1133
   782
        if test x$have_x = xyes; then
icculus@1133
   783
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -DXTHREADS -I$srcdir/include -I$srcdir/src/video"
icculus@1133
   784
            if test x$ac_cv_func_shmat != xyes; then
icculus@1133
   785
                CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
icculus@1133
   786
            fi
icculus@1133
   787
            SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
icculus@1133
   788
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
icculus@1133
   789
            VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
icculus@1133
   790
        fi
icculus@1133
   791
    fi
icculus@1133
   792
}
icculus@1133
   793
slouken@292
   794
dnl Find the X11 DGA 2.0 include and library directories
slouken@292
   795
CheckDGA()
slouken@292
   796
{
slouken@292
   797
    AC_ARG_ENABLE(video-dga,
slouken@292
   798
[  --enable-video-dga      use DGA 2.0 video driver [default=yes]],
slouken@292
   799
                  , enable_video_dga=yes)
slouken@292
   800
    if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
slouken@292
   801
        save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
slouken@292
   802
        AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
slouken@292
   803
        video_x11_dga2=no
slouken@292
   804
        AC_TRY_COMPILE([
slouken@292
   805
         #include <X11/Xlib.h>
slouken@292
   806
         #include <XFree86/extensions/xf86dga.h>
slouken@292
   807
        ],[
slouken@292
   808
         SDL_NAME(XDGAEvent) xevent;
slouken@292
   809
        ],[
slouken@292
   810
        video_x11_dga2=yes
slouken@292
   811
        ])
slouken@292
   812
        AC_MSG_RESULT($video_x11_dga2)
slouken@292
   813
        if test x$video_x11_dga2 = xyes; then
slouken@292
   814
            CFLAGS="$CFLAGS -DENABLE_DGA"
slouken@292
   815
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
slouken@292
   816
            VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
slouken@292
   817
        fi
slouken@292
   818
    fi
slouken@292
   819
}
slouken@292
   820
slouken@0
   821
CheckPHOTON()
slouken@0
   822
{
slouken@0
   823
    AC_ARG_ENABLE(video-photon,
slouken@72
   824
[  --enable-video-photon   use QNX Photon video driver [default=yes]],
slouken@0
   825
                  , enable_video_photon=yes)
slouken@0
   826
    if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
slouken@0
   827
        AC_MSG_CHECKING(for QNX Photon support)
slouken@0
   828
        video_photon=no
slouken@0
   829
        AC_TRY_COMPILE([
slouken@0
   830
          #include <Ph.h>
slouken@0
   831
          #include <Pt.h>
slouken@0
   832
          #include <photon/Pg.h>
slouken@0
   833
          #include <photon/PdDirect.h>
slouken@0
   834
        ],[
slouken@0
   835
         PgDisplaySettings_t *visual;
slouken@0
   836
        ],[
slouken@0
   837
        video_photon=yes
slouken@0
   838
        ])
slouken@0
   839
        AC_MSG_RESULT($video_photon)
slouken@0
   840
        if test x$video_photon = xyes; then
slouken@19
   841
            CFLAGS="$CFLAGS -DENABLE_PHOTON"
slouken@0
   842
            SYSTEM_LIBS="$SYSTEM_LIBS -lph"
slouken@0
   843
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
slouken@0
   844
            VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
slouken@279
   845
            CheckOpenGLQNX
slouken@0
   846
        fi
slouken@0
   847
    fi
slouken@0
   848
}
slouken@0
   849
slouken@0
   850
dnl Find the framebuffer console includes
slouken@0
   851
CheckFBCON()
slouken@0
   852
{
slouken@0
   853
    AC_ARG_ENABLE(video-fbcon,
slouken@0
   854
[  --enable-video-fbcon    use framebuffer console video driver [default=yes]],
slouken@0
   855
                  , enable_video_fbcon=yes)
slouken@0
   856
    if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
slouken@0
   857
        AC_MSG_CHECKING(for framebuffer console support)
slouken@0
   858
        video_fbcon=no
slouken@0
   859
        AC_TRY_COMPILE([
slouken@0
   860
         #include <linux/fb.h>
slouken@0
   861
         #include <linux/kd.h>
slouken@0
   862
         #include <linux/keyboard.h>
slouken@0
   863
        ],[
slouken@0
   864
        ],[
slouken@0
   865
        video_fbcon=yes
slouken@0
   866
        ])
slouken@0
   867
        AC_MSG_RESULT($video_fbcon)
slouken@0
   868
        if test x$video_fbcon = xyes; then
slouken@0
   869
            CFLAGS="$CFLAGS -DENABLE_FBCON"
slouken@0
   870
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
slouken@0
   871
            VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
slouken@0
   872
        fi
slouken@0
   873
    fi
slouken@0
   874
}
slouken@0
   875
slouken@167
   876
dnl Find DirectFB
slouken@167
   877
CheckDirectFB()
slouken@167
   878
{
slouken@167
   879
    AC_ARG_ENABLE(video-directfb,
slouken@678
   880
[  --enable-video-directfb use DirectFB video driver [default=no]],
slouken@678
   881
                  , enable_video_directfb=no)
slouken@167
   882
    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
slouken@167
   883
        video_directfb=no
slouken@167
   884
slouken@167
   885
        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
slouken@167
   886
        if test x$PKG_CONFIG = xno ; then
slouken@167
   887
            AC_MSG_WARN([*** pkg-config is required to build the DirectFB video driver.])
slouken@167
   888
        else
slouken@167
   889
            AC_MSG_CHECKING(for DirectFB support)
slouken@167
   890
slouken@477
   891
            if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
slouken@477
   892
                AC_MSG_ERROR([*** pkg-config too old; version 0.7 or better required.])
slouken@167
   893
            fi
slouken@167
   894
slouken@546
   895
            DIRECTFB_REQUIRED_VERSION=0.9.15
slouken@167
   896
slouken@167
   897
            if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
slouken@167
   898
                DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
slouken@167
   899
                DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
slouken@167
   900
                video_directfb=yes
slouken@167
   901
            fi
slouken@167
   902
        fi
slouken@167
   903
slouken@167
   904
        AC_MSG_RESULT($video_directfb)
slouken@167
   905
        if test x$video_directfb = xyes; then
slouken@167
   906
            CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
slouken@167
   907
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
slouken@167
   908
            VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"
slouken@167
   909
slouken@167
   910
            AC_SUBST(DIRECTFB_CFLAGS)
slouken@167
   911
            AC_SUBST(DIRECTFB_LIBS)
slouken@167
   912
        fi
slouken@167
   913
    fi
slouken@167
   914
}
slouken@167
   915
slouken@70
   916
dnl See if we're running on PlayStation 2 hardware
slouken@70
   917
CheckPS2GS()
slouken@70
   918
{
slouken@72
   919
    AC_ARG_ENABLE(video-ps2gs,
slouken@72
   920
[  --enable-video-ps2gs    use PlayStation 2 GS video driver [default=yes]],
slouken@72
   921
                  , enable_video_ps2gs=yes)
slouken@70
   922
    if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
slouken@72
   923
        AC_MSG_CHECKING(for PlayStation 2 GS support)
slouken@70
   924
        video_ps2gs=no
slouken@70
   925
        AC_TRY_COMPILE([
slouken@70
   926
         #include <linux/ps2/dev.h>
slouken@70
   927
         #include <linux/ps2/gs.h>
slouken@70
   928
        ],[
slouken@70
   929
        ],[
slouken@70
   930
        video_ps2gs=yes
slouken@70
   931
        ])
slouken@72
   932
        AC_MSG_RESULT($video_ps2gs)
slouken@70
   933
        if test x$video_ps2gs = xyes; then
slouken@70
   934
            CFLAGS="$CFLAGS -DENABLE_PS2GS"
slouken@70
   935
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
slouken@70
   936
            VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
slouken@70
   937
        fi
slouken@70
   938
    fi
slouken@70
   939
}
slouken@70
   940
slouken@0
   941
dnl Find the GGI includes
slouken@0
   942
CheckGGI()
slouken@0
   943
{
slouken@0
   944
    AC_ARG_ENABLE(video-ggi,
slouken@0
   945
[  --enable-video-ggi      use GGI video driver [default=no]],
slouken@0
   946
                  , enable_video_ggi=no)
slouken@0
   947
    if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
slouken@0
   948
        AC_MSG_CHECKING(for GGI support)
slouken@0
   949
        video_ggi=no
slouken@0
   950
        AC_TRY_COMPILE([
slouken@0
   951
         #include <ggi/ggi.h>
slouken@0
   952
         #include <ggi/gii.h>
slouken@0
   953
        ],[
slouken@0
   954
        ],[
slouken@0
   955
        video_ggi=yes
slouken@0
   956
        ])
slouken@0
   957
        AC_MSG_RESULT($video_ggi)
slouken@0
   958
        if test x$video_ggi = xyes; then
slouken@0
   959
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
slouken@0
   960
            SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
slouken@0
   961
slouken@0
   962
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
slouken@0
   963
            VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
slouken@0
   964
        fi
slouken@0
   965
    fi
slouken@0
   966
}
slouken@0
   967
slouken@0
   968
dnl Find the SVGAlib includes and libraries
slouken@0
   969
CheckSVGA()
slouken@0
   970
{
slouken@0
   971
    AC_ARG_ENABLE(video-svga,
slouken@0
   972
[  --enable-video-svga     use SVGAlib video driver [default=no]],
slouken@0
   973
                  , enable_video_svga=no)
slouken@0
   974
    if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
slouken@0
   975
        AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
slouken@0
   976
        video_svga=no
slouken@0
   977
        AC_TRY_COMPILE([
slouken@0
   978
         #include <vga.h>
slouken@0
   979
         #include <vgamouse.h>
slouken@0
   980
         #include <vgakeyboard.h>
slouken@0
   981
        ],[
slouken@0
   982
         if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
slouken@0
   983
             exit(0);
slouken@0
   984
         }
slouken@0
   985
        ],[
slouken@0
   986
        video_svga=yes
slouken@0
   987
        ])
slouken@0
   988
        AC_MSG_RESULT($video_svga)
slouken@0
   989
        if test x$video_svga = xyes; then
slouken@0
   990
            CFLAGS="$CFLAGS -DENABLE_SVGALIB"
slouken@0
   991
            SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
slouken@0
   992
slouken@0
   993
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
slouken@0
   994
            VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
slouken@0
   995
        fi
slouken@0
   996
    fi
slouken@0
   997
}
slouken@0
   998
slouken@75
   999
dnl Find the VGL includes and libraries
slouken@75
  1000
CheckVGL()
slouken@75
  1001
{
slouken@75
  1002
    AC_ARG_ENABLE(video-vgl,
patmandin@651
  1003
[  --enable-video-vgl      use VGL video driver [default=no]],
slouken@75
  1004
                  , enable_video_vgl=no)
slouken@75
  1005
    if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
slouken@75
  1006
        AC_MSG_CHECKING(for libVGL support)
slouken@75
  1007
        video_vgl=no
slouken@75
  1008
        AC_TRY_COMPILE([
slouken@75
  1009
         #include <sys/fbio.h>
slouken@75
  1010
         #include <sys/consio.h>
slouken@75
  1011
         #include <sys/kbio.h>
slouken@75
  1012
         #include <vgl.h>
slouken@75
  1013
        ],[
slouken@75
  1014
         VGLBitmap bitmap;
slouken@144
  1015
         exit(bitmap.Bitmap);
slouken@75
  1016
        ],[
slouken@75
  1017
        video_vgl=yes
slouken@75
  1018
        ])
slouken@75
  1019
        AC_MSG_RESULT($video_vgl)
slouken@75
  1020
        if test x$video_vgl = xyes; then
slouken@75
  1021
            CFLAGS="$CFLAGS -DENABLE_VGL"
slouken@75
  1022
            SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"
slouken@75
  1023
slouken@75
  1024
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
slouken@75
  1025
            VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
slouken@75
  1026
        fi
slouken@75
  1027
    fi
slouken@75
  1028
}
slouken@75
  1029
slouken@0
  1030
dnl Find the AAlib includes
slouken@0
  1031
CheckAAlib()
slouken@0
  1032
{
slouken@0
  1033
    AC_ARG_ENABLE(video-aalib,
slouken@0
  1034
[  --enable-video-aalib    use AAlib video driver [default=no]],
slouken@0
  1035
                  , enable_video_aalib=no)
slouken@0
  1036
    if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
slouken@0
  1037
        AC_MSG_CHECKING(for AAlib support)
slouken@0
  1038
        video_aalib=no
slouken@0
  1039
        AC_TRY_COMPILE([
slouken@0
  1040
         #include <aalib.h>
slouken@0
  1041
        ],[
slouken@0
  1042
        ],[
slouken@0
  1043
        video_aalib=yes
slouken@0
  1044
        ])
slouken@0
  1045
        AC_MSG_RESULT($video_aalib)
slouken@0
  1046
        if test x$video_aalib = xyes; then
slouken@0
  1047
            CFLAGS="$CFLAGS -DENABLE_AALIB"
slouken@0
  1048
            SYSTEM_LIBS="$SYSTEM_LIBS -laa"
slouken@0
  1049
slouken@0
  1050
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
slouken@0
  1051
            VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
slouken@0
  1052
        fi
slouken@0
  1053
    fi
slouken@0
  1054
}
slouken@0
  1055
slouken@281
  1056
dnl Set up the Atari Xbios driver
slouken@281
  1057
CheckAtariXbiosVideo()
slouken@281
  1058
{
slouken@281
  1059
    AC_ARG_ENABLE(xbios,
slouken@281
  1060
[  --enable-video-xbios    use Atari Xbios video driver [default=yes]],
slouken@281
  1061
                  , enable_video_xbios=yes)
slouken@281
  1062
    video_xbios=no
slouken@281
  1063
    if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
slouken@281
  1064
        video_xbios=yes
slouken@281
  1065
        CFLAGS="$CFLAGS -DENABLE_XBIOS"
slouken@281
  1066
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
slouken@281
  1067
        VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
slouken@281
  1068
    fi
slouken@281
  1069
}
slouken@281
  1070
slouken@281
  1071
dnl Set up the Atari Gem driver
slouken@281
  1072
CheckAtariGemVideo()
slouken@281
  1073
{
slouken@281
  1074
    AC_ARG_ENABLE(gem,
slouken@281
  1075
[  --enable-video-gem      use Atari Gem video driver [default=yes]],
slouken@281
  1076
                  , enable_video_gem=yes)
slouken@281
  1077
    if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
slouken@281
  1078
        video_gem=no
slouken@281
  1079
        AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
slouken@281
  1080
        AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
slouken@281
  1081
        if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
slouken@281
  1082
            video_gem=yes
slouken@281
  1083
            CFLAGS="$CFLAGS -DENABLE_GEM"
slouken@281
  1084
            SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
slouken@281
  1085
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
slouken@281
  1086
            VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
slouken@281
  1087
        fi
slouken@281
  1088
    fi
slouken@281
  1089
}
slouken@281
  1090
slouken@281
  1091
dnl Set up the Atari Bios keyboard driver
slouken@281
  1092
CheckAtariBiosEvent()
slouken@281
  1093
{
slouken@281
  1094
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
slouken@281
  1095
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
slouken@281
  1096
    VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
slouken@281
  1097
}
slouken@281
  1098
slouken@1
  1099
dnl rcg04172001 Set up the Null video driver.
slouken@1
  1100
CheckDummyVideo()
slouken@1
  1101
{
slouken@1
  1102
    AC_ARG_ENABLE(video-dummy,
slouken@86
  1103
[  --enable-video-dummy    use dummy video driver [default=yes]],
slouken@86
  1104
                  , enable_video_dummy=yes)
slouken@1
  1105
    if test x$enable_video_dummy = xyes; then
slouken@1
  1106
      CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
slouken@1
  1107
      VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
slouken@1
  1108
      VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
slouken@1
  1109
    fi
slouken@1
  1110
}
slouken@1
  1111
slouken@0
  1112
dnl Check to see if OpenGL support is desired
slouken@0
  1113
AC_ARG_ENABLE(video-opengl,
slouken@0
  1114
[  --enable-video-opengl   include OpenGL context creation [default=yes]],
slouken@0
  1115
              , enable_video_opengl=yes)
slouken@0
  1116
slouken@0
  1117
dnl Find OpenGL
slouken@0
  1118
CheckOpenGL()
slouken@0
  1119
{
slouken@0
  1120
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1121
        AC_MSG_CHECKING(for OpenGL (GLX) support)
slouken@0
  1122
        video_opengl=no
slouken@0
  1123
        AC_TRY_COMPILE([
slouken@0
  1124
         #include <GL/gl.h>
slouken@0
  1125
         #include <GL/glx.h>
slouken@0
  1126
         #include <dlfcn.h> /* For loading extensions */
slouken@0
  1127
        ],[
slouken@0
  1128
        ],[
slouken@0
  1129
        video_opengl=yes
slouken@0
  1130
        ])
slouken@0
  1131
        AC_MSG_RESULT($video_opengl)
slouken@0
  1132
        if test x$video_opengl = xyes; then
slouken@0
  1133
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@296
  1134
            if test x$use_dlopen != xyes; then
slouken@296
  1135
                AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
slouken@296
  1136
            fi
slouken@0
  1137
        fi
slouken@0
  1138
    fi
slouken@0
  1139
}
slouken@0
  1140
slouken@279
  1141
dnl Find QNX RtP OpenGL
slouken@279
  1142
CheckOpenGLQNX()
slouken@279
  1143
{
slouken@279
  1144
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@279
  1145
        AC_MSG_CHECKING(for OpenGL (Photon) support)
slouken@279
  1146
        video_opengl=no
slouken@279
  1147
        AC_TRY_COMPILE([
slouken@279
  1148
         #include <GL/gl.h>
slouken@279
  1149
        ],[
slouken@279
  1150
        ],[
slouken@279
  1151
        video_opengl=yes
slouken@279
  1152
        ])
slouken@279
  1153
        AC_MSG_RESULT($video_opengl)
slouken@279
  1154
        if test x$video_opengl = xyes; then
slouken@279
  1155
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@279
  1156
            SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
slouken@570
  1157
            if test x$use_dlopen != xyes; then
slouken@666
  1158
                AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
slouken@570
  1159
            fi
slouken@279
  1160
        fi
slouken@279
  1161
    fi
slouken@279
  1162
}
slouken@279
  1163
slouken@0
  1164
dnl Check for BeOS OpenGL
slouken@0
  1165
CheckBeGL()
slouken@0
  1166
{
slouken@0
  1167
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1168
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
  1169
        SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
slouken@0
  1170
    fi
slouken@0
  1171
}
slouken@0
  1172
slouken@0
  1173
dnl Check for MacOS OpenGL
slouken@0
  1174
CheckMacGL()
slouken@0
  1175
{
slouken@0
  1176
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1177
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
  1178
        case "$target" in
slouken@0
  1179
            *-*-darwin*)
icculus@1133
  1180
                SYSTEM_LIBS="$SYSTEM_LIBS -framework OpenGL"
icculus@1133
  1181
                # The following is probably not available in Darwin:
icculus@1133
  1182
                SYSTEM_LIBS="$SYSTEM_LIBS -framework AGL"
slouken@0
  1183
        esac
slouken@0
  1184
    fi
slouken@0
  1185
}
slouken@0
  1186
patmandin@978
  1187
dnl Check for Mesa offscreen rendering
patmandin@989
  1188
CheckAtariOSMesa()
patmandin@978
  1189
{
patmandin@989
  1190
    if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
patmandin@991
  1191
        AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
patmandin@991
  1192
        AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
patmandin@991
  1193
patmandin@991
  1194
        # Static linking to -lOSMesa
patmandin@989
  1195
        AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
patmandin@989
  1196
        if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
patmandin@991
  1197
            # -lOSMesa is really the static library
patmandin@989
  1198
            if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
patmandin@989
  1199
    	        CFLAGS="$CFLAGS -DHAVE_OPENGL"
patmandin@989
  1200
		    	SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa"
patmandin@989
  1201
            fi
patmandin@989
  1202
        else
patmandin@991
  1203
            # -lOSMesa is a loader for OSMesa.ldg
patmandin@989
  1204
            OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
patmandin@989
  1205
            OSMESA_LIBS=`$OSMESA_CONFIG --libs`
patmandin@991
  1206
            CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
patmandin@989
  1207
            SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS"
patmandin@978
  1208
        fi
patmandin@991
  1209
patmandin@991
  1210
        AC_ARG_ENABLE(osmesa-shared,
patmandin@991
  1211
[  --enable-osmesa-shared  dynamically load OSMesa OpenGL support [default=yes]],
patmandin@991
  1212
                              , enable_osmesa_shared=yes)
patmandin@991
  1213
        if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
patmandin@991
  1214
            # Dynamic linking
patmandin@991
  1215
            if test "x$have_osmesa_hdr" = "xyes"; then
patmandin@991
  1216
                CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED"
patmandin@991
  1217
            fi
patmandin@991
  1218
		fi
patmandin@978
  1219
    fi
patmandin@978
  1220
}
patmandin@978
  1221
slouken@0
  1222
dnl See if we can use the new unified event interface in Linux 2.4
slouken@0
  1223
CheckInputEvents()
slouken@0
  1224
{
slouken@0
  1225
    dnl Check for Linux 2.4 unified input event interface support
slouken@0
  1226
    AC_ARG_ENABLE(input-events,
slouken@211
  1227
[  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
slouken@211
  1228
                  , enable_input_events=yes)
slouken@0
  1229
    if test x$enable_input_events = xyes; then
slouken@0
  1230
        AC_MSG_CHECKING(for Linux 2.4 unified input interface)
slouken@0
  1231
        use_input_events=no
slouken@0
  1232
        AC_TRY_COMPILE([
slouken@0
  1233
          #include <linux/input.h>
slouken@0
  1234
        ],[
slouken@0
  1235
          #ifndef EVIOCGNAME
slouken@0
  1236
          #error EVIOCGNAME() ioctl not available
slouken@0
  1237
          #endif
slouken@0
  1238
        ],[
slouken@0
  1239
        use_input_events=yes
slouken@0
  1240
        ])
slouken@0
  1241
        AC_MSG_RESULT($use_input_events)
slouken@0
  1242
        if test x$use_input_events = xyes; then
slouken@0
  1243
            CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
slouken@0
  1244
        fi
slouken@0
  1245
    fi
slouken@0
  1246
}
slouken@0
  1247
slouken@399
  1248
dnl See if we can use GNU pth library for threads
slouken@399
  1249
CheckPTH()
slouken@399
  1250
{
slouken@399
  1251
    dnl Check for pth support
slouken@399
  1252
    AC_ARG_ENABLE(pth,
slouken@399
  1253
[  --enable-pth            use GNU pth library for multi-threading [default=yes]],
slouken@399
  1254
                  , enable_pth=yes)
slouken@399
  1255
    if test x$enable_threads = xyes -a x$enable_pth = xyes; then
slouken@399
  1256
        AC_PATH_PROG(PTH_CONFIG, pth-config, no)
slouken@399
  1257
        if test "$PTH_CONFIG" = "no"; then
slouken@399
  1258
            use_pth=no
slouken@399
  1259
        else
slouken@399
  1260
            PTH_CFLAGS=`$PTH_CONFIG --cflags`
slouken@399
  1261
            PTH_LIBS=`$PTH_CONFIG --libs --all`
slouken@399
  1262
            SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
slouken@399
  1263
            SDL_LIBS="$SDL_LIBS $PTH_LIBS"
slouken@399
  1264
            CFLAGS="$CFLAGS -DENABLE_PTH"
slouken@399
  1265
            use_pth=yes
slouken@399
  1266
        fi
slouken@399
  1267
        AC_MSG_CHECKING(pth)
slouken@399
  1268
        if test "x$use_pth" = xyes; then
slouken@399
  1269
            AC_MSG_RESULT(yes)
slouken@399
  1270
        else
slouken@399
  1271
            AC_MSG_RESULT(no)
slouken@399
  1272
        fi
slouken@399
  1273
    fi
slouken@399
  1274
}
slouken@399
  1275
slouken@0
  1276
dnl See what type of thread model to use on Linux and Solaris
slouken@0
  1277
CheckPTHREAD()
slouken@0
  1278
{
slouken@0
  1279
    dnl Check for pthread support
slouken@0
  1280
    AC_ARG_ENABLE(pthreads,
slouken@0
  1281
[  --enable-pthreads       use POSIX threads for multi-threading [default=yes]],
slouken@0
  1282
                  , enable_pthreads=yes)
slouken@0
  1283
    dnl This is used on Linux for glibc binary compatibility (Doh!)
slouken@0
  1284
    AC_ARG_ENABLE(pthread-sem,
slouken@86
  1285
[  --enable-pthread-sem    use pthread semaphores [default=yes]],
slouken@0
  1286
                  , enable_pthread_sem=yes)
slouken@0
  1287
    case "$target" in
slouken@0
  1288
        *-*-bsdi*)
slouken@0
  1289
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1290
            pthread_lib=""
slouken@0
  1291
            ;;
slouken@0
  1292
        *-*-darwin*)
slouken@0
  1293
            pthread_cflags="-D_THREAD_SAFE"
slouken@0
  1294
# causes Carbon.p complaints?
slouken@0
  1295
#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1296
            ;;
slouken@0
  1297
        *-*-freebsd*)
slouken@0
  1298
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1299
            pthread_lib="-pthread"
slouken@0
  1300
            ;;
slouken@43
  1301
        *-*-netbsd*)
slouken@43
  1302
            pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
slouken@43
  1303
            pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
slouken@43
  1304
            ;;
slouken@0
  1305
        *-*-openbsd*)
slouken@0
  1306
            pthread_cflags="-D_REENTRANT"
slouken@0
  1307
            pthread_lib="-pthread"
slouken@0
  1308
            ;;
slouken@0
  1309
        *-*-solaris*)
slouken@0
  1310
            pthread_cflags="-D_REENTRANT"
slouken@0
  1311
            pthread_lib="-lpthread -lposix4"
slouken@0
  1312
            ;;
slouken@0
  1313
        *-*-sysv5*)
slouken@0
  1314
            pthread_cflags="-D_REENTRANT -Kthread"
slouken@0
  1315
            pthread_lib=""
slouken@0
  1316
            ;;
slouken@0
  1317
        *-*-irix*)
slouken@0
  1318
            pthread_cflags="-D_SGI_MP_SOURCE"
slouken@0
  1319
            pthread_lib="-lpthread"
slouken@0
  1320
            ;;
slouken@0
  1321
        *-*-aix*)
slouken@0
  1322
            pthread_cflags="-D_REENTRANT -mthreads"
slouken@0
  1323
            pthread_lib="-lpthread"
slouken@0
  1324
            ;;
icculus@425
  1325
        *-*-hpux11*)
icculus@425
  1326
            pthread_cflags="-D_REENTRANT"
icculus@425
  1327
            pthread_lib="-L/usr/lib -lpthread"
icculus@425
  1328
            ;;
slouken@0
  1329
        *-*-qnx*)
slouken@0
  1330
            pthread_cflags=""
slouken@0
  1331
            pthread_lib=""
slouken@0
  1332
            ;;
slouken@873
  1333
        *-*-osf*)
slouken@1019
  1334
            pthread_cflags="-D_REENTRANT"
slouken@873
  1335
            if test x$ac_cv_prog_gcc = xyes; then
slouken@873
  1336
                pthread_lib="-lpthread -lrt"
slouken@873
  1337
            else
slouken@1019
  1338
                pthread_lib="-lpthread -lexc -lrt"
slouken@873
  1339
            fi
slouken@873
  1340
            ;;
slouken@0
  1341
        *)
slouken@0
  1342
            pthread_cflags="-D_REENTRANT"
slouken@0
  1343
            pthread_lib="-lpthread"
slouken@0
  1344
            ;;
slouken@0
  1345
    esac
icculus@1140
  1346
    if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
slouken@415
  1347
        # Save the original compiler flags and libraries
slouken@415
  1348
        ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
slouken@415
  1349
        # Add the pthread compiler flags and libraries
slouken@415
  1350
        CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
slouken@415
  1351
        # Check to see if we have pthread support on this system
slouken@0
  1352
        AC_MSG_CHECKING(for pthreads)
slouken@0
  1353
        use_pthreads=no
slouken@0
  1354
        AC_TRY_LINK([
slouken@0
  1355
         #include <pthread.h>
slouken@0
  1356
        ],[
slouken@0
  1357
         pthread_attr_t type;
slouken@0
  1358
         pthread_attr_init(&type);
slouken@0
  1359
        ],[
slouken@0
  1360
        use_pthreads=yes
slouken@0
  1361
        ])
slouken@0
  1362
        AC_MSG_RESULT($use_pthreads)
slouken@415
  1363
        # Restore the compiler flags and libraries
slouken@415
  1364
        CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
slouken@415
  1365
        # Do futher testing if we have pthread support...
slouken@0
  1366
        if test x$use_pthreads = xyes; then
slouken@0
  1367
            CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
slouken@846
  1368
            LIBS="$LIBS $pthread_lib"
slouken@0
  1369
            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
slouken@0
  1370
            SDL_LIBS="$SDL_LIBS $pthread_lib"
slouken@0
  1371
slouken@0
  1372
            # Check to see if recursive mutexes are available
slouken@0
  1373
            AC_MSG_CHECKING(for recursive mutexes)
slouken@0
  1374
            has_recursive_mutexes=no
slouken@0
  1375
            AC_TRY_LINK([
slouken@0
  1376
              #include <pthread.h>
slouken@0
  1377
            ],[
slouken@0
  1378
              pthread_mutexattr_t attr;
slouken@371
  1379
              #if defined(linux) && !(defined(__arm__) && defined(QWS))
slouken@0
  1380
              pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
slouken@0
  1381
              #else
slouken@0
  1382
              pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
slouken@0
  1383
              #endif
slouken@0
  1384
            ],[
slouken@0
  1385
            has_recursive_mutexes=yes
slouken@0
  1386
            ])
slouken@0
  1387
            # Some systems have broken recursive mutex implementations
slouken@0
  1388
            case "$target" in
slouken@399
  1389
                *-*-darwin*)
slouken@399
  1390
                    has_recursive_mutexes=no
slouken@399
  1391
                    ;;
slouken@0
  1392
                *-*-solaris*)
slouken@0
  1393
                    has_recursive_mutexes=no
slouken@0
  1394
                    ;;
slouken@0
  1395
            esac
slouken@0
  1396
            AC_MSG_RESULT($has_recursive_mutexes)
slouken@0
  1397
            if test x$has_recursive_mutexes != xyes; then
slouken@0
  1398
                CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
slouken@0
  1399
            fi
slouken@0
  1400
slouken@94
  1401
            # Check to see if pthread semaphore support is missing
slouken@94
  1402
            if test x$enable_pthread_sem = xyes; then
slouken@94
  1403
                AC_MSG_CHECKING(for pthread semaphores)
slouken@94
  1404
                have_pthread_sem=no
slouken@94
  1405
                AC_TRY_COMPILE([
slouken@94
  1406
                  #include <pthread.h>
slouken@94
  1407
                  #include <semaphore.h>
slouken@94
  1408
                ],[
slouken@94
  1409
                ],[
slouken@94
  1410
                have_pthread_sem=yes
slouken@94
  1411
                ])
slouken@94
  1412
                AC_MSG_RESULT($have_pthread_sem)
slouken@94
  1413
            fi
slouken@94
  1414
slouken@0
  1415
            # Check to see if this is broken glibc 2.0 pthreads
slouken@0
  1416
            case "$target" in
slouken@0
  1417
                *-*-linux*)
slouken@0
  1418
                    AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
slouken@0
  1419
                    glibc20_pthreads=no
slouken@0
  1420
                    AC_TRY_COMPILE([
slouken@0
  1421
                      #include <features.h>
slouken@0
  1422
                      #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
slouken@0
  1423
                      #warning Working around a bug in glibc 2.0 pthreads
slouken@0
  1424
                      #else
slouken@0
  1425
                      #error pthread implementation okay
slouken@0
  1426
                      #endif /* glibc 2.0 */
slouken@0
  1427
                    ],[
slouken@0
  1428
                    ],[
slouken@0
  1429
                    glibc20_pthreads=yes
slouken@0
  1430
                    ])
slouken@0
  1431
                    AC_MSG_RESULT($glibc20_pthreads)
slouken@0
  1432
            esac
slouken@0
  1433
        fi
slouken@0
  1434
    fi
slouken@0
  1435
slouken@0
  1436
    AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
slouken@0
  1437
    have_semun=no
slouken@0
  1438
    AC_TRY_COMPILE([
slouken@0
  1439
      #include <sys/types.h>
slouken@0
  1440
      #include <sys/sem.h>
slouken@0
  1441
    ],[
slouken@0
  1442
      union semun t;
slouken@0
  1443
    ],[
slouken@0
  1444
    have_semun=yes
slouken@0
  1445
    ])
slouken@0
  1446
    AC_MSG_RESULT($have_semun)
slouken@0
  1447
    if test x$have_semun = xyes; then
slouken@0
  1448
        CFLAGS="$CFLAGS -DHAVE_SEMUN"
slouken@0
  1449
    fi
slouken@0
  1450
slouken@399
  1451
    # See if we can use GNU Pth or clone() on Linux directly
slouken@0
  1452
    if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
slouken@399
  1453
        CheckPTH
slouken@399
  1454
        if test x$use_pth != xyes; then
slouken@399
  1455
            case "$target" in
slouken@399
  1456
                *-*-linux*)
slouken@399
  1457
                    use_clone=yes
slouken@399
  1458
                    ;;
slouken@399
  1459
            esac
slouken@399
  1460
        fi
slouken@0
  1461
    fi
slouken@0
  1462
}
slouken@0
  1463
slouken@399
  1464
# Note that we need to have either semaphores or to have mutexes and
slouken@399
  1465
# condition variables to implement all thread synchronization primitives
slouken@399
  1466
CopyUnixThreadSource()
slouken@185
  1467
{
slouken@399
  1468
    if test x$use_pthreads = xyes -o x$use_clone = xyes; then
slouken@399
  1469
        # Basic thread creation functions
slouken@399
  1470
        COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@399
  1471
        COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@399
  1472
slouken@399
  1473
        # Semaphores
slouken@399
  1474
        # We can fake these with mutexes and condition variables if necessary
slouken@399
  1475
        if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@399
  1476
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@185
  1477
        else
slouken@399
  1478
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@185
  1479
        fi
slouken@399
  1480
        COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@399
  1481
slouken@399
  1482
        # Mutexes
slouken@399
  1483
        # We can fake these with semaphores if necessary
slouken@399
  1484
        case "$target" in
slouken@399
  1485
            *-*-bsdi*)
slouken@399
  1486
                COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
slouken@399
  1487
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@599
  1488
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@599
  1489
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@399
  1490
                ;;
slouken@399
  1491
            *)
slouken@399
  1492
                if test x$glibc20_pthreads = xyes; then
slouken@399
  1493
                    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@399
  1494
                    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@399
  1495
                else
slouken@399
  1496
                    COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@399
  1497
                    COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@399
  1498
                fi
slouken@399
  1499
                ;;
slouken@399
  1500
        esac
slouken@399
  1501
slouken@399
  1502
        # Condition variables
slouken@399
  1503
        # We can fake these with semaphores and mutexes if necessary
slouken@399
  1504
        if test x$glibc20_pthreads = xyes -o x$has_recursive_mutexes != xyes; then
slouken@399
  1505
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@185
  1506
        else
slouken@399
  1507
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@185
  1508
        fi
slouken@399
  1509
        COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@399
  1510
slouken@400
  1511
    elif test x$use_pth = xyes; then
slouken@399
  1512
        COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
slouken@399
  1513
        COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
slouken@399
  1514
        COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex.c)
slouken@399
  1515
        COPY_ARCH_SRC(src/thread, pth, SDL_sysmutex_c.h)
slouken@399
  1516
        COPY_ARCH_SRC(src/thread, pth, SDL_syscond.c)
slouken@399
  1517
        COPY_ARCH_SRC(src/thread, pth, SDL_syscond_c.h)
slouken@399
  1518
        COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@399
  1519
        COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@399
  1520
    else
slouken@399
  1521
       AC_MSG_ERROR([
slouken@399
  1522
*** No thread support detected
slouken@399
  1523
       ])
slouken@185
  1524
    fi
slouken@185
  1525
}
slouken@185
  1526
slouken@814
  1527
dnl See if we can use sigaction() instead of signal()
slouken@814
  1528
CheckSIGACTION()
slouken@814
  1529
{
slouken@814
  1530
    dnl Check for sigaction support
slouken@814
  1531
    AC_ARG_ENABLE(sigaction,
slouken@814
  1532
[  --enable-sigaction      use sigaction instead of signal [default=yes]],
slouken@814
  1533
                  , enable_sigaction=yes)
slouken@814
  1534
    if test x$enable_sigaction = xyes; then
slouken@814
  1535
        AC_MSG_CHECKING(sigaction)
slouken@814
  1536
        have_sigaction=no
slouken@814
  1537
        AC_TRY_COMPILE([
slouken@814
  1538
         #include <signal.h>
slouken@814
  1539
        ],[
slouken@814
  1540
         struct sigaction junk;
slouken@814
  1541
         sigaction(0, &junk, &junk);
slouken@814
  1542
        ],[
slouken@814
  1543
        have_sigaction=yes
slouken@814
  1544
        ])
slouken@814
  1545
        AC_MSG_RESULT($have_sigaction)
slouken@814
  1546
        if test x$have_sigaction = xyes; then
slouken@814
  1547
            CFLAGS="$CFLAGS -DHAVE_SIGACTION"
slouken@814
  1548
        fi
slouken@814
  1549
    fi
slouken@814
  1550
}
slouken@814
  1551
slouken@0
  1552
dnl Determine whether the compiler can produce Win32 executables
slouken@0
  1553
CheckWIN32()
slouken@0
  1554
{
slouken@0
  1555
    AC_MSG_CHECKING(Win32 compiler)
slouken@0
  1556
    have_win32_gcc=no
slouken@0
  1557
    AC_TRY_COMPILE([
slouken@0
  1558
     #include <windows.h>
slouken@0
  1559
    ],[
slouken@0
  1560
    ],[
slouken@0
  1561
    have_win32_gcc=yes
slouken@0
  1562
    ])
slouken@0
  1563
    AC_MSG_RESULT($have_win32_gcc)
slouken@0
  1564
    if test x$have_win32_gcc != xyes; then
slouken@0
  1565
       AC_MSG_ERROR([
slouken@0
  1566
*** Your compiler ($CC) does not produce Win32 executables!
slouken@0
  1567
       ])
slouken@0
  1568
    fi
slouken@0
  1569
slouken@0
  1570
    dnl See if the user wants to redirect standard output to files
slouken@0
  1571
    AC_ARG_ENABLE(stdio-redirect,
slouken@0
  1572
[  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
slouken@0
  1573
                  , enable_stdio_redirect=yes)
slouken@0
  1574
    if test x$enable_stdio_redirect != xyes; then
slouken@0
  1575
        CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
slouken@0
  1576
    fi
slouken@0
  1577
}
slouken@0
  1578
slouken@0
  1579
dnl Find the DirectX includes and libraries
slouken@0
  1580
CheckDIRECTX()
slouken@0
  1581
{
slouken@0
  1582
    AC_ARG_ENABLE(directx,
slouken@0
  1583
[  --enable-directx        use DirectX for Win32 audio/video [default=yes]],
slouken@0
  1584
                  , enable_directx=yes)
slouken@0
  1585
    if test x$enable_directx = xyes; then
slouken@0
  1586
        AC_MSG_CHECKING(for DirectX headers and libraries)
slouken@0
  1587
        use_directx=no
patmandin@780
  1588
        tmp_cflags=$CFLAGS
patmandin@780
  1589
        CFLAGS="$CFLAGS -I$srcdir"
slouken@0
  1590
        AC_TRY_COMPILE([
slouken@0
  1591
         #include "src/video/windx5/directx.h"
slouken@0
  1592
        ],[
slouken@0
  1593
        ],[
slouken@0
  1594
        use_directx=yes
slouken@0
  1595
        ])
patmandin@780
  1596
        CFLAGS=$tmp_cflags
slouken@0
  1597
        AC_MSG_RESULT($use_directx)
slouken@0
  1598
    fi
slouken@0
  1599
slouken@0
  1600
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
slouken@0
  1601
    SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
slouken@0
  1602
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
slouken@0
  1603
    VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
slouken@0
  1604
    # Enable the DIB driver
slouken@0
  1605
    CFLAGS="$CFLAGS -DENABLE_WINDIB"
slouken@0
  1606
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
slouken@0
  1607
    VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
slouken@0
  1608
    # See if we should enable the DirectX driver
slouken@0
  1609
    if test x$use_directx = xyes; then
slouken@0
  1610
        CFLAGS="$CFLAGS -DENABLE_DIRECTX"
slouken@0
  1611
        SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
slouken@0
  1612
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
slouken@0
  1613
        VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
slouken@0
  1614
    fi
slouken@0
  1615
}
slouken@0
  1616
slouken@0
  1617
dnl Set up the BWindow video driver on BeOS
slouken@0
  1618
CheckBWINDOW()
slouken@0
  1619
{
slouken@0
  1620
    CFLAGS="$CFLAGS -DENABLE_BWINDOW"
slouken@0
  1621
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
slouken@0
  1622
    VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
slouken@0
  1623
}
slouken@0
  1624
slouken@371
  1625
dnl Set up the QTopia video driver if enabled
slouken@371
  1626
CheckQtopia()
slouken@371
  1627
{
slouken@371
  1628
    AC_ARG_ENABLE(video-qtopia,
slouken@371
  1629
[  --enable-video-qtopia   use Qtopia video driver [default=no]],
slouken@371
  1630
                  , enable_video_qtopia=no)
slouken@371
  1631
    if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
slouken@371
  1632
        AC_MSG_CHECKING(for Qtopia support)
slouken@371
  1633
        video_qtopia=no
slouken@371
  1634
        AC_LANG_CPLUSPLUS
slouken@371
  1635
        OLD_CXX="$CXXFLAGS"
slouken@371
  1636
        CXXFLAGS="-DQT_QWS_EBX -fno-rtti -fno-exceptions -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG"
slouken@371
  1637
        AC_TRY_COMPILE([
slouken@371
  1638
         #include <qpe/qpeapplication.h>
slouken@371
  1639
        ],[
slouken@371
  1640
        ],[
slouken@371
  1641
        video_qtopia=yes
slouken@371
  1642
        ])
slouken@371
  1643
        CXXFLAGS="$OLD_CXX"
slouken@371
  1644
        AC_MSG_RESULT($video_qtopia)
slouken@371
  1645
        if test x$video_qtopia = xyes; then
slouken@371
  1646
            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
  1647
            SDL_LIBS="$SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
slouken@567
  1648
            SDL_CFLAGS="$SDL_CFLAGS -DQWS"	  
slouken@371
  1649
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS qtopia"
slouken@371
  1650
            VIDEO_DRIVERS="$VIDEO_DRIVERS qtopia/libvideo_qtopia.la"
slouken@567
  1651
        else
slouken@567
  1652
	AC_MSG_ERROR([
slouken@567
  1653
*** Failed to find Qtopia includes. Make sure that the QTDIR and QPEDIR
slouken@567
  1654
*** environment variables are set correctly.])
slouken@371
  1655
        fi
slouken@371
  1656
        AC_LANG_C
slouken@371
  1657
    fi
slouken@371
  1658
}
slouken@371
  1659
slouken@433
  1660
dnl Set up the PicoGUI video driver if enabled
slouken@433
  1661
CheckPicoGUI()
slouken@433
  1662
{
slouken@433
  1663
    AC_ARG_ENABLE(video-picogui,
slouken@433
  1664
[  --enable-video-picogui  use PicoGUI video driver [default=no]],
slouken@433
  1665
                  , enable_video_picogui=no)
slouken@433
  1666
    if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
slouken@433
  1667
        AC_MSG_CHECKING(for PicoGUI support)
slouken@433
  1668
        video_picogui=no
slouken@433
  1669
        AC_TRY_COMPILE([
slouken@433
  1670
         #include <picogui.h>
slouken@433
  1671
        ],[
slouken@433
  1672
        ],[
slouken@433
  1673
        video_picogui=yes
slouken@433
  1674
        ])
slouken@433
  1675
        AC_MSG_RESULT($video_picogui)
slouken@433
  1676
        if test x$video_picogui = xyes; then
slouken@433
  1677
	    SDL_LIBS="$SDL_LIBS -lpgui"
slouken@433
  1678
            CFLAGS="$CFLAGS -DENABLE_PICOGUI"
slouken@433
  1679
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS picogui"
slouken@433
  1680
            VIDEO_DRIVERS="$VIDEO_DRIVERS picogui/libvideo_picogui.la"
slouken@433
  1681
        fi
slouken@433
  1682
        AC_LANG_C
slouken@433
  1683
    fi
slouken@433
  1684
}
slouken@433
  1685
slouken@0
  1686
dnl Set up the Mac toolbox video driver for Mac OS 7-9
slouken@0
  1687
CheckTOOLBOX()
slouken@0
  1688
{
icculus@1133
  1689
    CFLAGS="$CFLAGS -DENABLE_TOOLBOX -DENABLE_DRAWSPROCKET"
slouken@0
  1690
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1691
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1692
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1693
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
icculus@1133
  1694
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
icculus@1133
  1695
    VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
slouken@0
  1696
}
slouken@0
  1697
icculus@1133
  1698
dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
slouken@0
  1699
CheckCARBON()
slouken@0
  1700
{
icculus@1133
  1701
    AC_ARG_ENABLE(video-carbon,
icculus@1133
  1702
[  --enable-video-carbon   use Carbon/QuickDraw video driver [default=no]],
icculus@1133
  1703
                  , enable_video_carbon=no)
icculus@1133
  1704
  if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
icculus@1133
  1705
    AC_MSG_CHECKING(for Carbon framework)
icculus@1133
  1706
    have_carbon=no
icculus@1133
  1707
    if test x$have_carbon != xyes; then
icculus@1133
  1708
        AC_TRY_COMPILE([
icculus@1133
  1709
          #include <Carbon/Carbon.h>
icculus@1133
  1710
        ],[
icculus@1133
  1711
        ],[
icculus@1133
  1712
        have_carbon=yes
icculus@1133
  1713
        ])
icculus@1133
  1714
    fi
icculus@1133
  1715
    AC_MSG_RESULT($have_carbon)
icculus@1133
  1716
    if test x$have_carbon = xyes; then
slouken@0
  1717
    # "MACOSX" is not an official definition, but it's commonly
slouken@0
  1718
    # accepted as a way to differentiate between what runs on X
slouken@0
  1719
    # and what runs on older Macs - while in theory "Carbon" defns
slouken@0
  1720
    # are consistent between the two, in practice Carbon is still
slouken@0
  1721
    # changing. -sts Aug 2000
slouken@0
  1722
    mac_autoconf_target_workaround="MAC"
slouken@0
  1723
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
slouken@0
  1724
      -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
  1725
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1726
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1727
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1728
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
icculus@1133
  1729
    #VIDEO_SUBDIRS="$VIDEO_SUBDIRS macdsp"
icculus@1133
  1730
    #VIDEO_DRIVERS="$VIDEO_DRIVERS macdsp/libvideo_macdsp.la"
icculus@1133
  1731
    fi
icculus@1133
  1732
  fi
slouken@0
  1733
}
slouken@0
  1734
icculus@1133
  1735
dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
icculus@1133
  1736
CheckCOCOA()
slouken@158
  1737
{
icculus@1133
  1738
    AC_ARG_ENABLE(video-cocoa,
icculus@1133
  1739
[  --enable-video-cocoa    use Cocoa/Quartz video driver [default=yes]],
icculus@1133
  1740
                  , enable_video_cocoa=yes)
icculus@1133
  1741
  if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
icculus@1133
  1742
    old_CFLAGS="$CFLAGS"
icculus@1133
  1743
    dnl work around that we don't have Objective-C support in autoconf
icculus@1133
  1744
    CFLAGS="$CFLAGS -x objective-c"
icculus@1133
  1745
    AC_MSG_CHECKING(for Cocoa framework)
icculus@1133
  1746
    have_cocoa=no
icculus@1133
  1747
    if test x$have_cocoa != xyes; then
icculus@1133
  1748
        AC_TRY_COMPILE([
icculus@1133
  1749
          #import <Cocoa/Cocoa.h>
icculus@1133
  1750
        ],[
icculus@1133
  1751
        ],[
icculus@1133
  1752
        have_cocoa=yes
icculus@1133
  1753
        ])
icculus@1133
  1754
    fi
icculus@1133
  1755
    AC_MSG_RESULT($have_cocoa)
icculus@1133
  1756
    CFLAGS="$old_CFLAGS"
icculus@1133
  1757
    if test x$have_cocoa = xyes; then
slouken@158
  1758
    # "MACOSX" is not an official definition, but it's commonly
slouken@158
  1759
    # accepted as a way to differentiate between what runs on X
slouken@158
  1760
    # and what runs on older Macs - while in theory "Carbon" defns
slouken@158
  1761
    # are consistent between the two, in practice Carbon is still
slouken@158
  1762
    # changing. -sts Aug 2000
slouken@166
  1763
    mac_autoconf_target_workaround="MAC"
slouken@158
  1764
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
slouken@158
  1765
      -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
slouken@166
  1766
      -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
slouken@158
  1767
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
slouken@158
  1768
    VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
icculus@1133
  1769
    fi
icculus@1133
  1770
  fi
slouken@158
  1771
}
slouken@158
  1772
slouken@294
  1773
dnl Check for the dlfcn.h interface for dynamically loading objects
slouken@294
  1774
CheckDLOPEN()
slouken@294
  1775
{
slouken@731
  1776
    AC_ARG_ENABLE(sdl-dlopen,
slouken@731
  1777
[  --enable-sdl-dlopen     use dlopen for shared object loading [default=yes]],
slouken@731
  1778
                  , enable_sdl_dlopen=yes)
slouken@731
  1779
    if test x$enable_sdl_dlopen = xyes; then
slouken@294
  1780
        AC_MSG_CHECKING(for dlopen)
slouken@294
  1781
        use_dlopen=no
slouken@294
  1782
        AC_TRY_COMPILE([
slouken@294
  1783
         #include <dlfcn.h>
slouken@294
  1784
        ],[
slouken@294
  1785
        ],[
slouken@294
  1786
        use_dlopen=yes
slouken@294
  1787
        ])
slouken@294
  1788
        AC_MSG_RESULT($use_dlopen)
slouken@294
  1789
slouken@294
  1790
        if test x$use_dlopen = xyes; then
slouken@294
  1791
            CFLAGS="$CFLAGS -DUSE_DLOPEN"
slouken@753
  1792
            AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
slouken@753
  1793
               AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
slouken@753
  1794
                  AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")))
slouken@294
  1795
        fi
slouken@294
  1796
    fi
slouken@294
  1797
}
slouken@294
  1798
patmandin@651
  1799
dnl Set up the Atari LDG (shared object loader)
patmandin@651
  1800
CheckAtariLdg()
patmandin@651
  1801
{
patmandin@651
  1802
    AC_ARG_ENABLE(atari-ldg,
patmandin@651
  1803
[  --enable-atari-ldg      use Atari LDG for shared object loading [default=yes]],
patmandin@651
  1804
                  , enable_atari_ldg=yes)
patmandin@651
  1805
    if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
patmandin@651
  1806
        AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
patmandin@651
  1807
        AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
patmandin@651
  1808
        if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
patmandin@651
  1809
            CFLAGS="$CFLAGS -DENABLE_LDG"
patmandin@824
  1810
            SYSTEM_LIBS="$SYSTEM_LIBS -lldg -lgem"
patmandin@651
  1811
        fi
patmandin@651
  1812
    fi
patmandin@651
  1813
}
patmandin@651
  1814
slouken@381
  1815
dnl Check for the usbhid(3) library on *BSD
slouken@381
  1816
CheckUSBHID()
slouken@381
  1817
{
slouken@381
  1818
    if test x$enable_joystick = xyes; then
slouken@381
  1819
        have_libusbhid=no
slouken@381
  1820
        have_libusb=no
slouken@381
  1821
        AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
slouken@381
  1822
        AC_CHECK_LIB(usb, hid_init, have_libusb=yes)
slouken@381
  1823
        if test x$have_libusbhid = xyes; then
slouken@381
  1824
            SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
slouken@381
  1825
        fi
slouken@381
  1826
        if test x$have_libusb = xyes; then
slouken@381
  1827
            SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
slouken@381
  1828
        fi
slouken@381
  1829
slouken@403
  1830
        AC_CHECK_HEADER(usb.h, have_usb_h=yes)
slouken@381
  1831
        AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes)
slouken@381
  1832
        AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
slouken@381
  1833
        AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes)
slouken@403
  1834
        if test x$have_usb_h = xyes; then
slouken@403
  1835
            CFLAGS="$CFLAGS -DHAVE_USB_H"
slouken@403
  1836
        fi
slouken@381
  1837
        if test x$have_usbhid_h = xyes; then
slouken@381
  1838
            CFLAGS="$CFLAGS -DHAVE_USBHID_H"
slouken@381
  1839
        fi
slouken@381
  1840
        if test x$have_libusb_h = xyes; then
slouken@381
  1841
            CFLAGS="$CFLAGS -DHAVE_LIBUSB_H"
slouken@381
  1842
        fi
slouken@381
  1843
        if test x$have_libusbhid_h = xyes; then
slouken@381
  1844
            CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H"
slouken@381
  1845
        fi
slouken@381
  1846
slouken@381
  1847
        AC_MSG_CHECKING(for usbhid)
slouken@381
  1848
        have_usbhid=no
slouken@381
  1849
        AC_TRY_COMPILE([
slouken@404
  1850
          #include <sys/types.h>
slouken@403
  1851
          #if defined(HAVE_USB_H)
slouken@403
  1852
          #include <usb.h>
slouken@403
  1853
          #endif
slouken@381
  1854
          #include <dev/usb/usb.h>
slouken@381
  1855
          #include <dev/usb/usbhid.h>
slouken@381
  1856
          #if defined(HAVE_USBHID_H)
slouken@381
  1857
          #include <usbhid.h>
slouken@381
  1858
          #elif defined(HAVE_LIBUSB_H)
slouken@381
  1859
          #include <libusb.h>
slouken@381
  1860
          #elif defined(HAVE_LIBUSBHID_H)
slouken@381
  1861
          #include <libusbhid.h>
slouken@404
  1862
          #endif
slouken@381
  1863
        ],[
slouken@381
  1864
          struct report_desc *repdesc;
slouken@381
  1865
          struct usb_ctl_report *repbuf;
slouken@402
  1866
          hid_kind_t hidkind;
slouken@381
  1867
        ],[
slouken@381
  1868
        have_usbhid=yes
slouken@381
  1869
        ])
slouken@381
  1870
        AC_MSG_RESULT($have_usbhid)
slouken@381
  1871
slouken@381
  1872
        if test x$have_usbhid = xyes; then
slouken@381
  1873
            AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
slouken@381
  1874
            have_usbhid_ucr_data=no
slouken@381
  1875
            AC_TRY_COMPILE([
slouken@404
  1876
              #include <sys/types.h>
slouken@404
  1877
              #if defined(HAVE_USB_H)
slouken@404
  1878
              #include <usb.h>
slouken@404
  1879
              #endif
slouken@381
  1880
              #include <dev/usb/usb.h>
slouken@381
  1881
              #include <dev/usb/usbhid.h>
slouken@381
  1882
              #if defined(HAVE_USBHID_H)
slouken@381
  1883
              #include <usbhid.h>
slouken@381
  1884
              #elif defined(HAVE_LIBUSB_H)
slouken@381
  1885
              #include <libusb.h>
slouken@381
  1886
              #elif defined(HAVE_LIBUSBHID_H)
slouken@381
  1887
              #include <libusbhid.h>
slouken@381
  1888
              #endif
slouken@381
  1889
            ],[
slouken@381
  1890
              struct usb_ctl_report buf;
slouken@381
  1891
              if (buf.ucr_data) { }
slouken@381
  1892
            ],[
slouken@381
  1893
            have_usbhid_ucr_data=yes
slouken@381
  1894
            ])
slouken@381
  1895
            if test x$have_usbhid_ucr_data = xyes; then
slouken@381
  1896
                CFLAGS="$CFLAGS -DUSBHID_UCR_DATA"
slouken@381
  1897
            fi
slouken@381
  1898
            AC_MSG_RESULT($have_usbhid_ucr_data)
slouken@407
  1899
            
slouken@407
  1900
	    AC_MSG_CHECKING(for new usbhid API)
slouken@407
  1901
            have_usbhid_new=no
slouken@407
  1902
            AC_TRY_COMPILE([
slouken@407
  1903
              #include <sys/types.h>
slouken@407
  1904
              #if defined(HAVE_USB_H)
slouken@407
  1905
              #include <usb.h>
slouken@407
  1906
              #endif
slouken@407
  1907
              #include <dev/usb/usb.h>
slouken@407
  1908
              #include <dev/usb/usbhid.h>
slouken@407
  1909
              #if defined(HAVE_USBHID_H)
slouken@407
  1910
              #include <usbhid.h>
slouken@407
  1911
              #elif defined(HAVE_LIBUSB_H)
slouken@407
  1912
              #include <libusb.h>
slouken@407
  1913
              #elif defined(HAVE_LIBUSBHID_H)
slouken@407
  1914
              #include <libusbhid.h>
slouken@407
  1915
              #endif
slouken@407
  1916
            ],[
slouken@407
  1917
              report_desc_t d;
slouken@407
  1918
	      hid_start_parse(d, 1, 1);
slouken@407
  1919
            ],[
slouken@407
  1920
            have_usbhid_new=yes
slouken@407
  1921
            ])
slouken@407
  1922
            if test x$have_usbhid_new = xyes; then
slouken@407
  1923
                CFLAGS="$CFLAGS -DUSBHID_NEW"
slouken@407
  1924
            fi
slouken@407
  1925
            AC_MSG_RESULT($have_usbhid_new)
slouken@381
  1926
slouken@381
  1927
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@381
  1928
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@381
  1929
        fi
slouken@381
  1930
    fi
slouken@381
  1931
}
slouken@381
  1932
slouken@795
  1933
dnl Check for altivec instruction support using gas syntax
slouken@795
  1934
CheckAltivec()
slouken@795
  1935
{
icculus@1162
  1936
    dnl FIXME: Theoretically, you might not have altivec.h, we should check
icculus@1162
  1937
    dnl FIXME:  that seperately, but I think all major platforms have it
icculus@1162
  1938
    dnl FIXME:  at the moment...  --ryan.
icculus@1162
  1939
icculus@1162
  1940
    save_CFLAGS="${CFLAGS}"
slouken@795
  1941
    have_gcc_altivec=no
icculus@1162
  1942
    AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
icculus@1162
  1943
    CFLAGS="${save_CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -maltivec"
slouken@795
  1944
    AC_TRY_COMPILE([
icculus@1162
  1945
    #include <altivec.h>
icculus@1047
  1946
    vector unsigned int vzero() {
icculus@1047
  1947
        return vec_splat_u32(0);
icculus@1047
  1948
    }
slouken@795
  1949
    ],[
slouken@795
  1950
    ],[
slouken@795
  1951
    have_gcc_altivec=yes
slouken@795
  1952
    ])
icculus@1162
  1953
    AC_MSG_RESULT($have_gcc_altivec)
icculus@1162
  1954
icculus@1162
  1955
    if test x$have_gcc_altivec = xno; then
icculus@1162
  1956
        AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
icculus@1162
  1957
        CFLAGS="${CFLAGS} -DGCC_ALTIVEC -DUSE_ALTIVEC_BLITTERS -faltivec"
icculus@1162
  1958
        AC_TRY_COMPILE([
icculus@1162
  1959
        #include <altivec.h>
icculus@1162
  1960
        vector unsigned int vzero() {
icculus@1162
  1961
            return vec_splat_u32(0);
icculus@1162
  1962
        }
icculus@1162
  1963
        ],[
icculus@1162
  1964
        ],[
icculus@1162
  1965
        have_gcc_altivec=yes
icculus@1162
  1966
        ])
icculus@1162
  1967
        AC_MSG_RESULT($have_gcc_altivec)
icculus@1162
  1968
    fi
icculus@1162
  1969
icculus@1047
  1970
    if test x$have_gcc_altivec = xno; then
icculus@1047
  1971
        CFLAGS="${save_CFLAGS}"
slouken@795
  1972
    fi
slouken@795
  1973
}
slouken@795
  1974
slouken@1062
  1975
dnl Check for a valid linux/version.h
slouken@1062
  1976
CheckLinuxVersion()
slouken@1062
  1977
{
slouken@1062
  1978
    AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
slouken@1062
  1979
    if test x$have_linux_version_h = xyes; then
slouken@1062
  1980
        CFLAGS="$CFLAGS -DHAVE_LINUX_VERSION_H"
slouken@1062
  1981
    fi
slouken@1062
  1982
}
slouken@1062
  1983
slouken@1127
  1984
dnl Check if we want to use RPATH
slouken@1127
  1985
CheckRPATH()
slouken@1127
  1986
{
slouken@1127
  1987
    AC_ARG_ENABLE(rpath,
slouken@1127
  1988
[  --enable-rpath          use an rpath when linking SDL [default=yes]],
slouken@1127
  1989
                  , enable_rpath=yes)
slouken@1127
  1990
}
slouken@1127
  1991
slouken@0
  1992
case "$target" in
icculus@1140
  1993
    arm-*-elf*)
icculus@1140
  1994
	ARCH=linux
icculus@1140
  1995
	CheckDummyVideo
icculus@1140
  1996
	CheckIPod
icculus@1140
  1997
	# Set up files for the timer library
icculus@1140
  1998
        if test x$enable_timers = xyes; then
icculus@1140
  1999
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
icculus@1140
  2000
        fi
icculus@1140
  2001
	;;
slouken@719
  2002
    *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
slouken@719
  2003
        case "$target" in
slouken@795
  2004
          *-*-linux*) ARCH=linux ;;
slouken@795
  2005
          *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
slouken@795
  2006
          *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
slouken@795
  2007
          *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
slouken@795
  2008
          *-*-gnu*) ARCH=gnu ;; # must be last
slouken@795
  2009
        esac
slouken@1
  2010
        CheckDummyVideo
slouken@68
  2011
        CheckDiskAudio
slouken@371
  2012
        CheckDLOPEN
slouken@0
  2013
        CheckNASM
slouken@0
  2014
        CheckOSS
slouken@0
  2015
        CheckALSA
slouken@0
  2016
        CheckARTSC
slouken@0
  2017
        CheckESD
slouken@0
  2018
        CheckNAS
slouken@0
  2019
        CheckX11
slouken@30
  2020
        CheckNANOX
slouken@0
  2021
        CheckDGA
slouken@0
  2022
        CheckFBCON
slouken@167
  2023
        CheckDirectFB
slouken@70
  2024
        CheckPS2GS
slouken@0
  2025
        CheckGGI
slouken@0
  2026
        CheckSVGA
slouken@0
  2027
        CheckAAlib
slouken@371
  2028
        CheckQtopia
slouken@433
  2029
        CheckPicoGUI
slouken@0
  2030
        CheckOpenGL
slouken@0
  2031
        CheckInputEvents
slouken@0
  2032
        CheckPTHREAD
slouken@814
  2033
        CheckSIGACTION
slouken@795
  2034
        CheckAltivec
slouken@1062
  2035
        CheckLinuxVersion
slouken@1127
  2036
        CheckRPATH
slouken@1062
  2037
slouken@0
  2038
        # Set up files for the main() stub
slouken@371
  2039
        if test "x$video_qtopia" = "xyes"; then
slouken@371
  2040
          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@371
  2041
          SDL_LIBS="-lSDLmain $SDL_LIBS"
slouken@371
  2042
        fi
slouken@0
  2043
        # Set up files for the audio library
slouken@0
  2044
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  2045
        #if test x$enable_audio = xyes; then
slouken@148
  2046
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2047
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2048
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2049
        #fi
slouken@0
  2050
        # Set up files for the joystick library
slouken@0
  2051
        if test x$enable_joystick = xyes; then
slouken@719
  2052
	  case $ARCH in
slouken@719
  2053
	    linux)
slouken@719
  2054
              JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
slouken@719
  2055
              JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
slouken@719
  2056
	    ;;
slouken@719
  2057
	    gnu)
slouken@719
  2058
              JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@719
  2059
              JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@719
  2060
	    ;;
slouken@719
  2061
	    k*bsd-gnu)
slouken@719
  2062
              JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@719
  2063
              JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@719
  2064
	    ;;
slouken@719
  2065
	  esac
slouken@0
  2066
        fi
slouken@0
  2067
        # Set up files for the cdrom library
slouken@0
  2068
        if test x$enable_cdrom = xyes; then
slouken@719
  2069
	  case $ARCH in
slouken@719
  2070
	    linux)
slouken@719
  2071
              CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
slouken@719
  2072
              CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
slouken@719
  2073
	    ;;
slouken@719
  2074
	    gnu)
slouken@719
  2075
              CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@719
  2076
              CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@719
  2077
	    ;;
slouken@719
  2078
	    kfreebsd-gnu)
slouken@719
  2079
              CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
slouken@719
  2080
              CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
slouken@719
  2081
	    ;;
slouken@719
  2082
	    knetbsd-gnu|kopenbsd-gnu)
slouken@719
  2083
              CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@719
  2084
              CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@719
  2085
	    ;;
slouken@719
  2086
	  esac
slouken@0
  2087
        fi
slouken@0
  2088
        # Set up files for the thread library
slouken@0
  2089
        if test x$enable_threads = xyes; then
slouken@399
  2090
            CopyUnixThreadSource
slouken@0
  2091
        fi
slouken@0
  2092
        # Set up files for the timer library
slouken@0
  2093
        if test x$enable_timers = xyes; then
slouken@0
  2094
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2095
        fi
slouken@0
  2096
        ;;
slouken@0
  2097
    *-*-bsdi*)
slouken@0
  2098
        ARCH=bsdi
slouken@1
  2099
        CheckDummyVideo
slouken@68
  2100
        CheckDiskAudio
slouken@371
  2101
        CheckDLOPEN
slouken@0
  2102
        CheckNASM
slouken@0
  2103
        CheckOSS
slouken@35
  2104
        CheckARTSC
slouken@35
  2105
        CheckESD
slouken@0
  2106
        CheckNAS
slouken@0
  2107
        CheckX11
slouken@0
  2108
        CheckDGA
slouken@0
  2109
        CheckSVGA
slouken@0
  2110
        CheckAAlib
slouken@0
  2111
        CheckOpenGL
slouken@0
  2112
        CheckPTHREAD
slouken@814
  2113
        CheckSIGACTION
slouken@1127
  2114
        CheckRPATH
slouken@148
  2115
        # Set up files for the audio library
slouken@148
  2116
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@148
  2117
        #if test x$enable_audio = xyes; then
slouken@148
  2118
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@148
  2119
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@148
  2120
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@148
  2121
        #fi
slouken@0
  2122
        # Set up files for the joystick library
slouken@0
  2123
        # (No joystick support yet)
slouken@0
  2124
        if test x$enable_joystick = xyes; then
slouken@0
  2125
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2126
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2127
        fi
slouken@0
  2128
        # Set up files for the cdrom library
slouken@0
  2129
        if test x$enable_cdrom = xyes; then
slouken@178
  2130
            CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
slouken@178
  2131
            CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
slouken@0
  2132
        fi
slouken@0
  2133
        # Set up files for the thread library
slouken@0
  2134
        if test x$enable_threads = xyes; then
slouken@399
  2135
            CopyUnixThreadSource
slouken@0
  2136
        fi
slouken@0
  2137
        # Set up files for the timer library
slouken@0
  2138
        if test x$enable_timers = xyes; then
slouken@0
  2139
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2140
        fi
slouken@0
  2141
        ;;
slouken@0
  2142
    *-*-freebsd*)
slouken@0
  2143
        ARCH=freebsd
slouken@1
  2144
        CheckDummyVideo
slouken@68
  2145
        CheckDiskAudio
slouken@371
  2146
        CheckDLOPEN
slouken@129
  2147
        CheckVGL
slouken@0
  2148
        CheckNASM
slouken@0
  2149
        CheckOSS
slouken@0
  2150
        CheckARTSC
slouken@0
  2151
        CheckESD
slouken@0
  2152
        CheckNAS
slouken@0
  2153
        CheckX11
slouken@0
  2154
        CheckDGA
slouken@0
  2155
        CheckSVGA
slouken@0
  2156
        CheckAAlib
slouken@0
  2157
        CheckOpenGL
slouken@0
  2158
        CheckPTHREAD
slouken@814
  2159
        CheckSIGACTION
slouken@381
  2160
        CheckUSBHID
slouken@1127
  2161
        CheckRPATH
slouken@0
  2162
        # Set up files for the audio library
slouken@0
  2163
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  2164
        #if test x$enable_audio = xyes; then
slouken@148
  2165
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2166
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2167
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2168
        #fi
slouken@0
  2169
        # Set up files for the cdrom library
slouken@0
  2170
        if test x$enable_cdrom = xyes; then
slouken@153
  2171
            CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
slouken@153
  2172
            CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
slouken@0
  2173
        fi
slouken@0
  2174
        # Set up files for the thread library
slouken@0
  2175
        if test x$enable_threads = xyes; then
slouken@399
  2176
            CopyUnixThreadSource
slouken@0
  2177
        fi
slouken@0
  2178
        # Set up files for the timer library
slouken@0
  2179
        if test x$enable_timers = xyes; then
slouken@0
  2180
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2181
        fi
slouken@0
  2182
        ;;
slouken@0
  2183
    *-*-netbsd*)
slouken@0
  2184
        ARCH=netbsd
slouken@1
  2185
        CheckDummyVideo
slouken@68
  2186
        CheckDiskAudio
slouken@371
  2187
        CheckDLOPEN
slouken@0
  2188
        CheckNASM
slouken@0
  2189
        CheckOSS
slouken@0
  2190
        CheckARTSC
slouken@0
  2191
        CheckESD
slouken@0
  2192
        CheckNAS
slouken@0
  2193
        CheckX11
slouken@0
  2194
        CheckAAlib
slouken@0
  2195
        CheckOpenGL
slouken@0
  2196
        CheckPTHREAD
slouken@814
  2197
        CheckSIGACTION
slouken@381
  2198
        CheckUSBHID
slouken@1127
  2199
        CheckRPATH
slouken@0
  2200
        # Set up files for the audio library
slouken@0
  2201
        if test x$enable_audio = xyes; then
slouken@148
  2202
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2203
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2204
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2205
        fi
slouken@0
  2206
        # Set up files for the cdrom library
slouken@0
  2207
        if test x$enable_cdrom = xyes; then
slouken@153
  2208
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@153
  2209
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@0
  2210
        fi
slouken@0
  2211
        # Set up files for the thread library
slouken@0
  2212
        if test x$enable_threads = xyes; then
slouken@401
  2213
            if test x$use_pthreads = xyes; then
slouken@401
  2214
                CFLAGS="$CFLAGS -D_POSIX_THREAD_SYSCALL_SOFT=1"
slouken@401
  2215
            fi
slouken@399
  2216
            CopyUnixThreadSource
slouken@0
  2217
        fi
slouken@0
  2218
        # Set up files for the timer library
slouken@0
  2219
        if test x$enable_timers = xyes; then
slouken@0
  2220
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2221
        fi
slouken@0
  2222
        # NetBSD does not define "unix"
slouken@401
  2223
        CFLAGS="$CFLAGS -Dunix"
slouken@0
  2224
        ;;
slouken@0
  2225
    *-*-openbsd*)
slouken@0
  2226
        ARCH=openbsd
slouken@1
  2227
        CheckDummyVideo
slouken@68
  2228
        CheckDiskAudio
slouken@371
  2229
        CheckDLOPEN
slouken@0
  2230
        CheckNASM
slouken@0
  2231
        CheckOSS
slouken@0
  2232
        CheckARTSC
slouken@0
  2233
        CheckESD
slouken@0
  2234
        CheckNAS
slouken@0
  2235
        CheckX11
slouken@0
  2236
        CheckAAlib
slouken@0
  2237
        CheckOpenGL
slouken@0
  2238
        CheckPTHREAD
slouken@814
  2239
        CheckSIGACTION
slouken@381
  2240
        CheckUSBHID
slouken@1127
  2241
        CheckRPATH
slouken@0
  2242
        # Set up files for the audio library
slouken@360
  2243
        if test x$enable_audio = xyes; then
slouken@360
  2244
            CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
slouken@360
  2245
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
slouken@360
  2246
            AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
slouken@360
  2247
        fi
slouken@94
  2248
        # OpenBSD needs linking with ossaudio emulation library
slouken@94
  2249
        if test x$have_oss = xyes; then
slouken@94
  2250
            SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
slouken@94
  2251
        fi
slouken@0
  2252
        # Set up files for the cdrom library
slouken@0
  2253
        if test x$enable_cdrom = xyes; then
slouken@153
  2254
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@153
  2255
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@0
  2256
        fi
slouken@0
  2257
        # Set up files for the thread library
slouken@0
  2258
        if test x$enable_threads = xyes; then
slouken@399
  2259
            CopyUnixThreadSource
slouken@0
  2260
        fi
slouken@0
  2261
        # Set up files for the timer library
slouken@0
  2262
        if test x$enable_timers = xyes; then
slouken@0
  2263
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2264
        fi
slouken@37
  2265
        # OpenBSD does not define "unix"
slouken@37
  2266
        CFLAGS="$CFLAGS -Dunix"
slouken@0
  2267
        ;;
slouken@0
  2268
    *-*-sysv5*)
slouken@0
  2269
        ARCH=sysv5
slouken@1
  2270
        CheckDummyVideo
slouken@68
  2271
        CheckDiskAudio
slouken@371
  2272
        CheckDLOPEN
slouken@0
  2273
        CheckNASM
slouken@0
  2274
        CheckOSS
slouken@0
  2275
        CheckARTSC
slouken@0
  2276
        CheckESD
slouken@0
  2277
        CheckNAS
slouken@0
  2278
        CheckX11
slouken@0
  2279
        CheckAAlib
slouken@0
  2280
        CheckOpenGL
slouken@0
  2281
        CheckPTHREAD
slouken@814
  2282
        CheckSIGACTION
slouken@1127
  2283
        CheckRPATH
slouken@0
  2284
        # Set up files for the audio library
slouken@0
  2285
        if test x$enable_audio = xyes; then
slouken@148
  2286
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2287
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2288
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2289
        fi
slouken@0
  2290
        # Set up files for the joystick library
slouken@0
  2291
        # (No joystick support yet)
slouken@0
  2292
        if test x$enable_joystick = xyes; then
slouken@0
  2293
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2294
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2295
        fi
slouken@0
  2296
        # Set up files for the cdrom library
slouken@0
  2297
        if test x$enable_cdrom = xyes; then
slouken@153
  2298
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  2299
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  2300
        fi
slouken@0
  2301
        # Set up files for the thread library
slouken@0
  2302
        if test x$enable_threads = xyes; then
slouken@399
  2303
            CopyUnixThreadSource
slouken@0
  2304
        fi
slouken@0
  2305
        # Set up files for the timer library
slouken@0
  2306
        if test x$enable_timers = xyes; then
slouken@0
  2307
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2308
        fi
slouken@0
  2309
        ;;
slouken@0
  2310
    *-*-solaris*)
slouken@0
  2311
        ARCH=solaris
slouken@1
  2312
        CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
slouken@1
  2313
        CheckDummyVideo
slouken@68
  2314
        CheckDiskAudio
slouken@371
  2315
        CheckDLOPEN
slouken@0
  2316
        CheckNASM
slouken@35
  2317
        CheckOSS
slouken@0
  2318
        CheckARTSC
slouken@0
  2319
        CheckESD
slouken@0
  2320
        CheckNAS
slouken@0
  2321
        CheckX11
slouken@0
  2322
        CheckAAlib
slouken@0
  2323
        CheckOpenGL
slouken@0
  2324
        CheckPTHREAD
slouken@814
  2325
        CheckSIGACTION
slouken@1127
  2326
        CheckRPATH
slouken@0
  2327
        # Set up files for the audio library
slouken@0
  2328
        if test x$enable_audio = xyes; then
slouken@148
  2329
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2330
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2331
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2332
        fi
slouken@0
  2333
        # Set up files for the joystick library
slouken@0
  2334
        # (No joystick support yet)
slouken@0
  2335
        if test x$enable_joystick = xyes; then
slouken@0
  2336
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2337
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2338
        fi
slouken@0
  2339
        # Set up files for the cdrom library
slouken@0
  2340
        if test x$enable_cdrom = xyes; then
slouken@153
  2341
            CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
slouken@153
  2342
            CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
slouken@0
  2343
        fi
slouken@0
  2344
        # Set up files for the thread library
slouken@0
  2345
        if test x$enable_threads = xyes; then
slouken@399
  2346
            CopyUnixThreadSource
slouken@0
  2347
        fi
slouken@0
  2348
        # Set up files for the timer library
slouken@0
  2349
        if test x$enable_timers = xyes; then
slouken@0
  2350
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2351
        fi
slouken@0
  2352
        ;;
slouken@0
  2353
    *-*-irix*)
slouken@0
  2354
        ARCH=irix
slouken@1
  2355
        CheckDummyVideo
slouken@68
  2356
        CheckDiskAudio
slouken@371
  2357
        CheckDLOPEN
slouken@148
  2358
        CheckDMEDIA
slouken@148
  2359
        CheckESD
slouken@0
  2360
        CheckNAS
slouken@0
  2361
        CheckX11
slouken@0
  2362
        CheckAAlib
slouken@0
  2363
        CheckOpenGL
slouken@0
  2364
        CheckPTHREAD
slouken@814
  2365
        CheckSIGACTION
slouken@148
  2366
        # We use the dmedia audio API, not the Sun audio API
slouken@148
  2367
        #if test x$enable_audio = xyes; then
slouken@148
  2368
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@148
  2369
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@148
  2370
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@148
  2371
        #fi
slouken@0
  2372
        # Set up files for the joystick library
slouken@0
  2373
        # (No joystick support yet)
slouken@0
  2374
        if test x$enable_joystick = xyes; then
slouken@0
  2375
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2376
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2377
        fi
slouken@0
  2378
        # Set up files for the cdrom library
slouken@0
  2379
        # (No CD-ROM support yet)
slouken@0
  2380
        if test x$enable_cdrom = xyes; then
slouken@153
  2381
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  2382
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  2383
        fi
slouken@0
  2384
        # Set up files for the thread library
slouken@0
  2385
        if test x$enable_threads = xyes; then
slouken@399
  2386
            if test x$use_pthreads = xyes -o x$use_pth = xyes; then
slouken@399
  2387
                CopyUnixThreadSource
slouken@0
  2388
            else
slouken@0
  2389
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
slouken@0
  2390
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
slouken@0
  2391
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  2392
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  2393
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  2394
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2395
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2396
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2397
            fi
slouken@0
  2398
        fi
slouken@0
  2399
        # Set up files for the timer library
slouken@0
  2400
        if test x$enable_timers = xyes; then
slouken@0
  2401
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2402
        fi
slouken@0
  2403
        ;;
slouken@0
  2404
    *-*-hpux*)
slouken@0
  2405
        ARCH=hpux
slouken@1
  2406
        CheckDummyVideo
slouken@68
  2407
        CheckDiskAudio
slouken@371
  2408
        CheckDLOPEN
slouken@35
  2409
        CheckOSS
slouken@0
  2410
        CheckNAS
slouken@0
  2411
        CheckX11
slouken@0
  2412
        CheckGGI
slouken@0
  2413
        CheckAAlib
slouken@0
  2414
        CheckOpenGL
slouken@0
  2415
        CheckPTHREAD
slouken@814
  2416
        CheckSIGACTION
slouken@0
  2417
        # Set up files for the audio library
slouken@0
  2418
        if test x$enable_audio = xyes; then
slouken@148
  2419
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  2420
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  2421
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  2422
        fi
slouken@0
  2423
        # Set up files for the joystick library
slouken@0
  2424
        # (No joystick support yet)
slouken@0
  2425
        if test x$enable_joystick = xyes; then
slouken@0
  2426
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2427
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2428
        fi
slouken@0
  2429
        # Set up files for the cdrom library
slouken@0
  2430
        # (No CD-ROM support yet)
slouken@0
  2431
        if test x$enable_cdrom = xyes; then
slouken@153
  2432
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  2433
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  2434
        fi
slouken@0
  2435
        # Set up files for the thread library
slouken@0
  2436
        if test x$enable_threads = xyes; then
slouken@399
  2437
            CopyUnixThreadSource
slouken@0
  2438
        fi
slouken@0
  2439
        # Set up files for the timer library
slouken@0
  2440
        if test x$enable_timers = xyes; then
slouken@0
  2441
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2442
        fi
slouken@0
  2443
        ;;
slouken@0
  2444
    *-*-aix*)
slouken@0
  2445
        ARCH=aix
slouken@1
  2446
        CheckDummyVideo
slouken@68
  2447
        CheckDiskAudio
slouken@371
  2448
        CheckDLOPEN
slouken@35
  2449
        CheckOSS
slouken@0
  2450
        CheckNAS
slouken@0
  2451
        CheckX11
slouken@0
  2452
        CheckGGI
slouken@0
  2453
        CheckAAlib
slouken@0
  2454
        CheckOpenGL
slouken@0
  2455
        CheckPTHREAD
slouken@814
  2456
        CheckSIGACTION
slouken@0
  2457
        # Set up files for the audio library
slouken@0
  2458
        if test x$enable_audio = xyes; then
slouken@0
  2459
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
slouken@0
  2460
            AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
slouken@0
  2461
        fi
slouken@0
  2462
        # Set up files for the joystick library
slouken@0
  2463
        # (No joystick support yet)
slouken@0
  2464
        if test x$enable_joystick = xyes; then
slouken@0
  2465
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2466
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2467
        fi
slouken@0
  2468
        # Set up files for the cdrom library
slouken@0
  2469
        if test x$enable_cdrom = xyes; then
slouken@153
  2470
            CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
slouken@153
  2471
            CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
slouken@0
  2472
        fi
slouken@0
  2473
        # Set up files for the thread library
slouken@0
  2474
        if test x$enable_threads = xyes; then
slouken@399
  2475
            CopyUnixThreadSource
slouken@0
  2476
        fi
slouken@0
  2477
        # Set up files for the timer library
slouken@0
  2478
        if test x$enable_timers = xyes; then
slouken@0
  2479
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2480
        fi
slouken@0
  2481
        ;;
slouken@0
  2482
    *-*-osf*)
slouken@0
  2483
        ARCH=osf
slouken@1
  2484
        CheckDummyVideo
slouken@68
  2485
        CheckDiskAudio
slouken@371
  2486
        CheckDLOPEN
slouken@0
  2487
        CheckNAS
slouken@0
  2488
        CheckX11
slouken@0
  2489
        CheckGGI
slouken@0
  2490
        CheckAAlib
slouken@0
  2491
        CheckOpenGL
slouken@0
  2492
        CheckPTHREAD
slouken@814
  2493
        CheckSIGACTION
slouken@0
  2494
        # Set up files for the audio library
slouken@0
  2495
        if test x$enable_audio = xyes; then
slouken@654
  2496
            CFLAGS="$CFLAGS -I/usr/include/mme -DMMEAUDIO_SUPPORT"
slouken@654
  2497
            SYSTEM_LIBS="$SYSTEM_LIBS -lmme"
slouken@654
  2498
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS mme"
slouken@654
  2499
            AUDIO_DRIVERS="$AUDIO_DRIVERS mme/libaudio_mme.la"
slouken@0
  2500
        fi
slouken@0
  2501
        # Set up files for the joystick library
slouken@0
  2502
        # (No joystick support yet)
slouken@0
  2503
        if test x$enable_joystick = xyes; then
slouken@0
  2504
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2505
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2506
        fi
slouken@0
  2507
        # Set up files for the cdrom library
slouken@0
  2508
        # (No cdrom support yet)
slouken@0
  2509
        if test x$enable_cdrom = xyes; then
slouken@654
  2510
            CDROM_SUBDIRS="$CDROM_SUBDIRS osf"
slouken@654
  2511
            CDROM_DRIVERS="$CDROM_DRIVERS osf/libcdrom_osf.la"
slouken@0
  2512
        fi
slouken@0
  2513
        # Set up files for the thread library
slouken@0
  2514
        if test x$enable_threads = xyes; then
slouken@399
  2515
            CopyUnixThreadSource
slouken@0
  2516
        fi
slouken@0
  2517
        # Set up files for the timer library
slouken@0
  2518
        if test x$enable_timers = xyes; then
slouken@0
  2519
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2520
        fi
slouken@0
  2521
        ;;
slouken@0
  2522
    *-*-qnx*)
slouken@0
  2523
        ARCH=qnx
slouken@1
  2524
        CheckDummyVideo
slouken@68
  2525
        CheckDiskAudio
slouken@886
  2526
        # CheckNASM
slouken@371
  2527
        CheckDLOPEN
slouken@0
  2528
        CheckNAS
slouken@0
  2529
        CheckPHOTON
slouken@0
  2530
        CheckX11
slouken@0
  2531
        CheckOpenGL
slouken@0
  2532
        CheckPTHREAD
slouken@814
  2533
        CheckSIGACTION
slouken@0
  2534
        # Set up files for the audio library
slouken@0
  2535
        if test x$enable_audio = xyes; then
slouken@666
  2536
            CFLAGS="$CFLAGS -DQNXNTOAUDIO_SUPPORT"
slouken@0
  2537
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
slouken@0
  2538
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
slouken@0
  2539
            AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
slouken@0
  2540
        fi
slouken@0
  2541
        # Set up files for the joystick library
slouken@0
  2542
        if test x$enable_joystick = xyes; then
slouken@0
  2543
        # (No joystick support yet)
slouken@0
  2544
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  2545
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  2546
        fi
slouken@0
  2547
        # Set up files for the cdrom library
slouken@0
  2548
        if test x$enable_cdrom = xyes; then
slouken@153
  2549
            CDROM_SUBDIRS="$CDROM_SUBDIRS qnx"
slouken@153
  2550
            CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la"
slouken@0
  2551
        fi
slouken@0
  2552
        # Set up files for the thread library
slouken@0
  2553
        if test x$enable_threads = xyes; then
slouken@399
  2554
            CopyUnixThreadSource
slouken@0
  2555
        fi
slouken@0
  2556
        # Set up files for the timer library
slouken@0
  2557
        if test x$enable_timers = xyes; then
slouken@0
  2558
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2559
        fi
slouken@0
  2560
        ;;
slouken@0
  2561
    *-*-cygwin* | *-*-mingw32*)
slouken@0
  2562
        ARCH=win32
slouken@0
  2563
        if test "$build" != "$target"; then # cross-compiling
slouken@0
  2564
            # Default cross-compile location
slouken@0
  2565
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
slouken@0
  2566
        else
slouken@0
  2567
            # Look for the location of the tools and install there
slouken@750
  2568
            if test "$BUILD_PREFIX" != ""; then
slouken@1
  2569
                ac_default_prefix=$BUILD_PREFIX
slouken@1
  2570
            fi
slouken@0
  2571
        fi
slouken@1
  2572
        CheckDummyVideo
slouken@68
  2573
        CheckDiskAudio
slouken@0
  2574
        CheckWIN32
slouken@0
  2575
        CheckDIRECTX
slouken@0
  2576
        CheckNASM
slouken@0
  2577
        # Set up files for the audio library
slouken@0
  2578
        if test x$enable_audio = xyes; then
slouken@0
  2579
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
slouken@0
  2580
            AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
slouken@0
  2581
            if test x$use_directx = xyes; then
slouken@41
  2582
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
slouken@41
  2583
                AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
slouken@0
  2584
            fi
slouken@0
  2585
        fi
slouken@0
  2586
        # Set up files for the joystick library
slouken@0
  2587
        if test x$enable_joystick = xyes; then
slouken@0
  2588
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
slouken@0
  2589
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
slouken@0
  2590
        fi
slouken@0
  2591
        # Set up files for the cdrom library
slouken@0
  2592
        if test x$enable_cdrom = xyes; then
slouken@153
  2593
            CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
slouken@153
  2594
            CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
slouken@0
  2595
        fi
slouken@0
  2596
        # Set up files for the thread library
slouken@0
  2597
        if test x$enable_threads = xyes; then
slouken@0
  2598
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
slouken@0
  2599
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
slouken@0
  2600
            COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
slouken@0
  2601
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2602
            COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
slouken@0
  2603
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2604
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2605
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2606
        fi
slouken@0
  2607
        # Set up files for the timer library
slouken@0
  2608
        if test x$enable_timers = xyes; then
slouken@0
  2609
            COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
slouken@0
  2610
        fi
slouken@0
  2611
        # The Win32 platform requires special setup
slouken@0
  2612
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@1
  2613
        case "$target" in
slouken@1
  2614
            *-*-cygwin*)
slouken@263
  2615
                CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
slouken@263
  2616
                SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
slouken@1
  2617
                LIBS="$LIBS -mno-cygwin"
slouken@1
  2618
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
slouken@1
  2619
                ;;
slouken@1
  2620
            *-*-mingw32*)
slouken@1
  2621
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
slouken@1
  2622
                ;;
slouken@1
  2623
        esac
slouken@0
  2624
        ;;
slouken@0
  2625
    *-*-beos*)
slouken@0
  2626
        ARCH=beos
slouken@0
  2627
        ac_default_prefix=/boot/develop/tools/gnupro
slouken@1
  2628
        CheckDummyVideo
slouken@68
  2629
        CheckDiskAudio
slouken@0
  2630
        CheckNASM
slouken@0
  2631
        CheckBWINDOW
slouken@0
  2632
        CheckBeGL
slouken@0
  2633
        # Set up files for the audio library
slouken@0
  2634
        if test x$enable_audio = xyes; then
slouken@0
  2635
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
slouken@0
  2636
            AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
slouken@0
  2637
        fi
slouken@0
  2638
        # Set up files for the joystick library
slouken@0
  2639
        if test x$enable_joystick = xyes; then
slouken@0
  2640
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
slouken@0
  2641
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
slouken@0
  2642
        fi
slouken@0
  2643
        # Set up files for the cdrom library
slouken@0
  2644
        if test x$enable_cdrom = xyes; then
slouken@153
  2645
            CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
slouken@153
  2646
            CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
slouken@0
  2647
        fi
slouken@0
  2648
        # Set up files for the thread library
slouken@0
  2649
        if test x$enable_threads = xyes; then
slouken@0
  2650
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
slouken@0
  2651
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
slouken@0
  2652
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  2653
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2654
            COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
slouken@0
  2655
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2656
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2657
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2658
        fi
slouken@0
  2659
        # Set up files for the timer library
slouken@0
  2660
        if test x$enable_timers = xyes; then
slouken@0
  2661
            COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
slouken@0
  2662
        fi
slouken@0
  2663
        # The BeOS platform requires special libraries
slouken@0
  2664
        SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
slouken@0
  2665
        ;;
slouken@0
  2666
    *-*-macos*)
slouken@0
  2667
        # This would be used if cross-compiling to MacOS 9.  No way to
slouken@0
  2668
        # use it at present, but Apple is working on a X-to-9 compiler
slouken@0
  2669
        # for which this case would be handy.
slouken@0
  2670
        ARCH=macos
slouken@1
  2671
        CheckDummyVideo
slouken@68
  2672
        CheckDiskAudio
slouken@0
  2673
        CheckTOOLBOX
slouken@0
  2674
        CheckMacGL
slouken@0
  2675
        # Set up files for the audio library
slouken@0
  2676
        if test x$enable_audio = xyes; then
slouken@0
  2677
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  2678
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
slouken@0
  2679
        fi
slouken@0
  2680
        # Set up files for the joystick library
slouken@0
  2681
        if test x$enable_joystick = xyes; then
slouken@0
  2682
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
slouken@0
  2683
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
slouken@0
  2684
        fi
slouken@0
  2685
        # Set up files for the cdrom library
slouken@0
  2686
        if test x$enable_cdrom = xyes; then
slouken@153
  2687
            CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
slouken@153
  2688
            CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
slouken@0
  2689
        fi
slouken@0
  2690
        # Set up files for the thread library
slouken@0
  2691
        if test x$enable_threads = xyes; then
slouken@0
  2692
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
slouken@0
  2693
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
slouken@0
  2694
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  2695
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2696
            COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
slouken@0
  2697
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2698
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2699
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2700
        fi
slouken@0
  2701
        # Set up files for the timer library
slouken@0
  2702
        if test x$enable_timers = xyes; then
slouken@0
  2703
            COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
slouken@0
  2704
        fi
slouken@0
  2705
        # The MacOS platform requires special setup
slouken@0
  2706
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@0
  2707
        SDL_LIBS="-lSDLmain $SDL_LIBS"
slouken@0
  2708
        ;;
slouken@0
  2709
    *-*-darwin* )
icculus@1133
  2710
        # This could be either full "Mac OS X", or plain "Darwin" which is
slouken@158
  2711
        # just the OS X kernel sans upper layers like Carbon and Cocoa.
icculus@1133
  2712
        # Next line is broken, and a few files below require Mac OS X (full)
slouken@158
  2713
        ARCH=macosx
slouken@1
  2714
        CheckDummyVideo
slouken@68
  2715
        CheckDiskAudio
icculus@1133
  2716
        CheckCOCOA
icculus@1133
  2717
        CheckCARBON
icculus@1133
  2718
        CheckMacX11
slouken@0
  2719
        CheckMacGL
slouken@0
  2720
        CheckPTHREAD
slouken@814
  2721
        CheckSIGACTION
icculus@1047
  2722
        CheckAltivec
slouken@935
  2723
        # If either the audio or CD driver is used, add the AudioUnit framework
slouken@935
  2724
        if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
slouken@935
  2725
            SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit"
slouken@935
  2726
        fi
slouken@0
  2727
        # Set up files for the audio library
slouken@0
  2728
        if test x$enable_audio = xyes; then
slouken@936
  2729
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macosx"
slouken@936
  2730
            AUDIO_DRIVERS="$AUDIO_DRIVERS macosx/libaudio_macosx.la"
slouken@0
  2731
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  2732
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
slouken@0
  2733
        fi
slouken@0
  2734
        # Set up files for the joystick library
slouken@0
  2735
        if test x$enable_joystick = xyes; then
slouken@172
  2736
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
slouken@172
  2737
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
slouken@387
  2738
            SYSTEM_LIBS="$SYSTEM_LIBS -framework IOKit"
slouken@0
  2739
        fi
slouken@0
  2740
        # Set up files for the cdrom library
slouken@0
  2741
        if test x$enable_cdrom = xyes; then
slouken@768
  2742
            CDROM_SUBDIRS="$CDROM_SUBDIRS macosx"
slouken@768
  2743
            CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la"
slouken@935
  2744
            SYSTEM_LIBS="$SYSTEM_LIBS -lstdc++"
slouken@0
  2745
        fi
slouken@0
  2746
        # Set up files for the thread library
slouken@0
  2747
        if test x$enable_threads = xyes; then
slouken@399
  2748
            CopyUnixThreadSource
slouken@0
  2749
        fi
slouken@0
  2750
        # Set up files for the timer library
slouken@0
  2751
        if test x$enable_timers = xyes; then
slouken@0
  2752
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2753
        fi
slouken@387
  2754
        # The MacOS X platform requires special setup.
slouken@387
  2755
        SDL_LIBS="-lSDLmain $SDL_LIBS"
icculus@1133
  2756
        if test x$enable_video_cocoa = xyes; then
icculus@1133
  2757
            SYSTEM_LIBS="$SYSTEM_LIBS -framework Cocoa"
icculus@1133
  2758
        fi
icculus@1133
  2759
        if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
icculus@1133
  2760
            # The Cocoa backend still needs Carbon, and the YUV code QuickTime
icculus@1133
  2761
            SYSTEM_LIBS="$SYSTEM_LIBS -framework Carbon -framework QuickTime"
icculus@1133
  2762
        fi
icculus@1133
  2763
        #if test x$enable_video_carbon = xyes; then
icculus@1133
  2764
        #    SYSTEM_LIBS="$SYSTEM_LIBS -framework DrawSprocket"
icculus@1133
  2765
        #fi
slouken@0
  2766
        ;;
slouken@281
  2767
    *-*-mint*)
slouken@281
  2768
        ARCH=mint
slouken@281
  2769
        CheckDummyVideo
slouken@281
  2770
        CheckDiskAudio
slouken@281
  2771
        CheckAtariBiosEvent
slouken@281
  2772
        CheckAtariXbiosVideo
slouken@281
  2773
        CheckAtariGemVideo
slouken@398
  2774
        CheckAtariAudio
patmandin@651
  2775
        CheckAtariLdg
patmandin@989
  2776
		CheckAtariOSMesa
slouken@281
  2777
        CheckPTH
slouken@281
  2778
        # Set up files for the audio library
slouken@398
  2779
        if test x$enable_threads = xyes -a x$enable_pth = xyes; then
slouken@398
  2780
            if test x$enable_audio = xyes; then
slouken@398
  2781
                CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@398
  2782
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@398
  2783
                AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@398
  2784
            fi
slouken@281
  2785
        fi
slouken@281
  2786
        # Set up files for the joystick library
slouken@281
  2787
        if test x$enable_joystick = xyes; then
slouken@302
  2788
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS mint"
slouken@302
  2789
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS mint/libjoystick_mint.la"
slouken@281
  2790
        fi
slouken@281
  2791
        # Set up files for the cdrom library
slouken@281
  2792
        if test x$enable_cdrom = xyes; then
patmandin@724
  2793
            CDROM_SUBDIRS="$CDROM_SUBDIRS mint"
patmandin@724
  2794
            CDROM_DRIVERS="$CDROM_DRIVERS mint/libcdrom_mint.la"
slouken@281
  2795
        fi
slouken@281
  2796
        # Set up files for the thread library
slouken@281
  2797
        if test x$enable_threads = xyes; then
slouken@399
  2798
            CopyUnixThreadSource
slouken@281
  2799
        fi
slouken@281
  2800
        # Set up files for the timer library
slouken@281
  2801
        if test x$enable_timers = xyes; then
slouken@557
  2802
            if test x$enable_threads = xyes -a x$enable_pth = xyes; then
slouken@557
  2803
                COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@557
  2804
            else
slouken@557
  2805
                COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
slouken@557
  2806
            fi
slouken@281
  2807
        fi
slouken@281
  2808
        # MiNT does not define "unix"
slouken@281
  2809
        CFLAGS="$CFLAGS -Dunix"
slouken@281
  2810
        ;;
slouken@1035
  2811
    *-riscos)
slouken@687
  2812
        ARCH=riscos
slouken@955
  2813
        # Set up files for the video library
slouken@955
  2814
        if test x$enable_video = xyes; then
slouken@955
  2815
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS riscos"
slouken@955
  2816
            VIDEO_DRIVERS="$VIDEO_DRIVERS riscos/libvideo_riscos.la"
slouken@955
  2817
        fi
slouken@955
  2818
        # Set up files for the audio library
slouken@955
  2819
        if test x$enable_audio = xyes; then
slouken@1035
  2820
            CFLAGS="$CFLAGS -DOSS_SUPPORT"
slouken@1035
  2821
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
slouken@1035
  2822
            AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
slouken@1035
  2823
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
slouken@1035
  2824
            AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
slouken@955
  2825
        fi
slouken@955
  2826
        # Set up files for the joystick library
slouken@955
  2827
        if test x$enable_joystick = xyes; then
slouken@955
  2828
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS riscos"
slouken@955
  2829
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS riscos/libjoystick_riscos.la"
slouken@955
  2830
        fi
slouken@955
  2831
        # Set up files for the cdrom library