configure.in
author Ryan C. Gordon <icculus@icculus.org>
Thu, 12 Jan 2006 22:46:36 +0000
changeset 1242 caf0328c8058
parent 1222 09c1408645df
child 1243 08c730212ca2
permissions -rw-r--r--
Add XME hooks to X11 driver instead of relying on libxme...libxme hasn't
changed in five years, and it's a small .c file that just calls into the X11
dependencies we already use elsewhere. Including it directly allows us to
make use of the dynamic X11 code.

Fixes Bugzilla #41.

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