configure.in
author Sam Lantinga <slouken@libsdl.org>
Tue, 05 Mar 2002 19:55:32 +0000
changeset 292 eadc0746dfaf
parent 286 3ea69fd0b095
child 294 d2d48e10f370
permissions -rw-r--r--
Added SDL_LockRect() and SDL_UnlockRect()
Incorporated XFree86 extension libraries into the source
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@241
    17
SDL_MICRO_VERSION=4
slouken@241
    18
SDL_INTERFACE_AGE=4
slouken@241
    19
SDL_BINARY_AGE=4
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@0
    41
AC_CANONICAL_HOST
slouken@0
    42
AC_CANONICAL_TARGET
slouken@0
    43
slouken@51
    44
dnl Setup for automake
slouken@51
    45
AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
slouken@51
    46
slouken@0
    47
dnl Check for tools
slouken@0
    48
slouken@0
    49
AC_LIBTOOL_WIN32_DLL
slouken@0
    50
AM_PROG_LIBTOOL
slouken@0
    51
AC_PROG_MAKE_SET
slouken@0
    52
AC_PROG_CC
slouken@0
    53
AC_C_INLINE
slouken@0
    54
AC_C_CONST
slouken@200
    55
AC_PROG_CXX
slouken@0
    56
AC_PROG_INSTALL
slouken@0
    57
AC_FUNC_ALLOCA
slouken@258
    58
ASFLAGS=""
slouken@258
    59
AC_SUBST(ASFLAGS)
slouken@0
    60
slouken@0
    61
dnl The alpha architecture needs special flags for binary portability
slouken@0
    62
case "$target" in
slouken@0
    63
    alpha*-*-linux*)
slouken@0
    64
        if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    65
            CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
slouken@0
    66
        fi
slouken@0
    67
        ;;
slouken@0
    68
esac
slouken@0
    69
slouken@0
    70
dnl Add compiler-specific optimization flags
slouken@0
    71
slouken@0
    72
dnl See if the user wants aggressive optimizations of the code
slouken@0
    73
AC_ARG_ENABLE(debug,
slouken@0
    74
[  --enable-debug          Disable aggressive optimizations [default=yes]],
slouken@0
    75
              , enable_debug=yes)
slouken@0
    76
if test x$enable_debug != xyes; then
slouken@0
    77
    if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    78
        CFLAGS="$CFLAGS -fexpensive-optimizations"
slouken@0
    79
        # Ack! This breaks the MMX YV12 conversion on gcc 2.95.2
slouken@0
    80
        # CFLAGS="$CFLAGS -fomit-frame-pointer"
slouken@0
    81
    fi
slouken@0
    82
    case "$target" in
slouken@0
    83
        i486-*-*)
slouken@0
    84
            if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    85
                CFLAGS="$CFLAGS -march=486"
slouken@0
    86
            fi
slouken@0
    87
            ;;
slouken@0
    88
        i?86-*-*)
slouken@0
    89
            if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    90
                CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
slouken@0
    91
            fi
slouken@0
    92
            ;;
slouken@0
    93
        *-*-osf*)
slouken@0
    94
            if test x$ac_cv_prog_gcc != xyes; then
slouken@0
    95
                CFLAGS="-g3 -fast -arch host"
slouken@0
    96
            fi
slouken@0
    97
            ;;
slouken@0
    98
    esac
slouken@0
    99
fi
slouken@0
   100
slouken@0
   101
dnl Add verbose warnings by default, and allow ANSI compliance checking
slouken@0
   102
AC_ARG_ENABLE(strict-ansi,
slouken@0
   103
[  --enable-strict-ansi    Enable strict ANSI compliance build [default=no]],
slouken@0
   104
              , enable_strict_ansi=no)
slouken@0
   105
if test x$ac_cv_prog_gcc = xyes; then
slouken@0
   106
    CFLAGS="$CFLAGS -Wall"
slouken@0
   107
    if test x$enable_strict_ansi = xyes; then
slouken@0
   108
        CFLAGS="$CFLAGS -ansi -pedantic -D_XOPEN_SOURCE"
slouken@0
   109
    fi
slouken@0
   110
fi
slouken@0
   111
slouken@0
   112
dnl Initialize the compiler and linker flags for SDL applications
slouken@0
   113
slouken@0
   114
SDL_CFLAGS=""
slouken@0
   115
SDL_LIBS="-lSDL"
slouken@0
   116
slouken@0
   117
dnl Add the math library for the new gamma correction support
slouken@0
   118
slouken@0
   119
case "$target" in
slouken@0
   120
    *-*-cygwin* | *-*-mingw32*)
slouken@0
   121
        MATHLIB=""
slouken@0
   122
        ;;
slouken@0
   123
    *-*-beos*)
slouken@0
   124
        MATHLIB=""
slouken@0
   125
        ;;
slouken@0
   126
    *-*-darwin*)
slouken@0
   127
        MATHLIB=""
slouken@0
   128
        ;;
slouken@0
   129
    *)
slouken@0
   130
        MATHLIB="-lm"
slouken@0
   131
        ;;
slouken@0
   132
esac
slouken@0
   133
SYSTEM_LIBS="$SYSTEM_LIBS $MATHLIB"
slouken@0
   134
slouken@0
   135
dnl Enable/disable various subsystems of the SDL library
slouken@0
   136
slouken@0
   137
AC_ARG_ENABLE(audio,
slouken@0
   138
[  --enable-audio          Enable the audio subsystem [default=yes]],
slouken@0
   139
              , enable_audio=yes)
slouken@0
   140
if test x$enable_audio = xyes; then
slouken@0
   141
    SDL_EXTRADIRS="$SDL_EXTRADIRS audio"
slouken@0
   142
    SDL_EXTRALIBS="$SDL_EXTRALIBS audio/libaudio.la"
slouken@0
   143
else
slouken@0
   144
    CFLAGS="$CFLAGS -DDISABLE_AUDIO"
slouken@0
   145
fi
slouken@0
   146
AC_ARG_ENABLE(video,
slouken@0
   147
[  --enable-video          Enable the video subsystem [default=yes]],
slouken@0
   148
              , enable_video=yes)
slouken@0
   149
if test x$enable_video = xyes; then
slouken@0
   150
    SDL_EXTRADIRS="$SDL_EXTRADIRS video"
slouken@0
   151
    SDL_EXTRALIBS="$SDL_EXTRALIBS video/libvideo.la"
slouken@0
   152
else
slouken@0
   153
    CFLAGS="$CFLAGS -DDISABLE_VIDEO"
slouken@0
   154
fi
slouken@0
   155
AC_ARG_ENABLE(events,
slouken@0
   156
[  --enable-events         Enable the events subsystem [default=yes]],
slouken@0
   157
              , enable_events=yes)
slouken@0
   158
if test x$enable_video = xyes -a x$enable_events = xyes; then
slouken@0
   159
    SDL_EXTRADIRS="$SDL_EXTRADIRS events"
slouken@0
   160
    SDL_EXTRALIBS="$SDL_EXTRALIBS events/libevents.la"
slouken@0
   161
else
slouken@0
   162
    CFLAGS="$CFLAGS -DDISABLE_EVENTS"
slouken@0
   163
fi
slouken@0
   164
AC_ARG_ENABLE(joystick,
slouken@0
   165
[  --enable-joystick       Enable the joystick subsystem [default=yes]],
slouken@0
   166
              , enable_joystick=yes)
slouken@0
   167
if test x$enable_joystick = xyes; then
slouken@0
   168
    SDL_EXTRADIRS="$SDL_EXTRADIRS joystick"
slouken@0
   169
    SDL_EXTRALIBS="$SDL_EXTRALIBS joystick/libjoystick.la"
slouken@0
   170
else
slouken@0
   171
    CFLAGS="$CFLAGS -DDISABLE_JOYSTICK"
slouken@0
   172
fi
slouken@0
   173
AC_ARG_ENABLE(cdrom,
slouken@0
   174
[  --enable-cdrom          Enable the cdrom subsystem [default=yes]],
slouken@0
   175
              , enable_cdrom=yes)
slouken@0
   176
if test x$enable_cdrom = xyes; then
slouken@0
   177
    SDL_EXTRADIRS="$SDL_EXTRADIRS cdrom"
slouken@0
   178
    SDL_EXTRALIBS="$SDL_EXTRALIBS cdrom/libcdrom.la"
slouken@0
   179
else
slouken@0
   180
    CFLAGS="$CFLAGS -DDISABLE_CDROM"
slouken@0
   181
fi
slouken@0
   182
AC_ARG_ENABLE(threads,
slouken@0
   183
[  --enable-threads        Enable the threading subsystem [default=yes]],
slouken@0
   184
              , enable_threads=yes)
slouken@0
   185
SDL_EXTRADIRS="$SDL_EXTRADIRS thread"
slouken@0
   186
SDL_EXTRALIBS="$SDL_EXTRALIBS thread/libthread.la"
slouken@0
   187
if test x$enable_threads != xyes; then
slouken@0
   188
    CFLAGS="$CFLAGS -DDISABLE_THREADS"
slouken@0
   189
    COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
slouken@0
   190
    COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
slouken@0
   191
    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
   192
    COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
   193
    COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
   194
    COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
   195
    COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
   196
    COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
   197
fi
slouken@0
   198
AC_ARG_ENABLE(timers,
slouken@0
   199
[  --enable-timers         Enable the timer subsystem [default=yes]],
slouken@0
   200
              , enable_timers=yes)
slouken@0
   201
if test x$enable_timers = xyes; then
slouken@0
   202
    SDL_EXTRADIRS="$SDL_EXTRADIRS timer"
slouken@0
   203
    SDL_EXTRALIBS="$SDL_EXTRALIBS timer/libtimer.la"
slouken@0
   204
else
slouken@0
   205
    CFLAGS="$CFLAGS -DDISABLE_TIMERS"
slouken@0
   206
fi
slouken@0
   207
AC_ARG_ENABLE(endian,
slouken@0
   208
[  --enable-endian         Enable the endian subsystem [default=yes]],
slouken@0
   209
              , enable_endian=yes)
slouken@0
   210
if test x$enable_endian = xyes; then
slouken@0
   211
    SDL_EXTRADIRS="$SDL_EXTRADIRS endian"
slouken@0
   212
    SDL_EXTRALIBS="$SDL_EXTRALIBS endian/libendian.la"
slouken@0
   213
else
slouken@0
   214
    CFLAGS="$CFLAGS -DDISABLE_ENDIAN"
slouken@0
   215
fi
slouken@0
   216
AC_ARG_ENABLE(file,
slouken@0
   217
[  --enable-file           Enable the file subsystem [default=yes]],
slouken@0
   218
              , enable_file=yes)
slouken@0
   219
if test x$enable_file = xyes; then
slouken@0
   220
    SDL_EXTRADIRS="$SDL_EXTRADIRS file"
slouken@0
   221
    SDL_EXTRALIBS="$SDL_EXTRALIBS file/libfile.la"
slouken@0
   222
else
slouken@0
   223
    CFLAGS="$CFLAGS -DDISABLE_FILE"
slouken@0
   224
fi
slouken@0
   225
slouken@0
   226
dnl See if the OSS audio interface is supported
slouken@0
   227
CheckOSS()
slouken@0
   228
{
slouken@0
   229
    AC_ARG_ENABLE(oss,
slouken@0
   230
[  --enable-oss            support the OSS audio API [default=yes]],
slouken@0
   231
                  , enable_oss=yes)
slouken@0
   232
    if test x$enable_audio = xyes -a x$enable_oss = xyes; then
slouken@0
   233
        AC_MSG_CHECKING(for OSS audio support)
slouken@0
   234
        have_oss=no
slouken@94
   235
        if test x$have_oss != xyes; then
slouken@94
   236
            AC_TRY_COMPILE([
slouken@94
   237
              #include <sys/soundcard.h>
slouken@94
   238
            ],[
slouken@94
   239
              int arg = SNDCTL_DSP_SETFRAGMENT;
slouken@94
   240
            ],[
slouken@94
   241
            have_oss=yes
slouken@94
   242
            ])
slouken@94
   243
        fi
slouken@94
   244
        if test x$have_oss != xyes; then
slouken@94
   245
            AC_TRY_COMPILE([
slouken@94
   246
              #include <soundcard.h>
slouken@94
   247
            ],[
slouken@94
   248
              int arg = SNDCTL_DSP_SETFRAGMENT;
slouken@94
   249
            ],[
slouken@94
   250
            have_oss=yes
slouken@94
   251
            CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H"
slouken@94
   252
            ])
slouken@94
   253
        fi
slouken@0
   254
        AC_MSG_RESULT($have_oss)
slouken@0
   255
        if test x$have_oss = xyes; then
slouken@0
   256
            CFLAGS="$CFLAGS -DOSS_SUPPORT"
slouken@0
   257
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
slouken@0
   258
            AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
slouken@0
   259
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dma"
slouken@0
   260
            AUDIO_DRIVERS="$AUDIO_DRIVERS dma/libaudio_dma.la"
slouken@0
   261
        fi
slouken@0
   262
    fi
slouken@0
   263
}
slouken@0
   264
slouken@0
   265
dnl See if the ALSA audio interface is supported
slouken@0
   266
CheckALSA()
slouken@0
   267
{
slouken@0
   268
    AC_ARG_ENABLE(alsa,
slouken@0
   269
[  --enable-alsa           support the ALSA audio API [default=yes]],
slouken@0
   270
                  , enable_alsa=yes)
slouken@0
   271
    if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
slouken@0
   272
        have_alsa=no
slouken@0
   273
        AC_CHECK_HEADER(sys/asoundlib.h, have_alsa_hdr=yes)
slouken@0
   274
        AC_CHECK_LIB(asound, snd_pcm_open, have_alsa_lib=yes)
slouken@0
   275
        if test x$have_alsa_hdr = xyes -a x$have_alsa_lib = xyes; then
slouken@0
   276
            CFLAGS="$CFLAGS -DALSA_SUPPORT"
slouken@0
   277
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
slouken@0
   278
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS alsa"
slouken@0
   279
            AUDIO_DRIVERS="$AUDIO_DRIVERS alsa/libaudio_alsa.la"
slouken@0
   280
        fi
slouken@0
   281
    fi
slouken@0
   282
}
slouken@0
   283
slouken@37
   284
dnl Check whether we want to use OpenBSD native audio or not
slouken@37
   285
CheckOPENBSDAUDIO()
slouken@37
   286
{
slouken@37
   287
    AC_ARG_ENABLE(openbsdaudio,
slouken@94
   288
[  --enable-openbsdaudio   OpenBSD native audio support [default=yes]],
slouken@94
   289
                  , enable_openbsdaudio=yes)
slouken@37
   290
    if test x$enable_audio = xyes -a x$enable_openbsdaudio = xyes; then
slouken@121
   291
        CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
slouken@37
   292
        AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
slouken@37
   293
        AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
slouken@37
   294
    fi
slouken@37
   295
}
slouken@37
   296
slouken@148
   297
dnl Check whether we want to use IRIX 6.5+ native audio or not
slouken@148
   298
CheckDMEDIA()
slouken@148
   299
{
slouken@148
   300
    if test x$enable_audio = xyes; then
slouken@148
   301
        AC_MSG_CHECKING(for dmedia audio support)
slouken@148
   302
        have_dmedia=no
slouken@148
   303
        AC_TRY_COMPILE([
slouken@148
   304
          #include <dmedia/audio.h>
slouken@148
   305
        ],[
slouken@148
   306
          ALport audio_port;
slouken@148
   307
        ],[
slouken@148
   308
        have_dmedia=yes
slouken@148
   309
        ])
slouken@148
   310
        # Set up files for the audio library
slouken@148
   311
        if test x$have_dmedia = xyes; then
slouken@148
   312
            CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
slouken@148
   313
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
slouken@148
   314
            AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
slouken@148
   315
            SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
slouken@148
   316
        fi
slouken@148
   317
    fi
slouken@148
   318
}
slouken@148
   319
slouken@0
   320
dnl Find the ESD includes and libraries
slouken@0
   321
CheckESD()
slouken@0
   322
{
slouken@0
   323
    AC_ARG_ENABLE(esd,
slouken@0
   324
[  --enable-esd            support the Enlightened Sound Daemon [default=yes]],
slouken@0
   325
                  , enable_esd=yes)
slouken@0
   326
    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
slouken@0
   327
        AM_PATH_ESD(0.2.8, [
slouken@0
   328
            CFLAGS="$CFLAGS -DESD_SUPPORT $ESD_CFLAGS"
slouken@0
   329
            SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
slouken@0
   330
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS esd"
slouken@0
   331
            AUDIO_DRIVERS="$AUDIO_DRIVERS esd/libaudio_esd.la"
slouken@0
   332
        ])
slouken@0
   333
    fi
slouken@0
   334
}
slouken@0
   335
slouken@0
   336
CheckARTSC()
slouken@0
   337
{
slouken@0
   338
    AC_ARG_ENABLE(arts,
slouken@0
   339
[  --enable-arts           support the Analog Real Time Synthesizer [default=yes]],
slouken@0
   340
                  , enable_arts=yes)
slouken@0
   341
    if test x$enable_audio = xyes -a x$enable_arts = xyes; then
slouken@0
   342
        AC_PATH_PROG(ARTSCCONFIG, artsc-config)
slouken@0
   343
        if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"'; then
slouken@0
   344
            : # arts isn't installed
slouken@0
   345
        else
slouken@0
   346
            ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
slouken@0
   347
            ARTSC_LIBS=`$ARTSCCONFIG --libs`
slouken@0
   348
            AC_MSG_CHECKING(for aRts development environment)
slouken@0
   349
            audio_arts=no
slouken@0
   350
            save_CFLAGS="$CFLAGS"
slouken@0
   351
            CFLAGS="$CFLAGS $ARTSC_CFLAGS"
slouken@0
   352
            AC_TRY_COMPILE([
slouken@0
   353
             #include <artsc.h>
slouken@0
   354
            ],[
slouken@0
   355
             arts_stream_t stream;
slouken@0
   356
            ],[
slouken@0
   357
            audio_arts=yes
slouken@0
   358
            ])
slouken@0
   359
            CFLAGS="$save_CFLAGS"
slouken@0
   360
            AC_MSG_RESULT($audio_arts)
slouken@0
   361
            if test x$audio_arts = xyes; then
slouken@0
   362
                CFLAGS="$CFLAGS -DARTSC_SUPPORT $ARTSC_CFLAGS"
slouken@0
   363
                SYSTEM_LIBS="$SYSTEM_LIBS $ARTSC_LIBS"
slouken@0
   364
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS arts"
slouken@0
   365
                AUDIO_DRIVERS="$AUDIO_DRIVERS arts/libaudio_arts.la"
slouken@0
   366
            fi
slouken@0
   367
        fi
slouken@0
   368
    fi
slouken@0
   369
}
slouken@0
   370
slouken@0
   371
dnl See if the NAS audio interface is supported
slouken@0
   372
CheckNAS()
slouken@0
   373
{
slouken@0
   374
    AC_ARG_ENABLE(nas,
slouken@292
   375
[  --enable-nas                  support the NAS audio API [default=yes]],
slouken@41
   376
                  , enable_nas=yes)
slouken@0
   377
    if test x$enable_audio = xyes -a x$enable_nas = xyes; then
slouken@41
   378
        AC_MSG_CHECKING(for NAS audio support)
slouken@41
   379
        have_nas=no
slouken@41
   380
        if test -r /usr/X11R6/include/audio/audiolib.h; then
slouken@41
   381
            have_nas=yes
slouken@41
   382
        fi
slouken@41
   383
        AC_MSG_RESULT($have_nas)
slouken@41
   384
        if test x$have_nas = xyes; then
slouken@41
   385
            CFLAGS="$CFLAGS -DNAS_SUPPORT"
slouken@41
   386
            SYSTEM_LIBS="$SYSTEM_LIBS -laudio -lXt"
slouken@41
   387
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nas"
slouken@41
   388
            AUDIO_DRIVERS="$AUDIO_DRIVERS nas/libaudio_nas.la"
slouken@41
   389
        fi
slouken@0
   390
    fi
slouken@0
   391
}
slouken@0
   392
slouken@68
   393
dnl rcg07142001 See if the user wants the disk writer audio driver...
slouken@68
   394
CheckDiskAudio()
slouken@68
   395
{
slouken@68
   396
    AC_ARG_ENABLE(diskaudio,
slouken@292
   397
[  --enable-diskaudio            support the disk writer audio driver [default=yes]],
slouken@86
   398
                  , enable_diskaudio=yes)
slouken@68
   399
    if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
slouken@68
   400
        CFLAGS="$CFLAGS -DDISKAUD_SUPPORT"
slouken@68
   401
        AUDIO_SUBDIRS="$AUDIO_SUBDIRS disk"
slouken@68
   402
        AUDIO_DRIVERS="$AUDIO_DRIVERS disk/libaudio_disk.la"
slouken@68
   403
    fi
slouken@68
   404
}
slouken@68
   405
slouken@0
   406
dnl See if we can use x86 assembly blitters
slouken@212
   407
# NASM is available from: http://nasm.octium.net/
slouken@0
   408
CheckNASM()
slouken@0
   409
{
slouken@0
   410
    dnl Make sure we are running on an x86 platform
slouken@0
   411
    case $target in
slouken@0
   412
        i?86*)
slouken@0
   413
            ;;
slouken@0
   414
        *)
slouken@0
   415
        # Nope, bail early.
slouken@0
   416
            return
slouken@0
   417
            ;;
slouken@0
   418
    esac
slouken@0
   419
    dnl Check for NASM (for assembly blit routines)
slouken@0
   420
    AC_ARG_ENABLE(nasm,
slouken@0
   421
[  --enable-nasm           use nasm assembly blitters on x86 [default=yes]],
slouken@0
   422
                  , enable_nasm=yes)
slouken@0
   423
    if test x$enable_video = xyes -a x$enable_nasm = xyes; then
slouken@0
   424
        AC_PATH_PROG(NASM, nasm)
slouken@0
   425
        if test x$NASM = x -o x$NASM = x'"$NASM"'; then
slouken@0
   426
            : # nasm isn't installed
slouken@0
   427
        else
slouken@0
   428
            CFLAGS="$CFLAGS -DUSE_ASMBLIT -I$srcdir/hermes"
slouken@0
   429
            case $ARCH in
slouken@0
   430
              win32)
slouken@0
   431
                  NASMFLAGS="-f win32"
slouken@0
   432
                  ;;
slouken@0
   433
              *)
slouken@0
   434
                  NASMFLAGS="-f elf"
slouken@0
   435
                  ;;
slouken@0
   436
            esac
slouken@0
   437
            AC_SUBST(NASMFLAGS)
slouken@0
   438
            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hermes"
slouken@0
   439
            SDL_EXTRADIRS="$SDL_EXTRADIRS hermes"
slouken@0
   440
            SDL_EXTRALIBS="$SDL_EXTRALIBS hermes/libhermes.la"
slouken@0
   441
        fi
slouken@0
   442
    fi
slouken@0
   443
}
slouken@0
   444
slouken@30
   445
dnl Find the nanox include and library directories
slouken@30
   446
CheckNANOX()
slouken@30
   447
{
slouken@292
   448
    AC_ARG_ENABLE(video-nanox,
slouken@292
   449
        [  --enable-video-nanox use nanox video driver [default=no]],
slouken@292
   450
        , enable_video_nanox=no)
slouken@292
   451
    AC_ARG_ENABLE(nanox-debug,  
slouken@292
   452
        [  --enable-nanox-debug print debug messages [default=no]],
slouken@292
   453
        , enable_nanox_debug=no)
slouken@292
   454
    AC_ARG_ENABLE(nanox-share-memory,  
slouken@292
   455
        [  --enable-nanox-share-memory use share memory [default=no]],
slouken@292
   456
        , enable_nanox_share_memory=no)
slouken@30
   457
slouken@292
   458
    AC_ARG_WITH(nanox_pixel_type, 
slouken@292
   459
        [  --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal]])
slouken@30
   460
slouken@292
   461
    if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
slouken@292
   462
        if test x$enable_nanox_debug = xyes; then
slouken@292
   463
            CFLAGS="$CFLAGS -DENABLE_NANOX_DEBUG"
slouken@292
   464
        fi
slouken@30
   465
slouken@292
   466
        if test x$enable_nanox_share_memory = xyes; then
slouken@292
   467
            CFLAGS="$CFLAGS -DNANOX_SHARE_MEMORY"
slouken@292
   468
        fi
slouken@30
   469
slouken@292
   470
        case "$with_nanox_pixel_type" in
slouken@292
   471
             rgb) CFLAGS="$CFLAGS -DNANOX_PIXEL_RGB" ;;
slouken@292
   472
            0888) CFLAGS="$CFLAGS -DNANOX_PIXEL_0888" ;;
slouken@292
   473
             888) CFLAGS="$CFLAGS -DNANOX_PIXEL_888"  ;;
slouken@292
   474
             565) CFLAGS="$CFLAGS -DNANOX_PIXEL_565"  ;;
slouken@292
   475
             555) CFLAGS="$CFLAGS -DNANOX_PIXEL_555"  ;;
slouken@292
   476
             332) CFLAGS="$CFLAGS -DNANOX_PIXEL_332"  ;;
slouken@292
   477
             pal) CFLAGS="$CFLAGS -DNANOX_PIXEL_PAL"  ;;
slouken@292
   478
               *) AC_MSG_ERROR([Invalid nanox_pixel_type]);;
slouken@292
   479
        esac
slouken@30
   480
slouken@292
   481
        CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_NANOX"
slouken@292
   482
        SYSTEM_LIBS="$SYSTEM_LIBS -lnano-X"
slouken@292
   483
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS nanox"
slouken@292
   484
        VIDEO_DRIVERS="$VIDEO_DRIVERS nanox/libvideo_nanox.la"
slouken@292
   485
    fi
slouken@30
   486
}
slouken@30
   487
slouken@0
   488
dnl Find the X11 include and library directories
slouken@0
   489
CheckX11()
slouken@0
   490
{
slouken@0
   491
    AC_ARG_ENABLE(video-x11,
slouken@0
   492
[  --enable-video-x11      use X11 video driver [default=yes]],
slouken@0
   493
                  , enable_video_x11=yes)
slouken@0
   494
    if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
slouken@0
   495
        AC_PATH_X
slouken@0
   496
        AC_PATH_XTRA
slouken@0
   497
        if test x$have_x = xyes; then
slouken@292
   498
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_X11 -Isrc/video"
slouken@0
   499
            if test x$ac_cv_func_shmat != xyes; then
slouken@0
   500
                CFLAGS="$CFLAGS -DNO_SHARED_MEMORY"
slouken@0
   501
            fi
slouken@0
   502
            SYSTEM_LIBS="$SYSTEM_LIBS $X_LIBS -lX11 -lXext"
slouken@0
   503
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS x11"
slouken@0
   504
            VIDEO_DRIVERS="$VIDEO_DRIVERS x11/libvideo_x11.la"
slouken@0
   505
slouken@0
   506
            AC_ARG_ENABLE(video-x11-vm,
slouken@0
   507
[  --enable-video-x11-vm   use X11 VM extension for fullscreen [default=yes]],
slouken@0
   508
                          , enable_video_x11_vm=yes)
slouken@0
   509
            if test x$enable_video_x11_vm = xyes; then
slouken@0
   510
                AC_MSG_CHECKING(for XFree86 VidMode 1.0 support)
slouken@0
   511
                video_x11_vm=no
slouken@0
   512
                AC_TRY_COMPILE([
slouken@0
   513
                 #include <X11/Xlib.h>
slouken@292
   514
                 #include <XFree86/extensions/xf86vmode.h>
slouken@0
   515
                ],[
slouken@0
   516
                ],[
slouken@0
   517
                video_x11_vm=yes
slouken@0
   518
                ])
slouken@0
   519
                AC_MSG_RESULT($video_x11_vm)
slouken@0
   520
                if test x$video_x11_vm = xyes; then
slouken@0
   521
                    CFLAGS="$CFLAGS -DXFREE86_VM"
slouken@292
   522
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86vm"
slouken@292
   523
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86vm/libXFree86_Xxf86vm.la"
slouken@0
   524
                    AC_MSG_CHECKING(for XFree86 VidMode gamma support)
slouken@0
   525
                    video_x11_vmgamma=no
slouken@0
   526
                    AC_TRY_COMPILE([
slouken@0
   527
                     #include <X11/Xlib.h>
slouken@292
   528
                     #include <XFree86/extensions/xf86vmode.h>
slouken@0
   529
                    ],[
slouken@292
   530
                     SDL_NAME(XF86VidModeGamma) gamma;
slouken@0
   531
                    ],[
slouken@0
   532
                    video_x11_vmgamma=yes
slouken@0
   533
                    ])
slouken@0
   534
                    AC_MSG_RESULT($video_x11_vmgamma)
slouken@0
   535
                    if test x$video_x11_vmgamma = xyes; then
slouken@0
   536
                        CFLAGS="$CFLAGS -DXFREE86_VMGAMMA"
slouken@0
   537
                    fi
slouken@0
   538
                fi
slouken@0
   539
            fi
slouken@16
   540
            AC_ARG_ENABLE(dga,
slouken@16
   541
[  --enable-dga            allow use of X11 DGA code [default=yes]],
slouken@16
   542
                          , enable_dga=yes)
slouken@0
   543
            AC_ARG_ENABLE(video-x11-dgamouse,
slouken@0
   544
[  --enable-video-x11-dgamouse  use X11 DGA for mouse events [default=yes]],
slouken@0
   545
                          , enable_video_x11_dgamouse=yes)
slouken@16
   546
            if test x$enable_dga = xyes; then
slouken@16
   547
                AC_MSG_CHECKING(for XFree86 DGA 1.0 support)
slouken@16
   548
                video_x11_dga=no
slouken@16
   549
                AC_TRY_COMPILE([
slouken@16
   550
                 #include <X11/Xlib.h>
slouken@292
   551
                 #include <XFree86/extensions/xf86dga.h>
slouken@16
   552
                ],[
slouken@16
   553
                ],[
slouken@16
   554
                video_x11_dga=yes
slouken@16
   555
                ])
slouken@16
   556
                AC_MSG_RESULT($video_x11_dga)
slouken@16
   557
                if test x$video_x11_dga = xyes; then
slouken@16
   558
                    CFLAGS="$CFLAGS -DXFREE86_DGAMOUSE"
slouken@16
   559
                    if test x$enable_video_x11_dgamouse = xyes; then
slouken@16
   560
                        CFLAGS="$CFLAGS -DDEFAULT_DGAMOUSE"
slouken@16
   561
                    fi
slouken@292
   562
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xxf86dga"
slouken@292
   563
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xxf86dga/libXFree86_Xxf86dga.la"
slouken@0
   564
                fi
slouken@0
   565
            fi
slouken@0
   566
            AC_ARG_ENABLE(video-x11-xv,
slouken@0
   567
[  --enable-video-x11-xv   use X11 XvImage extension for video [default=yes]],
slouken@0
   568
                          , enable_video_x11_xv=yes)
slouken@0
   569
            if test x$enable_video_x11_xv = xyes; then
slouken@0
   570
                AC_MSG_CHECKING(for XFree86 XvImage support)
slouken@0
   571
                video_x11_xv=no
slouken@0
   572
                AC_TRY_COMPILE([
slouken@0
   573
                 #include <X11/Xlib.h>
slouken@0
   574
                 #include <sys/ipc.h>
slouken@0
   575
                 #include <sys/shm.h>
slouken@0
   576
                 #include <X11/extensions/XShm.h>
slouken@292
   577
                 #include <XFree86/extensions/Xvlib.h>
slouken@0
   578
                ],[
slouken@292
   579
                 SDL_NAME(XvImage) *image;
slouken@0
   580
                ],[
slouken@0
   581
                video_x11_xv=yes
slouken@0
   582
                ])
slouken@0
   583
                AC_MSG_RESULT($video_x11_xv)
slouken@0
   584
                if test x$video_x11_xv = xyes; then
slouken@0
   585
                    CFLAGS="$CFLAGS -DXFREE86_XV"
slouken@292
   586
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xv"
slouken@292
   587
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xv/libXFree86_Xv.la"
slouken@0
   588
                fi
slouken@0
   589
            fi
slouken@227
   590
            AC_ARG_ENABLE(video-x11-xinerama,
slouken@227
   591
[  --enable-video-x11-xinerama   enable X11 Xinerama support [default=yes]],
slouken@227
   592
                            , enable_video_x11_xinerama=yes)
slouken@227
   593
            if test x$enable_video_x11_xinerama = xyes; then
slouken@227
   594
                AC_MSG_CHECKING(for X11 Xinerama support)
slouken@227
   595
                video_x11_xinerama=no
slouken@227
   596
                AC_TRY_COMPILE([
slouken@227
   597
                 #include <X11/Xlib.h>
slouken@292
   598
                 #include <XFree86/extensions/Xinerama.h>
slouken@227
   599
                ],[
slouken@292
   600
                 SDL_NAME(XineramaScreenInfo) *xinerama;
slouken@227
   601
                ],[
slouken@227
   602
                video_x11_xinerama=yes
slouken@227
   603
                ])
slouken@227
   604
                AC_MSG_RESULT($video_x11_xinerama)
slouken@227
   605
                if test x$video_x11_xinerama = xyes; then
slouken@227
   606
                    CFLAGS="$CFLAGS -DHAVE_XINERAMA"
slouken@292
   607
                    VIDEO_SUBDIRS="$VIDEO_SUBDIRS XFree86/Xinerama"
slouken@292
   608
                    VIDEO_DRIVERS="$VIDEO_DRIVERS XFree86/Xinerama/libXFree86_Xinerama.la"
slouken@227
   609
                fi
slouken@227
   610
            fi
slouken@242
   611
            AC_ARG_ENABLE(video-x11-xme,
slouken@242
   612
[  --enable-video-x11-xme  enable Xi Graphics XME for fullscreen [default=yes]],
slouken@242
   613
                            , enable_video_x11_xme=yes)
slouken@242
   614
            if test x$enable_video_x11_xme = xyes; then
slouken@242
   615
                AC_MSG_CHECKING(for Xi Graphics XiGMiscExtension support)
slouken@242
   616
                video_x11_xme=no
slouken@242
   617
                AC_TRY_COMPILE([
slouken@242
   618
                 #include <X11/Xlib.h>
slouken@242
   619
                 #include <X11/extensions/xme.h>
slouken@242
   620
                ],[
slouken@242
   621
                 XiGMiscResolutionInfo *resolutions;
slouken@242
   622
                ],[
slouken@242
   623
                video_x11_xme=yes
slouken@242
   624
                ])
slouken@242
   625
                AC_MSG_RESULT($video_x11_xme)
slouken@242
   626
                if test x$video_x11_xme = xyes; then
slouken@242
   627
                    CFLAGS="$CFLAGS -DHAVE_XIGXME"
slouken@242
   628
                    SYSTEM_LIBS="$SYSTEM_LIBS -lxme"
slouken@242
   629
                fi
slouken@242
   630
            fi
slouken@0
   631
        fi
slouken@0
   632
    fi
slouken@0
   633
}
slouken@279
   634
slouken@292
   635
dnl Find the X11 DGA 2.0 include and library directories
slouken@292
   636
CheckDGA()
slouken@292
   637
{
slouken@292
   638
    AC_ARG_ENABLE(video-dga,
slouken@292
   639
[  --enable-video-dga      use DGA 2.0 video driver [default=yes]],
slouken@292
   640
                  , enable_video_dga=yes)
slouken@292
   641
    if test x$video_x11_dga = xyes -a x$enable_video_dga = xyes; then
slouken@292
   642
        save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS -Isrc/video"
slouken@292
   643
        AC_MSG_CHECKING(for XFree86 DGA 2.0 support)
slouken@292
   644
        video_x11_dga2=no
slouken@292
   645
        AC_TRY_COMPILE([
slouken@292
   646
         #include <X11/Xlib.h>
slouken@292
   647
         #include <XFree86/extensions/xf86dga.h>
slouken@292
   648
        ],[
slouken@292
   649
         SDL_NAME(XDGAEvent) xevent;
slouken@292
   650
        ],[
slouken@292
   651
        video_x11_dga2=yes
slouken@292
   652
        ])
slouken@292
   653
        AC_MSG_RESULT($video_x11_dga2)
slouken@292
   654
        if test x$video_x11_dga2 = xyes; then
slouken@292
   655
            CFLAGS="$CFLAGS -DENABLE_DGA"
slouken@292
   656
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS dga"
slouken@292
   657
            VIDEO_DRIVERS="$VIDEO_DRIVERS dga/libvideo_dga.la"
slouken@292
   658
        fi
slouken@292
   659
    fi
slouken@292
   660
}
slouken@292
   661
slouken@0
   662
CheckPHOTON()
slouken@0
   663
{
slouken@0
   664
    AC_ARG_ENABLE(video-photon,
slouken@72
   665
[  --enable-video-photon   use QNX Photon video driver [default=yes]],
slouken@0
   666
                  , enable_video_photon=yes)
slouken@0
   667
    if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
slouken@0
   668
        AC_MSG_CHECKING(for QNX Photon support)
slouken@0
   669
        video_photon=no
slouken@0
   670
        AC_TRY_COMPILE([
slouken@0
   671
          #include <Ph.h>
slouken@0
   672
          #include <Pt.h>
slouken@0
   673
          #include <photon/Pg.h>
slouken@0
   674
          #include <photon/PdDirect.h>
slouken@0
   675
        ],[
slouken@0
   676
         PgDisplaySettings_t *visual;
slouken@0
   677
        ],[
slouken@0
   678
        video_photon=yes
slouken@0
   679
        ])
slouken@0
   680
        AC_MSG_RESULT($video_photon)
slouken@0
   681
        if test x$video_photon = xyes; then
slouken@19
   682
            CFLAGS="$CFLAGS -DENABLE_PHOTON"
slouken@0
   683
            SYSTEM_LIBS="$SYSTEM_LIBS -lph"
slouken@0
   684
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS photon"
slouken@0
   685
            VIDEO_DRIVERS="$VIDEO_DRIVERS photon/libvideo_photon.la"
slouken@279
   686
            CheckOpenGLQNX
slouken@0
   687
        fi
slouken@0
   688
    fi
slouken@0
   689
}
slouken@0
   690
slouken@0
   691
dnl Find the framebuffer console includes
slouken@0
   692
CheckFBCON()
slouken@0
   693
{
slouken@0
   694
    AC_ARG_ENABLE(video-fbcon,
slouken@0
   695
[  --enable-video-fbcon    use framebuffer console video driver [default=yes]],
slouken@0
   696
                  , enable_video_fbcon=yes)
slouken@0
   697
    if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
slouken@0
   698
        AC_MSG_CHECKING(for framebuffer console support)
slouken@0
   699
        video_fbcon=no
slouken@0
   700
        AC_TRY_COMPILE([
slouken@0
   701
         #include <linux/fb.h>
slouken@0
   702
         #include <linux/kd.h>
slouken@0
   703
         #include <linux/keyboard.h>
slouken@0
   704
        ],[
slouken@0
   705
        ],[
slouken@0
   706
        video_fbcon=yes
slouken@0
   707
        ])
slouken@0
   708
        AC_MSG_RESULT($video_fbcon)
slouken@0
   709
        if test x$video_fbcon = xyes; then
slouken@0
   710
            CFLAGS="$CFLAGS -DENABLE_FBCON"
slouken@0
   711
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS fbcon"
slouken@0
   712
            VIDEO_DRIVERS="$VIDEO_DRIVERS fbcon/libvideo_fbcon.la"
slouken@0
   713
        fi
slouken@0
   714
    fi
slouken@0
   715
}
slouken@0
   716
slouken@167
   717
dnl Find DirectFB
slouken@167
   718
CheckDirectFB()
slouken@167
   719
{
slouken@167
   720
    AC_ARG_ENABLE(video-directfb,
slouken@167
   721
[  --enable-video-directfb    use DirectFB video driver [default=yes]],
slouken@167
   722
                  , enable_video_directfb=yes)
slouken@167
   723
    if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
slouken@167
   724
        video_directfb=no
slouken@167
   725
slouken@167
   726
        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
slouken@167
   727
        if test x$PKG_CONFIG = xno ; then
slouken@167
   728
            AC_MSG_WARN([*** pkg-config is required to build the DirectFB video driver.])
slouken@167
   729
        else
slouken@167
   730
            AC_MSG_CHECKING(for DirectFB support)
slouken@167
   731
slouken@222
   732
            if ! $PKG_CONFIG --atleast-pkgconfig-version 0.5 ; then
slouken@167
   733
                AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
slouken@167
   734
            fi
slouken@167
   735
slouken@286
   736
            DIRECTFB_REQUIRED_VERSION=0.9.9
slouken@167
   737
slouken@167
   738
            if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
slouken@167
   739
                DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
slouken@167
   740
                DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
slouken@167
   741
                video_directfb=yes
slouken@167
   742
            fi
slouken@167
   743
        fi
slouken@167
   744
slouken@167
   745
        AC_MSG_RESULT($video_directfb)
slouken@167
   746
        if test x$video_directfb = xyes; then
slouken@167
   747
            CFLAGS="$CFLAGS -DENABLE_DIRECTFB"
slouken@167
   748
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS directfb"
slouken@167
   749
            VIDEO_DRIVERS="$VIDEO_DRIVERS directfb/libvideo_directfb.la"
slouken@167
   750
slouken@167
   751
            AC_SUBST(DIRECTFB_CFLAGS)
slouken@167
   752
            AC_SUBST(DIRECTFB_LIBS)
slouken@167
   753
        fi
slouken@167
   754
    fi
slouken@167
   755
}
slouken@167
   756
slouken@70
   757
dnl See if we're running on PlayStation 2 hardware
slouken@70
   758
CheckPS2GS()
slouken@70
   759
{
slouken@72
   760
    AC_ARG_ENABLE(video-ps2gs,
slouken@72
   761
[  --enable-video-ps2gs    use PlayStation 2 GS video driver [default=yes]],
slouken@72
   762
                  , enable_video_ps2gs=yes)
slouken@70
   763
    if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
slouken@72
   764
        AC_MSG_CHECKING(for PlayStation 2 GS support)
slouken@70
   765
        video_ps2gs=no
slouken@70
   766
        AC_TRY_COMPILE([
slouken@70
   767
         #include <linux/ps2/dev.h>
slouken@70
   768
         #include <linux/ps2/gs.h>
slouken@70
   769
        ],[
slouken@70
   770
        ],[
slouken@70
   771
        video_ps2gs=yes
slouken@70
   772
        ])
slouken@72
   773
        AC_MSG_RESULT($video_ps2gs)
slouken@70
   774
        if test x$video_ps2gs = xyes; then
slouken@70
   775
            CFLAGS="$CFLAGS -DENABLE_PS2GS"
slouken@70
   776
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
slouken@70
   777
            VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
slouken@70
   778
        fi
slouken@70
   779
    fi
slouken@70
   780
}
slouken@70
   781
slouken@0
   782
dnl Find the GGI includes
slouken@0
   783
CheckGGI()
slouken@0
   784
{
slouken@0
   785
    AC_ARG_ENABLE(video-ggi,
slouken@0
   786
[  --enable-video-ggi      use GGI video driver [default=no]],
slouken@0
   787
                  , enable_video_ggi=no)
slouken@0
   788
    if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
slouken@0
   789
        AC_MSG_CHECKING(for GGI support)
slouken@0
   790
        video_ggi=no
slouken@0
   791
        AC_TRY_COMPILE([
slouken@0
   792
         #include <ggi/ggi.h>
slouken@0
   793
         #include <ggi/gii.h>
slouken@0
   794
        ],[
slouken@0
   795
        ],[
slouken@0
   796
        video_ggi=yes
slouken@0
   797
        ])
slouken@0
   798
        AC_MSG_RESULT($video_ggi)
slouken@0
   799
        if test x$video_ggi = xyes; then
slouken@0
   800
            CFLAGS="$CFLAGS $X_CFLAGS -DENABLE_GGI"
slouken@0
   801
            SYSTEM_LIBS="$SYSTEM_LIBS -lggi -lgii -lgg"
slouken@0
   802
slouken@0
   803
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS ggi"
slouken@0
   804
            VIDEO_DRIVERS="$VIDEO_DRIVERS ggi/libvideo_ggi.la"
slouken@0
   805
        fi
slouken@0
   806
    fi
slouken@0
   807
}
slouken@0
   808
slouken@0
   809
dnl Find the SVGAlib includes and libraries
slouken@0
   810
CheckSVGA()
slouken@0
   811
{
slouken@0
   812
    AC_ARG_ENABLE(video-svga,
slouken@0
   813
[  --enable-video-svga     use SVGAlib video driver [default=no]],
slouken@0
   814
                  , enable_video_svga=no)
slouken@0
   815
    if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
slouken@0
   816
        AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
slouken@0
   817
        video_svga=no
slouken@0
   818
        AC_TRY_COMPILE([
slouken@0
   819
         #include <vga.h>
slouken@0
   820
         #include <vgamouse.h>
slouken@0
   821
         #include <vgakeyboard.h>
slouken@0
   822
        ],[
slouken@0
   823
         if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
slouken@0
   824
             exit(0);
slouken@0
   825
         }
slouken@0
   826
        ],[
slouken@0
   827
        video_svga=yes
slouken@0
   828
        ])
slouken@0
   829
        AC_MSG_RESULT($video_svga)
slouken@0
   830
        if test x$video_svga = xyes; then
slouken@0
   831
            CFLAGS="$CFLAGS -DENABLE_SVGALIB"
slouken@0
   832
            SYSTEM_LIBS="$SYSTEM_LIBS -lvga"
slouken@0
   833
slouken@0
   834
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS svga"
slouken@0
   835
            VIDEO_DRIVERS="$VIDEO_DRIVERS svga/libvideo_svga.la"
slouken@0
   836
        fi
slouken@0
   837
    fi
slouken@0
   838
}
slouken@0
   839
slouken@75
   840
dnl Find the VGL includes and libraries
slouken@75
   841
CheckVGL()
slouken@75
   842
{
slouken@75
   843
    AC_ARG_ENABLE(video-vgl,
slouken@75
   844
[  --enable-video-vgl     use VGL video driver [default=no]],
slouken@75
   845
                  , enable_video_vgl=no)
slouken@75
   846
    if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
slouken@75
   847
        AC_MSG_CHECKING(for libVGL support)
slouken@75
   848
        video_vgl=no
slouken@75
   849
        AC_TRY_COMPILE([
slouken@75
   850
         #include <sys/fbio.h>
slouken@75
   851
         #include <sys/consio.h>
slouken@75
   852
         #include <sys/kbio.h>
slouken@75
   853
         #include <vgl.h>
slouken@75
   854
        ],[
slouken@75
   855
         VGLBitmap bitmap;
slouken@144
   856
         exit(bitmap.Bitmap);
slouken@75
   857
        ],[
slouken@75
   858
        video_vgl=yes
slouken@75
   859
        ])
slouken@75
   860
        AC_MSG_RESULT($video_vgl)
slouken@75
   861
        if test x$video_vgl = xyes; then
slouken@75
   862
            CFLAGS="$CFLAGS -DENABLE_VGL"
slouken@75
   863
            SYSTEM_LIBS="$SYSTEM_LIBS -lvgl"
slouken@75
   864
slouken@75
   865
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS vgl"
slouken@75
   866
            VIDEO_DRIVERS="$VIDEO_DRIVERS vgl/libvideo_vgl.la"
slouken@75
   867
        fi
slouken@75
   868
    fi
slouken@75
   869
}
slouken@75
   870
slouken@0
   871
dnl Find the AAlib includes
slouken@0
   872
CheckAAlib()
slouken@0
   873
{
slouken@0
   874
    AC_ARG_ENABLE(video-aalib,
slouken@0
   875
[  --enable-video-aalib    use AAlib video driver [default=no]],
slouken@0
   876
                  , enable_video_aalib=no)
slouken@0
   877
    if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
slouken@0
   878
        AC_MSG_CHECKING(for AAlib support)
slouken@0
   879
        video_aalib=no
slouken@0
   880
        AC_TRY_COMPILE([
slouken@0
   881
         #include <aalib.h>
slouken@0
   882
        ],[
slouken@0
   883
        ],[
slouken@0
   884
        video_aalib=yes
slouken@0
   885
        ])
slouken@0
   886
        AC_MSG_RESULT($video_aalib)
slouken@0
   887
        if test x$video_aalib = xyes; then
slouken@0
   888
            CFLAGS="$CFLAGS -DENABLE_AALIB"
slouken@0
   889
            SYSTEM_LIBS="$SYSTEM_LIBS -laa"
slouken@0
   890
slouken@0
   891
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS aalib"
slouken@0
   892
            VIDEO_DRIVERS="$VIDEO_DRIVERS aalib/libvideo_aa.la"
slouken@0
   893
        fi
slouken@0
   894
    fi
slouken@0
   895
}
slouken@0
   896
slouken@281
   897
dnl Set up the Atari Xbios driver
slouken@281
   898
CheckAtariXbiosVideo()
slouken@281
   899
{
slouken@281
   900
    AC_ARG_ENABLE(xbios,
slouken@281
   901
[  --enable-video-xbios    use Atari Xbios video driver [default=yes]],
slouken@281
   902
                  , enable_video_xbios=yes)
slouken@281
   903
    video_xbios=no
slouken@281
   904
    if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
slouken@281
   905
        video_xbios=yes
slouken@281
   906
        CFLAGS="$CFLAGS -DENABLE_XBIOS"
slouken@281
   907
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios"
slouken@281
   908
        VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la"
slouken@281
   909
    fi
slouken@281
   910
}
slouken@281
   911
slouken@281
   912
dnl Set up the Atari Gem driver
slouken@281
   913
CheckAtariGemVideo()
slouken@281
   914
{
slouken@281
   915
    AC_ARG_ENABLE(gem,
slouken@281
   916
[  --enable-video-gem      use Atari Gem video driver [default=yes]],
slouken@281
   917
                  , enable_video_gem=yes)
slouken@281
   918
    if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
slouken@281
   919
        video_gem=no
slouken@281
   920
        AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
slouken@281
   921
        AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
slouken@281
   922
        if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
slouken@281
   923
            video_gem=yes
slouken@281
   924
            CFLAGS="$CFLAGS -DENABLE_GEM"
slouken@281
   925
            SYSTEM_LIBS="$SYSTEM_LIBS -lgem"
slouken@281
   926
            VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem"
slouken@281
   927
            VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la"
slouken@281
   928
        fi
slouken@281
   929
    fi
slouken@281
   930
}
slouken@281
   931
slouken@281
   932
dnl Set up the Atari Bios keyboard driver
slouken@281
   933
CheckAtariBiosEvent()
slouken@281
   934
{
slouken@281
   935
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon"
slouken@281
   936
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon"
slouken@281
   937
    VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la"
slouken@281
   938
}
slouken@281
   939
slouken@1
   940
dnl rcg04172001 Set up the Null video driver.
slouken@1
   941
CheckDummyVideo()
slouken@1
   942
{
slouken@1
   943
    AC_ARG_ENABLE(video-dummy,
slouken@86
   944
[  --enable-video-dummy    use dummy video driver [default=yes]],
slouken@86
   945
                  , enable_video_dummy=yes)
slouken@1
   946
    if test x$enable_video_dummy = xyes; then
slouken@1
   947
      CFLAGS="$CFLAGS -DENABLE_DUMMYVIDEO"
slouken@1
   948
      VIDEO_SUBDIRS="$VIDEO_SUBDIRS dummy"
slouken@1
   949
      VIDEO_DRIVERS="$VIDEO_DRIVERS dummy/libvideo_null.la"
slouken@1
   950
    fi
slouken@1
   951
}
slouken@1
   952
slouken@0
   953
dnl Check to see if OpenGL support is desired
slouken@0
   954
AC_ARG_ENABLE(video-opengl,
slouken@0
   955
[  --enable-video-opengl   include OpenGL context creation [default=yes]],
slouken@0
   956
              , enable_video_opengl=yes)
slouken@0
   957
slouken@0
   958
dnl Find OpenGL
slouken@0
   959
CheckOpenGL()
slouken@0
   960
{
slouken@0
   961
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
   962
        AC_MSG_CHECKING(for OpenGL (GLX) support)
slouken@0
   963
        video_opengl=no
slouken@0
   964
        AC_TRY_COMPILE([
slouken@0
   965
         #include <GL/gl.h>
slouken@0
   966
         #include <GL/glx.h>
slouken@0
   967
         #include <dlfcn.h> /* For loading extensions */
slouken@0
   968
        ],[
slouken@0
   969
        ],[
slouken@0
   970
        video_opengl=yes
slouken@0
   971
        ])
slouken@0
   972
        AC_MSG_RESULT($video_opengl)
slouken@0
   973
        if test x$video_opengl = xyes; then
slouken@0
   974
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
   975
            AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
slouken@0
   976
        fi
slouken@0
   977
    fi
slouken@0
   978
}
slouken@0
   979
slouken@279
   980
dnl Find QNX RtP OpenGL
slouken@279
   981
CheckOpenGLQNX()
slouken@279
   982
{
slouken@279
   983
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@279
   984
        AC_MSG_CHECKING(for OpenGL (Photon) support)
slouken@279
   985
        video_opengl=no
slouken@279
   986
        AC_TRY_COMPILE([
slouken@279
   987
         #include <GL/gl.h>
slouken@279
   988
        ],[
slouken@279
   989
        ],[
slouken@279
   990
        video_opengl=yes
slouken@279
   991
        ])
slouken@279
   992
        AC_MSG_RESULT($video_opengl)
slouken@279
   993
        if test x$video_opengl = xyes; then
slouken@279
   994
            CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@279
   995
            SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
slouken@279
   996
        fi
slouken@279
   997
    fi
slouken@279
   998
}
slouken@279
   999
slouken@0
  1000
dnl Check for BeOS OpenGL
slouken@0
  1001
CheckBeGL()
slouken@0
  1002
{
slouken@0
  1003
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1004
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
  1005
        SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
slouken@0
  1006
    fi
slouken@0
  1007
}
slouken@0
  1008
slouken@0
  1009
dnl Check for MacOS OpenGL
slouken@0
  1010
CheckMacGL()
slouken@0
  1011
{
slouken@0
  1012
    if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
slouken@0
  1013
        CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
  1014
        case "$target" in
slouken@0
  1015
            *-*-darwin*)
slouken@0
  1016
                SDL_LIBS="$SDL_LIBS -framework OpenGL -framework AGL"
slouken@0
  1017
        esac
slouken@0
  1018
    fi
slouken@0
  1019
}
slouken@0
  1020
slouken@0
  1021
dnl See if we can use the new unified event interface in Linux 2.4
slouken@0
  1022
CheckInputEvents()
slouken@0
  1023
{
slouken@0
  1024
    dnl Check for Linux 2.4 unified input event interface support
slouken@0
  1025
    AC_ARG_ENABLE(input-events,
slouken@211
  1026
[  --enable-input-events   use Linux 2.4 unified input interface [default=yes]],
slouken@211
  1027
                  , enable_input_events=yes)
slouken@0
  1028
    if test x$enable_input_events = xyes; then
slouken@0
  1029
        AC_MSG_CHECKING(for Linux 2.4 unified input interface)
slouken@0
  1030
        use_input_events=no
slouken@0
  1031
        AC_TRY_COMPILE([
slouken@0
  1032
          #include <linux/input.h>
slouken@0
  1033
        ],[
slouken@0
  1034
          #ifndef EVIOCGNAME
slouken@0
  1035
          #error EVIOCGNAME() ioctl not available
slouken@0
  1036
          #endif
slouken@0
  1037
        ],[
slouken@0
  1038
        use_input_events=yes
slouken@0
  1039
        ])
slouken@0
  1040
        AC_MSG_RESULT($use_input_events)
slouken@0
  1041
        if test x$use_input_events = xyes; then
slouken@0
  1042
            CFLAGS="$CFLAGS -DUSE_INPUT_EVENTS"
slouken@0
  1043
        fi
slouken@0
  1044
    fi
slouken@0
  1045
}
slouken@0
  1046
slouken@0
  1047
dnl See what type of thread model to use on Linux and Solaris
slouken@0
  1048
CheckPTHREAD()
slouken@0
  1049
{
slouken@0
  1050
    dnl Check for pthread support
slouken@0
  1051
    AC_ARG_ENABLE(pthreads,
slouken@0
  1052
[  --enable-pthreads       use POSIX threads for multi-threading [default=yes]],
slouken@0
  1053
                  , enable_pthreads=yes)
slouken@0
  1054
    dnl This is used on Linux for glibc binary compatibility (Doh!)
slouken@0
  1055
    AC_ARG_ENABLE(pthread-sem,
slouken@86
  1056
[  --enable-pthread-sem    use pthread semaphores [default=yes]],
slouken@0
  1057
                  , enable_pthread_sem=yes)
slouken@0
  1058
    ac_save_libs="$LIBS"
slouken@0
  1059
    case "$target" in
slouken@0
  1060
        *-*-bsdi*)
slouken@0
  1061
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1062
            pthread_lib=""
slouken@0
  1063
            ;;
slouken@0
  1064
        *-*-darwin*)
slouken@0
  1065
            pthread_cflags="-D_THREAD_SAFE"
slouken@0
  1066
# causes Carbon.p complaints?
slouken@0
  1067
#            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1068
            ;;
slouken@0
  1069
        *-*-freebsd*)
slouken@0
  1070
            pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
slouken@0
  1071
            pthread_lib="-pthread"
slouken@0
  1072
            ;;
slouken@43
  1073
        *-*-netbsd*)
slouken@43
  1074
            pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
slouken@43
  1075
            pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
slouken@43
  1076
            ;;
slouken@0
  1077
        *-*-openbsd*)
slouken@0
  1078
            pthread_cflags="-D_REENTRANT"
slouken@0
  1079
            pthread_lib="-pthread"
slouken@0
  1080
            ;;
slouken@0
  1081
        *-*-solaris*)
slouken@0
  1082
            pthread_cflags="-D_REENTRANT"
slouken@0
  1083
            pthread_lib="-lpthread -lposix4"
slouken@0
  1084
            ;;
slouken@0
  1085
        *-*-sysv5*)
slouken@0
  1086
            pthread_cflags="-D_REENTRANT -Kthread"
slouken@0
  1087
            pthread_lib=""
slouken@0
  1088
            ;;
slouken@0
  1089
        *-*-irix*)
slouken@0
  1090
            pthread_cflags="-D_SGI_MP_SOURCE"
slouken@0
  1091
            pthread_lib="-lpthread"
slouken@0
  1092
            ;;
slouken@0
  1093
        *-*-aix*)
slouken@0
  1094
            pthread_cflags="-D_REENTRANT -mthreads"
slouken@0
  1095
            pthread_lib="-lpthread"
slouken@0
  1096
            ;;
slouken@0
  1097
        *-*-qnx*)
slouken@0
  1098
            pthread_cflags=""
slouken@0
  1099
            pthread_lib=""
slouken@0
  1100
            ;;
slouken@0
  1101
        *)
slouken@0
  1102
            pthread_cflags="-D_REENTRANT"
slouken@0
  1103
            pthread_lib="-lpthread"
slouken@0
  1104
            ;;
slouken@0
  1105
    esac
slouken@0
  1106
    LIBS="$LIBS $pthread_lib"
slouken@0
  1107
    if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then
slouken@0
  1108
        AC_MSG_CHECKING(for pthreads)
slouken@0
  1109
        use_pthreads=no
slouken@0
  1110
        AC_TRY_LINK([
slouken@0
  1111
         #include <pthread.h>
slouken@0
  1112
        ],[
slouken@0
  1113
         pthread_attr_t type;
slouken@0
  1114
         pthread_attr_init(&type);
slouken@0
  1115
        ],[
slouken@0
  1116
        use_pthreads=yes
slouken@0
  1117
        ])
slouken@0
  1118
        AC_MSG_RESULT($use_pthreads)
slouken@0
  1119
        if test x$use_pthreads = xyes; then
slouken@0
  1120
            CFLAGS="$CFLAGS $pthread_cflags -DSDL_USE_PTHREADS"
slouken@0
  1121
            SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
slouken@0
  1122
            SDL_LIBS="$SDL_LIBS $pthread_lib"
slouken@0
  1123
slouken@0
  1124
            # Check to see if recursive mutexes are available
slouken@0
  1125
            AC_MSG_CHECKING(for recursive mutexes)
slouken@0
  1126
            has_recursive_mutexes=no
slouken@0
  1127
            AC_TRY_LINK([
slouken@0
  1128
              #include <pthread.h>
slouken@0
  1129
            ],[
slouken@0
  1130
              pthread_mutexattr_t attr;
slouken@0
  1131
              #ifdef linux
slouken@0
  1132
              pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
slouken@0
  1133
              #else
slouken@0
  1134
              pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
slouken@0
  1135
              #endif
slouken@0
  1136
            ],[
slouken@0
  1137
            has_recursive_mutexes=yes
slouken@0
  1138
            ])
slouken@0
  1139
            # Some systems have broken recursive mutex implementations
slouken@0
  1140
            case "$target" in
slouken@0
  1141
                *-*-solaris*)
slouken@0
  1142
                    has_recursive_mutexes=no
slouken@0
  1143
                    ;;
slouken@0
  1144
            esac
slouken@0
  1145
            AC_MSG_RESULT($has_recursive_mutexes)
slouken@0
  1146
            if test x$has_recursive_mutexes != xyes; then
slouken@0
  1147
                CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
slouken@0
  1148
            fi
slouken@0
  1149
slouken@94
  1150
            # Check to see if pthread semaphore support is missing
slouken@94
  1151
            if test x$enable_pthread_sem = xyes; then
slouken@94
  1152
                AC_MSG_CHECKING(for pthread semaphores)
slouken@94
  1153
                have_pthread_sem=no
slouken@94
  1154
                AC_TRY_COMPILE([
slouken@94
  1155
                  #include <pthread.h>
slouken@94
  1156
                  #include <semaphore.h>
slouken@94
  1157
                ],[
slouken@94
  1158
                ],[
slouken@94
  1159
                have_pthread_sem=yes
slouken@94
  1160
                ])
slouken@94
  1161
                AC_MSG_RESULT($have_pthread_sem)
slouken@94
  1162
            fi
slouken@94
  1163
slouken@0
  1164
            # Check to see if this is broken glibc 2.0 pthreads
slouken@0
  1165
            case "$target" in
slouken@0
  1166
                *-*-linux*)
slouken@0
  1167
                    AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
slouken@0
  1168
                    glibc20_pthreads=no
slouken@0
  1169
                    AC_TRY_COMPILE([
slouken@0
  1170
                      #include <features.h>
slouken@0
  1171
                      #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
slouken@0
  1172
                      #warning Working around a bug in glibc 2.0 pthreads
slouken@0
  1173
                      #else
slouken@0
  1174
                      #error pthread implementation okay
slouken@0
  1175
                      #endif /* glibc 2.0 */
slouken@0
  1176
                    ],[
slouken@0
  1177
                    ],[
slouken@0
  1178
                    glibc20_pthreads=yes
slouken@0
  1179
                    ])
slouken@0
  1180
                    AC_MSG_RESULT($glibc20_pthreads)
slouken@0
  1181
            esac
slouken@0
  1182
        fi
slouken@0
  1183
    fi
slouken@0
  1184
    LIBS="$ac_save_libs"
slouken@0
  1185
slouken@0
  1186
    AC_MSG_CHECKING(whether semun is defined in /usr/include/sys/sem.h)
slouken@0
  1187
    have_semun=no
slouken@0
  1188
    AC_TRY_COMPILE([
slouken@0
  1189
      #include <sys/types.h>
slouken@0
  1190
      #include <sys/sem.h>
slouken@0
  1191
    ],[
slouken@0
  1192
      union semun t;
slouken@0
  1193
    ],[
slouken@0
  1194
    have_semun=yes
slouken@0
  1195
    ])
slouken@0
  1196
    AC_MSG_RESULT($have_semun)
slouken@0
  1197
    if test x$have_semun = xyes; then
slouken@0
  1198
        CFLAGS="$CFLAGS -DHAVE_SEMUN"
slouken@0
  1199
    fi
slouken@0
  1200
slouken@0
  1201
    # See if we can use clone() on Linux directly
slouken@0
  1202
    use_clone=no
slouken@0
  1203
    if test x$enable_threads = xyes -a x$use_pthreads != xyes; then
slouken@0
  1204
        case "$target" in
slouken@0
  1205
            *-*-linux*)
slouken@0
  1206
                use_clone=yes
slouken@0
  1207
                ;;
slouken@0
  1208
            *)
slouken@0
  1209
                CFLAGS="$CFLAGS -DFORK_HACK"
slouken@0
  1210
                ;;
slouken@0
  1211
        esac
slouken@0
  1212
    fi
slouken@0
  1213
    AM_CONDITIONAL(USE_CLONE, test x$use_clone = xyes)
slouken@0
  1214
}
slouken@0
  1215
slouken@185
  1216
dnl See if we can use GNU pth library for threads
slouken@185
  1217
CheckPTH()
slouken@185
  1218
{
slouken@185
  1219
    dnl Check for pth support
slouken@185
  1220
    AC_ARG_ENABLE(pth,
slouken@185
  1221
[  --enable-pth            use GNU pth library for multi-threading [default=yes]],
slouken@185
  1222
                  , enable_pth=yes)
slouken@185
  1223
    if test x$enable_threads = xyes -a x$enable_pth = xyes; then
slouken@185
  1224
        AC_PATH_PROG(PTH_CONFIG, pth-config, no)
slouken@185
  1225
        if test "$PTH_CONFIG" = "no"; then
slouken@185
  1226
            use_pth=no
slouken@185
  1227
        else
slouken@185
  1228
            PTH_CFLAGS=`$PTH_CONFIG --cflags`
slouken@185
  1229
            PTH_LIBS=`$PTH_CONFIG --libs`
slouken@185
  1230
            SDL_CFLAGS="$SDL_CFLAGS $PTH_CFLAGS"
slouken@185
  1231
            SDL_LIBS="$SDL_LIBS $PTH_LIBS"
slouken@185
  1232
            use_pth=yes
slouken@185
  1233
        fi
slouken@185
  1234
        AC_MSG_CHECKING(pth)
slouken@185
  1235
        if test "x$use_pth" = xyes; then
slouken@185
  1236
            AC_MSG_RESULT(yes)
slouken@185
  1237
        else
slouken@185
  1238
            AC_MSG_RESULT(no)
slouken@185
  1239
        fi
slouken@185
  1240
    fi
slouken@185
  1241
}
slouken@185
  1242
slouken@0
  1243
dnl Determine whether the compiler can produce Win32 executables
slouken@0
  1244
CheckWIN32()
slouken@0
  1245
{
slouken@0
  1246
    AC_MSG_CHECKING(Win32 compiler)
slouken@0
  1247
    have_win32_gcc=no
slouken@0
  1248
    AC_TRY_COMPILE([
slouken@0
  1249
     #include <windows.h>
slouken@0
  1250
    ],[
slouken@0
  1251
    ],[
slouken@0
  1252
    have_win32_gcc=yes
slouken@0
  1253
    ])
slouken@0
  1254
    AC_MSG_RESULT($have_win32_gcc)
slouken@0
  1255
    if test x$have_win32_gcc != xyes; then
slouken@0
  1256
       AC_MSG_ERROR([
slouken@0
  1257
*** Your compiler ($CC) does not produce Win32 executables!
slouken@0
  1258
       ])
slouken@0
  1259
    fi
slouken@0
  1260
slouken@0
  1261
    dnl See if the user wants to redirect standard output to files
slouken@0
  1262
    AC_ARG_ENABLE(stdio-redirect,
slouken@0
  1263
[  --enable-stdio-redirect Redirect STDIO to files on Win32 [default=yes]],
slouken@0
  1264
                  , enable_stdio_redirect=yes)
slouken@0
  1265
    if test x$enable_stdio_redirect != xyes; then
slouken@0
  1266
        CFLAGS="$CFLAGS -DNO_STDIO_REDIRECT"
slouken@0
  1267
    fi
slouken@0
  1268
}
slouken@0
  1269
slouken@0
  1270
dnl Find the DirectX includes and libraries
slouken@0
  1271
CheckDIRECTX()
slouken@0
  1272
{
slouken@0
  1273
    AC_ARG_ENABLE(directx,
slouken@0
  1274
[  --enable-directx        use DirectX for Win32 audio/video [default=yes]],
slouken@0
  1275
                  , enable_directx=yes)
slouken@0
  1276
    if test x$enable_directx = xyes; then
slouken@0
  1277
        AC_MSG_CHECKING(for DirectX headers and libraries)
slouken@0
  1278
        use_directx=no
slouken@0
  1279
        AC_TRY_COMPILE([
slouken@0
  1280
         #include "src/video/windx5/directx.h"
slouken@0
  1281
        ],[
slouken@0
  1282
        ],[
slouken@0
  1283
        use_directx=yes
slouken@0
  1284
        ])
slouken@0
  1285
        AC_MSG_RESULT($use_directx)
slouken@0
  1286
    fi
slouken@0
  1287
    AM_CONDITIONAL(USE_DIRECTX, test x$use_directx = xyes)
slouken@0
  1288
slouken@0
  1289
    CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/wincommon"
slouken@0
  1290
    SYSTEM_LIBS="$SYSTEM_LIBS -luser32 -lgdi32 -lwinmm"
slouken@0
  1291
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS wincommon"
slouken@0
  1292
    VIDEO_DRIVERS="$VIDEO_DRIVERS wincommon/libvideo_wincommon.la"
slouken@0
  1293
    # Enable the DIB driver
slouken@0
  1294
    CFLAGS="$CFLAGS -DENABLE_WINDIB"
slouken@0
  1295
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS windib"
slouken@0
  1296
    VIDEO_DRIVERS="$VIDEO_DRIVERS windib/libvideo_windib.la"
slouken@0
  1297
    # See if we should enable the DirectX driver
slouken@0
  1298
    if test x$use_directx = xyes; then
slouken@0
  1299
        CFLAGS="$CFLAGS -DENABLE_DIRECTX"
slouken@0
  1300
        SYSTEM_LIBS="$SYSTEM_LIBS -ldxguid"
slouken@0
  1301
        VIDEO_SUBDIRS="$VIDEO_SUBDIRS windx5"
slouken@0
  1302
        VIDEO_DRIVERS="$VIDEO_DRIVERS windx5/libvideo_windx5.la"
slouken@0
  1303
    fi
slouken@0
  1304
}
slouken@0
  1305
slouken@0
  1306
dnl Set up the BWindow video driver on BeOS
slouken@0
  1307
CheckBWINDOW()
slouken@0
  1308
{
slouken@0
  1309
    CFLAGS="$CFLAGS -DENABLE_BWINDOW"
slouken@0
  1310
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS bwindow"
slouken@0
  1311
    VIDEO_DRIVERS="$VIDEO_DRIVERS bwindow/libvideo_bwindow.la"
slouken@0
  1312
}
slouken@0
  1313
slouken@0
  1314
dnl Set up the Mac toolbox video driver for Mac OS 7-9
slouken@0
  1315
CheckTOOLBOX()
slouken@0
  1316
{
slouken@0
  1317
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1318
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1319
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1320
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
slouken@0
  1321
}
slouken@0
  1322
slouken@0
  1323
dnl Set up the Mac toolbox video driver for Mac OS X
slouken@0
  1324
CheckCARBON()
slouken@0
  1325
{
slouken@0
  1326
    # "MACOSX" is not an official definition, but it's commonly
slouken@0
  1327
    # accepted as a way to differentiate between what runs on X
slouken@0
  1328
    # and what runs on older Macs - while in theory "Carbon" defns
slouken@0
  1329
    # are consistent between the two, in practice Carbon is still
slouken@0
  1330
    # changing. -sts Aug 2000
slouken@0
  1331
    mac_autoconf_target_workaround="MAC"
slouken@0
  1332
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
slouken@0
  1333
      -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
  1334
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS maccommon"
slouken@0
  1335
    VIDEO_DRIVERS="$VIDEO_DRIVERS maccommon/libvideo_maccommon.la"
slouken@0
  1336
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS macrom"
slouken@0
  1337
    VIDEO_DRIVERS="$VIDEO_DRIVERS macrom/libvideo_macrom.la"
slouken@0
  1338
}
slouken@0
  1339
slouken@158
  1340
dnl Set up the Mac toolbox video driver for Mac OS X
slouken@158
  1341
CheckQUARTZ()
slouken@158
  1342
{
slouken@158
  1343
    # "MACOSX" is not an official definition, but it's commonly
slouken@158
  1344
    # accepted as a way to differentiate between what runs on X
slouken@158
  1345
    # and what runs on older Macs - while in theory "Carbon" defns
slouken@158
  1346
    # are consistent between the two, in practice Carbon is still
slouken@158
  1347
    # changing. -sts Aug 2000
slouken@166
  1348
    mac_autoconf_target_workaround="MAC"
slouken@158
  1349
    CFLAGS="$CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers \
slouken@158
  1350
      -I/System/Library/Frameworks/Cocoa.framework/Headers -fpascal-strings \
slouken@166
  1351
      -DENABLE_QUARTZ -DMACOSX -DTARGET_API_${mac_autoconf_target_workaround}_CARBON=1 -I\$(top_srcdir)/src/video/quartz"
slouken@158
  1352
    VIDEO_SUBDIRS="$VIDEO_SUBDIRS quartz"
slouken@158
  1353
    VIDEO_DRIVERS="$VIDEO_DRIVERS quartz/libvideo_quartz.la"
slouken@158
  1354
}
slouken@158
  1355
slouken@0
  1356
case "$target" in
slouken@0
  1357
    *-*-linux*)
slouken@0
  1358
        ARCH=linux
slouken@1
  1359
        CheckDummyVideo
slouken@68
  1360
        CheckDiskAudio
slouken@0
  1361
        CheckNASM
slouken@0
  1362
        CheckOSS
slouken@0
  1363
        CheckALSA
slouken@0
  1364
        CheckARTSC
slouken@0
  1365
        CheckESD
slouken@0
  1366
        CheckNAS
slouken@0
  1367
        CheckX11
slouken@30
  1368
        CheckNANOX
slouken@0
  1369
        CheckDGA
slouken@0
  1370
        CheckFBCON
slouken@167
  1371
        CheckDirectFB
slouken@70
  1372
        CheckPS2GS
slouken@0
  1373
        CheckGGI
slouken@0
  1374
        CheckSVGA
slouken@0
  1375
        CheckAAlib
slouken@0
  1376
        CheckOpenGL
slouken@0
  1377
        CheckInputEvents
slouken@0
  1378
        CheckPTHREAD
slouken@0
  1379
        # Set up files for the main() stub
slouken@0
  1380
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1381
        # Set up files for the audio library
slouken@0
  1382
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  1383
        #if test x$enable_audio = xyes; then
slouken@148
  1384
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1385
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1386
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1387
        #fi
slouken@0
  1388
        # Set up files for the joystick library
slouken@0
  1389
        if test x$enable_joystick = xyes; then
slouken@0
  1390
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS linux"
slouken@0
  1391
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS linux/libjoystick_linux.la"
slouken@0
  1392
        fi
slouken@0
  1393
        # Set up files for the cdrom library
slouken@0
  1394
        if test x$enable_cdrom = xyes; then
slouken@153
  1395
            CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
slouken@153
  1396
            CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
slouken@0
  1397
        fi
slouken@0
  1398
        # Set up files for the thread library
slouken@0
  1399
        if test x$enable_threads = xyes; then
slouken@0
  1400
            if test x$use_pthreads != xyes; then
slouken@0
  1401
                COPY_ARCH_SRC(src/thread, linux, clone.S)
slouken@0
  1402
            fi
slouken@0
  1403
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1404
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@94
  1405
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@0
  1406
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1407
            else
slouken@0
  1408
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1409
            fi
slouken@0
  1410
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1411
            if test x$glibc20_pthreads = xyes; then
slouken@0
  1412
                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  1413
                COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  1414
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1415
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1416
            else
slouken@0
  1417
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1418
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1419
                COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1420
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1421
            fi
slouken@0
  1422
        fi
slouken@0
  1423
        # Set up files for the timer library
slouken@0
  1424
        if test x$enable_timers = xyes; then
slouken@0
  1425
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1426
        fi
slouken@0
  1427
        ;;
slouken@0
  1428
    *-*-bsdi*)
slouken@0
  1429
        ARCH=bsdi
slouken@1
  1430
        CheckDummyVideo
slouken@68
  1431
        CheckDiskAudio
slouken@0
  1432
        CheckNASM
slouken@0
  1433
        CheckOSS
slouken@35
  1434
        CheckARTSC
slouken@35
  1435
        CheckESD
slouken@0
  1436
        CheckNAS
slouken@0
  1437
        CheckX11
slouken@0
  1438
        CheckDGA
slouken@0
  1439
        CheckSVGA
slouken@0
  1440
        CheckAAlib
slouken@0
  1441
        CheckOpenGL
slouken@0
  1442
        CheckPTHREAD
slouken@0
  1443
        # Set up files for the main() stub
slouken@0
  1444
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@148
  1445
        # Set up files for the audio library
slouken@148
  1446
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@148
  1447
        #if test x$enable_audio = xyes; then
slouken@148
  1448
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@148
  1449
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@148
  1450
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@148
  1451
        #fi
slouken@0
  1452
        # Set up files for the joystick library
slouken@0
  1453
        # (No joystick support yet)
slouken@0
  1454
        if test x$enable_joystick = xyes; then
slouken@0
  1455
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1456
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1457
        fi
slouken@0
  1458
        # Set up files for the cdrom library
slouken@0
  1459
        if test x$enable_cdrom = xyes; then
slouken@178
  1460
            CDROM_SUBDIRS="$CDROM_SUBDIRS bsdi"
slouken@178
  1461
            CDROM_DRIVERS="$CDROM_DRIVERS bsdi/libcdrom_bsdi.la"
slouken@0
  1462
        fi
slouken@0
  1463
        # Set up files for the thread library
slouken@0
  1464
        if test x$enable_threads = xyes; then
slouken@0
  1465
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1466
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1467
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1468
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@191
  1469
            COPY_ARCH_SRC(src/thread, bsdi, SDL_syssem.c)
slouken@0
  1470
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1471
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1472
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1473
        fi
slouken@0
  1474
        # Set up files for the timer library
slouken@0
  1475
        if test x$enable_timers = xyes; then
slouken@0
  1476
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1477
        fi
slouken@0
  1478
        ;;
slouken@0
  1479
    *-*-freebsd*)
slouken@0
  1480
        ARCH=freebsd
slouken@1
  1481
        CheckDummyVideo
slouken@68
  1482
        CheckDiskAudio
slouken@129
  1483
        CheckVGL
slouken@0
  1484
        CheckNASM
slouken@0
  1485
        CheckOSS
slouken@0
  1486
        CheckARTSC
slouken@0
  1487
        CheckESD
slouken@0
  1488
        CheckNAS
slouken@0
  1489
        CheckX11
slouken@0
  1490
        CheckDGA
slouken@0
  1491
        CheckSVGA
slouken@0
  1492
        CheckAAlib
slouken@0
  1493
        CheckOpenGL
slouken@0
  1494
        CheckPTHREAD
slouken@0
  1495
        # Set up files for the main() stub
slouken@0
  1496
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1497
        # Set up files for the audio library
slouken@0
  1498
        # We use the OSS and ALSA API's, not the Sun audio API
slouken@0
  1499
        #if test x$enable_audio = xyes; then
slouken@148
  1500
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1501
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1502
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1503
        #fi
slouken@0
  1504
        # Set up files for the joystick library
slouken@0
  1505
        if test x$enable_joystick = xyes; then
slouken@278
  1506
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@278
  1507
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@0
  1508
        fi
slouken@0
  1509
        # Set up files for the cdrom library
slouken@0
  1510
        if test x$enable_cdrom = xyes; then
slouken@153
  1511
            CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
slouken@153
  1512
            CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
slouken@0
  1513
        fi
slouken@0
  1514
        # Set up files for the thread library
slouken@0
  1515
        if test x$enable_threads = xyes; then
slouken@0
  1516
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1517
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1518
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1519
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  1520
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@0
  1521
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1522
            else
slouken@0
  1523
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1524
            fi
slouken@0
  1525
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1526
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1527
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1528
        fi
slouken@0
  1529
        # Set up files for the timer library
slouken@0
  1530
        if test x$enable_timers = xyes; then
slouken@0
  1531
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1532
        fi
slouken@0
  1533
        ;;
slouken@0
  1534
    *-*-netbsd*)
slouken@0
  1535
        ARCH=netbsd
slouken@1
  1536
        CheckDummyVideo
slouken@68
  1537
        CheckDiskAudio
slouken@0
  1538
        CheckNASM
slouken@0
  1539
        CheckOSS
slouken@0
  1540
        CheckARTSC
slouken@0
  1541
        CheckESD
slouken@0
  1542
        CheckNAS
slouken@0
  1543
        CheckX11
slouken@0
  1544
        CheckAAlib
slouken@0
  1545
        CheckOpenGL
slouken@0
  1546
        CheckPTHREAD
slouken@0
  1547
        # Set up files for the main() stub
slouken@0
  1548
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1549
        # Set up files for the audio library
slouken@0
  1550
        if test x$enable_audio = xyes; then
slouken@148
  1551
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1552
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1553
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1554
        fi
slouken@0
  1555
        # Set up files for the joystick library
slouken@0
  1556
        if test x$enable_joystick = xyes; then
slouken@278
  1557
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@278
  1558
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@0
  1559
        fi
slouken@0
  1560
        # Set up files for the cdrom library
slouken@0
  1561
        if test x$enable_cdrom = xyes; then
slouken@153
  1562
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@153
  1563
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@0
  1564
        fi
slouken@0
  1565
        # Set up files for the thread library
slouken@0
  1566
        if test x$enable_threads = xyes; then
slouken@0
  1567
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1568
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1569
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1570
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  1571
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@41
  1572
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@41
  1573
            else
slouken@41
  1574
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@41
  1575
            fi
slouken@0
  1576
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1577
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1578
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1579
        fi
slouken@0
  1580
        # Set up files for the timer library
slouken@0
  1581
        if test x$enable_timers = xyes; then
slouken@0
  1582
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1583
        fi
slouken@0
  1584
        # NetBSD does not define "unix"
slouken@43
  1585
        CFLAGS="$CFLAGS -Dunix -D_POSIX_THREAD_SYSCALL_SOFT=1"
slouken@0
  1586
        ;;
slouken@0
  1587
    *-*-openbsd*)
slouken@0
  1588
        ARCH=openbsd
slouken@1
  1589
        CheckDummyVideo
slouken@68
  1590
        CheckDiskAudio
slouken@94
  1591
        CheckOPENBSDAUDIO
slouken@0
  1592
        CheckNASM
slouken@0
  1593
        CheckOSS
slouken@0
  1594
        CheckARTSC
slouken@0
  1595
        CheckESD
slouken@0
  1596
        CheckNAS
slouken@0
  1597
        CheckX11
slouken@0
  1598
        CheckAAlib
slouken@0
  1599
        CheckOpenGL
slouken@0
  1600
        CheckPTHREAD
slouken@0
  1601
        # Set up files for the main() stub
slouken@0
  1602
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1603
        # Set up files for the audio library
slouken@94
  1604
        # We use the OSS and native API's, not the Sun audio API
slouken@94
  1605
        #if test x$enable_audio = xyes; then
slouken@148
  1606
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@94
  1607
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@94
  1608
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@94
  1609
        #fi
slouken@94
  1610
        # OpenBSD needs linking with ossaudio emulation library
slouken@94
  1611
        if test x$have_oss = xyes; then
slouken@94
  1612
            SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
slouken@94
  1613
        fi
slouken@0
  1614
        # Set up files for the joystick library
slouken@0
  1615
        if test x$enable_joystick = xyes; then
slouken@278
  1616
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
slouken@278
  1617
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
slouken@0
  1618
        fi
slouken@0
  1619
        # Set up files for the cdrom library
slouken@0
  1620
        if test x$enable_cdrom = xyes; then
slouken@153
  1621
            CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
slouken@153
  1622
            CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
slouken@0
  1623
        fi
slouken@0
  1624
        # Set up files for the thread library
slouken@0
  1625
        if test x$enable_threads = xyes; then
slouken@0
  1626
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1627
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1628
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1629
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  1630
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@0
  1631
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1632
            else
slouken@0
  1633
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1634
            fi
slouken@0
  1635
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1636
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1637
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1638
        fi
slouken@0
  1639
        # Set up files for the timer library
slouken@0
  1640
        if test x$enable_timers = xyes; then
slouken@0
  1641
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1642
        fi
slouken@37
  1643
        # OpenBSD does not define "unix"
slouken@37
  1644
        CFLAGS="$CFLAGS -Dunix"
slouken@0
  1645
        ;;
slouken@0
  1646
    *-*-sysv5*)
slouken@0
  1647
        ARCH=sysv5
slouken@1
  1648
        CheckDummyVideo
slouken@68
  1649
        CheckDiskAudio
slouken@0
  1650
        CheckNASM
slouken@0
  1651
        CheckOSS
slouken@0
  1652
        CheckARTSC
slouken@0
  1653
        CheckESD
slouken@0
  1654
        CheckNAS
slouken@0
  1655
        CheckX11
slouken@0
  1656
        CheckAAlib
slouken@0
  1657
        CheckOpenGL
slouken@0
  1658
        CheckPTHREAD
slouken@0
  1659
        # Set up files for the main() stub
slouken@0
  1660
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1661
        # Set up files for the audio library
slouken@0
  1662
        if test x$enable_audio = xyes; then
slouken@148
  1663
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1664
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1665
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1666
        fi
slouken@0
  1667
        # Set up files for the joystick library
slouken@0
  1668
        # (No joystick support yet)
slouken@0
  1669
        if test x$enable_joystick = xyes; then
slouken@0
  1670
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1671
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1672
        fi
slouken@0
  1673
        # Set up files for the cdrom library
slouken@0
  1674
        if test x$enable_cdrom = xyes; then
slouken@153
  1675
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  1676
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  1677
        fi
slouken@0
  1678
        # Set up files for the thread library
slouken@0
  1679
        if test x$enable_threads = xyes; then
slouken@0
  1680
            COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
slouken@0
  1681
            COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
slouken@0
  1682
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  1683
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  1684
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1685
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1686
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1687
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1688
        fi
slouken@0
  1689
        # Set up files for the timer library
slouken@0
  1690
        if test x$enable_timers = xyes; then
slouken@0
  1691
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1692
        fi
slouken@0
  1693
        ;;
slouken@0
  1694
    *-*-solaris*)
slouken@0
  1695
        ARCH=solaris
slouken@1
  1696
        CFLAGS="$CFLAGS -D__ELF__" # Fix for nasm on Solaris x86
slouken@1
  1697
        CheckDummyVideo
slouken@68
  1698
        CheckDiskAudio
slouken@0
  1699
        CheckNASM
slouken@35
  1700
        CheckOSS
slouken@0
  1701
        CheckARTSC
slouken@0
  1702
        CheckESD
slouken@0
  1703
        CheckNAS
slouken@0
  1704
        CheckX11
slouken@0
  1705
        CheckAAlib
slouken@0
  1706
        CheckOpenGL
slouken@0
  1707
        CheckPTHREAD
slouken@0
  1708
        # Set up files for the main() stub
slouken@0
  1709
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1710
        # Set up files for the audio library
slouken@0
  1711
        if test x$enable_audio = xyes; then
slouken@148
  1712
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1713
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1714
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1715
        fi
slouken@0
  1716
        # Set up files for the joystick library
slouken@0
  1717
        # (No joystick support yet)
slouken@0
  1718
        if test x$enable_joystick = xyes; then
slouken@0
  1719
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1720
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1721
        fi
slouken@0
  1722
        # Set up files for the cdrom library
slouken@0
  1723
        if test x$enable_cdrom = xyes; then
slouken@153
  1724
            CDROM_SUBDIRS="$CDROM_SUBDIRS linux"
slouken@153
  1725
            CDROM_DRIVERS="$CDROM_DRIVERS linux/libcdrom_linux.la"
slouken@0
  1726
        fi
slouken@0
  1727
        # Set up files for the thread library
slouken@0
  1728
        if test x$enable_threads = xyes; then
slouken@0
  1729
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1730
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1731
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1732
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1733
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1734
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1735
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1736
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1737
        fi
slouken@0
  1738
        # Set up files for the timer library
slouken@0
  1739
        if test x$enable_timers = xyes; then
slouken@0
  1740
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1741
        fi
slouken@0
  1742
        ;;
slouken@0
  1743
    *-*-irix*)
slouken@0
  1744
        ARCH=irix
slouken@1
  1745
        CheckDummyVideo
slouken@68
  1746
        CheckDiskAudio
slouken@148
  1747
        CheckDMEDIA
slouken@148
  1748
        CheckESD
slouken@0
  1749
        CheckNAS
slouken@0
  1750
        CheckX11
slouken@0
  1751
        CheckAAlib
slouken@0
  1752
        CheckOpenGL
slouken@0
  1753
        CheckPTHREAD
slouken@0
  1754
        # Set up files for the main() stub
slouken@0
  1755
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@148
  1756
        # We use the dmedia audio API, not the Sun audio API
slouken@148
  1757
        #if test x$enable_audio = xyes; then
slouken@148
  1758
        #    CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@148
  1759
        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@148
  1760
        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@148
  1761
        #fi
slouken@0
  1762
        # Set up files for the joystick library
slouken@0
  1763
        # (No joystick support yet)
slouken@0
  1764
        if test x$enable_joystick = xyes; then
slouken@0
  1765
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1766
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1767
        fi
slouken@0
  1768
        # Set up files for the cdrom library
slouken@0
  1769
        # (No CD-ROM support yet)
slouken@0
  1770
        if test x$enable_cdrom = xyes; then
slouken@153
  1771
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  1772
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  1773
        fi
slouken@0
  1774
        # Set up files for the thread library
slouken@0
  1775
        if test x$enable_threads = xyes; then
slouken@0
  1776
            if test x$use_pthreads = xyes; then
slouken@0
  1777
                COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1778
                COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1779
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1780
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  1781
                if test x$have_pthread_sem != xyes; then
slouken@0
  1782
                    COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1783
                else
slouken@0
  1784
                    COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1785
                fi
slouken@0
  1786
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1787
                COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1788
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1789
            else
slouken@0
  1790
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread.c)
slouken@0
  1791
                COPY_ARCH_SRC(src/thread, irix, SDL_systhread_c.h)
slouken@0
  1792
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1793
                COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1794
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1795
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1796
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  1797
                COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1798
            fi
slouken@0
  1799
        fi
slouken@0
  1800
        # Set up files for the timer library
slouken@0
  1801
        if test x$enable_timers = xyes; then
slouken@0
  1802
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1803
        fi
slouken@0
  1804
        ;;
slouken@0
  1805
    *-*-hpux*)
slouken@0
  1806
        ARCH=hpux
slouken@1
  1807
        CheckDummyVideo
slouken@68
  1808
        CheckDiskAudio
slouken@35
  1809
        CheckOSS
slouken@0
  1810
        CheckNAS
slouken@0
  1811
        CheckX11
slouken@0
  1812
        CheckGGI
slouken@0
  1813
        CheckAAlib
slouken@0
  1814
        CheckOpenGL
slouken@0
  1815
        CheckPTHREAD
slouken@0
  1816
        # Set up files for the main() stub
slouken@0
  1817
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1818
        # Set up files for the audio library
slouken@0
  1819
        if test x$enable_audio = xyes; then
slouken@148
  1820
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1821
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1822
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1823
        fi
slouken@0
  1824
        # Set up files for the joystick library
slouken@0
  1825
        # (No joystick support yet)
slouken@0
  1826
        if test x$enable_joystick = xyes; then
slouken@0
  1827
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1828
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1829
        fi
slouken@0
  1830
        # Set up files for the cdrom library
slouken@0
  1831
        # (No CD-ROM support yet)
slouken@0
  1832
        if test x$enable_cdrom = xyes; then
slouken@153
  1833
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  1834
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  1835
        fi
slouken@0
  1836
        # Set up files for the thread library
slouken@0
  1837
        if test x$enable_threads = xyes; then
slouken@0
  1838
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1839
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1840
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1841
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1842
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1843
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1844
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1845
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1846
        fi
slouken@0
  1847
        # Set up files for the timer library
slouken@0
  1848
        if test x$enable_timers = xyes; then
slouken@0
  1849
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1850
        fi
slouken@0
  1851
        ;;
slouken@0
  1852
    *-*-aix*)
slouken@0
  1853
        ARCH=aix
slouken@1
  1854
        CheckDummyVideo
slouken@68
  1855
        CheckDiskAudio
slouken@35
  1856
        CheckOSS
slouken@0
  1857
        CheckNAS
slouken@0
  1858
        CheckX11
slouken@0
  1859
        CheckGGI
slouken@0
  1860
        CheckAAlib
slouken@0
  1861
        CheckOpenGL
slouken@0
  1862
        CheckPTHREAD
slouken@0
  1863
        # Set up files for the main() stub
slouken@0
  1864
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1865
        # Set up files for the audio library
slouken@0
  1866
        if test x$enable_audio = xyes; then
slouken@0
  1867
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS paudio"
slouken@0
  1868
            AUDIO_DRIVERS="$AUDIO_DRIVERS paudio/libaudio_paudio.la"
slouken@0
  1869
        fi
slouken@0
  1870
        # Set up files for the joystick library
slouken@0
  1871
        # (No joystick support yet)
slouken@0
  1872
        if test x$enable_joystick = xyes; then
slouken@0
  1873
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1874
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1875
        fi
slouken@0
  1876
        # Set up files for the cdrom library
slouken@0
  1877
        if test x$enable_cdrom = xyes; then
slouken@153
  1878
            CDROM_SUBDIRS="$CDROM_SUBDIRS aix"
slouken@153
  1879
            CDROM_DRIVERS="$CDROM_DRIVERS aix/libcdrom_aix.la"
slouken@0
  1880
        fi
slouken@0
  1881
        # Set up files for the thread library
slouken@0
  1882
        if test x$enable_threads = xyes; then
slouken@0
  1883
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1884
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1885
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1886
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1887
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1888
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1889
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1890
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1891
        fi
slouken@0
  1892
        # Set up files for the timer library
slouken@0
  1893
        if test x$enable_timers = xyes; then
slouken@0
  1894
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1895
        fi
slouken@0
  1896
        ;;
slouken@0
  1897
    *-*-osf*)
slouken@0
  1898
        ARCH=osf
slouken@1
  1899
        CheckDummyVideo
slouken@68
  1900
        CheckDiskAudio
slouken@0
  1901
        CheckNAS
slouken@0
  1902
        CheckX11
slouken@0
  1903
        CheckGGI
slouken@0
  1904
        CheckAAlib
slouken@0
  1905
        CheckOpenGL
slouken@0
  1906
        CheckPTHREAD
slouken@0
  1907
        # Set up files for the main() stub
slouken@0
  1908
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1909
        # Set up files for the audio library
slouken@0
  1910
        if test x$enable_audio = xyes; then
slouken@148
  1911
            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
slouken@0
  1912
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@0
  1913
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@0
  1914
        fi
slouken@0
  1915
        # Set up files for the joystick library
slouken@0
  1916
        # (No joystick support yet)
slouken@0
  1917
        if test x$enable_joystick = xyes; then
slouken@0
  1918
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1919
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1920
        fi
slouken@0
  1921
        # Set up files for the cdrom library
slouken@0
  1922
        # (No cdrom support yet)
slouken@0
  1923
        if test x$enable_cdrom = xyes; then
slouken@153
  1924
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  1925
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  1926
        fi
slouken@0
  1927
        # Set up files for the thread library
slouken@0
  1928
        if test x$enable_threads = xyes; then
slouken@0
  1929
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1930
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1931
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1932
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1933
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  1934
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1935
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1936
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1937
        fi
slouken@0
  1938
        # Set up files for the timer library
slouken@0
  1939
        if test x$enable_timers = xyes; then
slouken@0
  1940
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1941
        fi
slouken@0
  1942
        ;;
slouken@0
  1943
    *-*-qnx*)
slouken@0
  1944
        ARCH=qnx
slouken@1
  1945
        CheckDummyVideo
slouken@68
  1946
        CheckDiskAudio
slouken@0
  1947
        CheckNAS
slouken@0
  1948
        CheckPHOTON
slouken@0
  1949
        CheckX11
slouken@0
  1950
        CheckOpenGL
slouken@0
  1951
        CheckPTHREAD
slouken@0
  1952
        # Set up files for the main() stub
slouken@0
  1953
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  1954
        # Set up files for the audio library
slouken@0
  1955
        if test x$enable_audio = xyes; then
slouken@0
  1956
            CFLAGS="$CFLAGS -DALSA_SUPPORT"
slouken@0
  1957
            SYSTEM_LIBS="$SYSTEM_LIBS -lasound"
slouken@0
  1958
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS nto"
slouken@0
  1959
            AUDIO_DRIVERS="$AUDIO_DRIVERS nto/libaudio_nto.la"
slouken@0
  1960
        fi
slouken@0
  1961
        # Set up files for the joystick library
slouken@0
  1962
        if test x$enable_joystick = xyes; then
slouken@0
  1963
        # (No joystick support yet)
slouken@0
  1964
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@0
  1965
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@0
  1966
        fi
slouken@0
  1967
        # Set up files for the cdrom library
slouken@0
  1968
        if test x$enable_cdrom = xyes; then
slouken@153
  1969
            CDROM_SUBDIRS="$CDROM_SUBDIRS qnx"
slouken@153
  1970
            CDROM_DRIVERS="$CDROM_DRIVERS qnx/libcdrom_qnx.la"
slouken@0
  1971
        fi
slouken@0
  1972
        # Set up files for the thread library
slouken@0
  1973
        if test x$enable_threads = xyes; then
slouken@0
  1974
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  1975
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  1976
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  1977
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@0
  1978
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  1979
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  1980
            COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
slouken@0
  1981
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  1982
        fi
slouken@0
  1983
        # Set up files for the timer library
slouken@0
  1984
        if test x$enable_timers = xyes; then
slouken@0
  1985
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  1986
        fi
slouken@0
  1987
        ;;
slouken@0
  1988
    *-*-cygwin* | *-*-mingw32*)
slouken@0
  1989
        ARCH=win32
slouken@0
  1990
        if test "$build" != "$target"; then # cross-compiling
slouken@0
  1991
            # Default cross-compile location
slouken@0
  1992
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
slouken@0
  1993
        else
slouken@0
  1994
            # Look for the location of the tools and install there
slouken@1
  1995
            if [ "$BUILD_PREFIX" != "" ]; then
slouken@1
  1996
                ac_default_prefix=$BUILD_PREFIX
slouken@1
  1997
            fi
slouken@0
  1998
        fi
slouken@1
  1999
        CheckDummyVideo
slouken@68
  2000
        CheckDiskAudio
slouken@0
  2001
        CheckWIN32
slouken@0
  2002
        CheckDIRECTX
slouken@0
  2003
        CheckNASM
slouken@0
  2004
        # Set up files for the main() stub
slouken@0
  2005
        COPY_ARCH_SRC(src/main, win32, SDL_main.c)
slouken@0
  2006
        # Set up files for the audio library
slouken@0
  2007
        if test x$enable_audio = xyes; then
slouken@0
  2008
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS windib"
slouken@0
  2009
            AUDIO_DRIVERS="$AUDIO_DRIVERS windib/libaudio_windib.la"
slouken@0
  2010
            if test x$use_directx = xyes; then
slouken@41
  2011
                AUDIO_SUBDIRS="$AUDIO_SUBDIRS windx5"
slouken@41
  2012
                AUDIO_DRIVERS="$AUDIO_DRIVERS windx5/libaudio_windx5.la"
slouken@0
  2013
            fi
slouken@0
  2014
        fi
slouken@0
  2015
        # Set up files for the joystick library
slouken@0
  2016
        if test x$enable_joystick = xyes; then
slouken@0
  2017
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS win32"
slouken@0
  2018
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS win32/libjoystick_winmm.la"
slouken@0
  2019
        fi
slouken@0
  2020
        # Set up files for the cdrom library
slouken@0
  2021
        if test x$enable_cdrom = xyes; then
slouken@153
  2022
            CDROM_SUBDIRS="$CDROM_SUBDIRS win32"
slouken@153
  2023
            CDROM_DRIVERS="$CDROM_DRIVERS win32/libcdrom_win32.la"
slouken@0
  2024
        fi
slouken@0
  2025
        # Set up files for the thread library
slouken@0
  2026
        if test x$enable_threads = xyes; then
slouken@0
  2027
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread.c)
slouken@0
  2028
            COPY_ARCH_SRC(src/thread, win32, SDL_systhread_c.h)
slouken@0
  2029
            COPY_ARCH_SRC(src/thread, win32, SDL_sysmutex.c)
slouken@0
  2030
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2031
            COPY_ARCH_SRC(src/thread, win32, SDL_syssem.c)
slouken@0
  2032
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2033
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2034
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2035
        fi
slouken@0
  2036
        # Set up files for the timer library
slouken@0
  2037
        if test x$enable_timers = xyes; then
slouken@0
  2038
            COPY_ARCH_SRC(src/timer, win32, SDL_systimer.c)
slouken@0
  2039
        fi
slouken@0
  2040
        # The Win32 platform requires special setup
slouken@0
  2041
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@1
  2042
        case "$target" in
slouken@1
  2043
            *-*-cygwin*)
slouken@263
  2044
                CFLAGS="$CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
slouken@263
  2045
                SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
slouken@1
  2046
                LIBS="$LIBS -mno-cygwin"
slouken@1
  2047
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
slouken@1
  2048
                ;;
slouken@1
  2049
            *-*-mingw32*)
slouken@1
  2050
                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
slouken@1
  2051
                ;;
slouken@1
  2052
        esac
slouken@0
  2053
        ;;
slouken@0
  2054
    *-*-beos*)
slouken@0
  2055
        ARCH=beos
slouken@0
  2056
        ac_default_prefix=/boot/develop/tools/gnupro
slouken@1
  2057
        CheckDummyVideo
slouken@68
  2058
        CheckDiskAudio
slouken@0
  2059
        CheckNASM
slouken@0
  2060
        CheckBWINDOW
slouken@0
  2061
        CheckBeGL
slouken@0
  2062
        # Set up files for the main() stub
slouken@0
  2063
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@0
  2064
        COPY_ARCH_SRC(src/main, beos, SDL_BeApp.cc)
slouken@0
  2065
        COPY_ARCH_SRC(src/main, beos, SDL_BeApp.h)
slouken@0
  2066
        # Set up files for the audio library
slouken@0
  2067
        if test x$enable_audio = xyes; then
slouken@0
  2068
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS baudio"
slouken@0
  2069
            AUDIO_DRIVERS="$AUDIO_DRIVERS baudio/libaudio_baudio.la"
slouken@0
  2070
        fi
slouken@0
  2071
        # Set up files for the joystick library
slouken@0
  2072
        if test x$enable_joystick = xyes; then
slouken@0
  2073
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS beos"
slouken@0
  2074
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS beos/libjoystick_beos.la"
slouken@0
  2075
        fi
slouken@0
  2076
        # Set up files for the cdrom library
slouken@0
  2077
        if test x$enable_cdrom = xyes; then
slouken@153
  2078
            CDROM_SUBDIRS="$CDROM_SUBDIRS beos"
slouken@153
  2079
            CDROM_DRIVERS="$CDROM_DRIVERS beos/libcdrom_beos.la"
slouken@0
  2080
        fi
slouken@0
  2081
        # Set up files for the thread library
slouken@0
  2082
        if test x$enable_threads = xyes; then
slouken@0
  2083
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread.c)
slouken@0
  2084
            COPY_ARCH_SRC(src/thread, beos, SDL_systhread_c.h)
slouken@0
  2085
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  2086
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2087
            COPY_ARCH_SRC(src/thread, beos, SDL_syssem.c)
slouken@0
  2088
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2089
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2090
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2091
        fi
slouken@0
  2092
        # Set up files for the timer library
slouken@0
  2093
        if test x$enable_timers = xyes; then
slouken@0
  2094
            COPY_ARCH_SRC(src/timer, beos, SDL_systimer.c)
slouken@0
  2095
        fi
slouken@0
  2096
        # The BeOS platform requires special libraries
slouken@0
  2097
        SYSTEM_LIBS="$SYSTEM_LIBS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
slouken@0
  2098
        ;;
slouken@0
  2099
    *-*-macos*)
slouken@0
  2100
        # This would be used if cross-compiling to MacOS 9.  No way to
slouken@0
  2101
        # use it at present, but Apple is working on a X-to-9 compiler
slouken@0
  2102
        # for which this case would be handy.
slouken@0
  2103
        ARCH=macos
slouken@1
  2104
        CheckDummyVideo
slouken@68
  2105
        CheckDiskAudio
slouken@0
  2106
        CheckTOOLBOX
slouken@0
  2107
        CheckMacGL
slouken@0
  2108
        # Set up files for the main() stub
slouken@0
  2109
        COPY_ARCH_SRC(src/main, macos, SDL_main.c)
slouken@0
  2110
        # Set up files for the audio library
slouken@0
  2111
        if test x$enable_audio = xyes; then
slouken@0
  2112
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  2113
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.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@0
  2117
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS macos"
slouken@0
  2118
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS macos/libjoystick_macos.la"
slouken@0
  2119
        fi
slouken@0
  2120
        # Set up files for the cdrom library
slouken@0
  2121
        if test x$enable_cdrom = xyes; then
slouken@153
  2122
            CDROM_SUBDIRS="$CDROM_SUBDIRS macos"
slouken@153
  2123
            CDROM_DRIVERS="$CDROM_DRIVERS macos/libcdrom_macos.la"
slouken@0
  2124
        fi
slouken@0
  2125
        # Set up files for the thread library
slouken@0
  2126
        if test x$enable_threads = xyes; then
slouken@0
  2127
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread.c)
slouken@0
  2128
            COPY_ARCH_SRC(src/thread, macos, SDL_systhread_c.h)
slouken@0
  2129
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@0
  2130
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@0
  2131
            COPY_ARCH_SRC(src/thread, macos, SDL_syssem.c)
slouken@0
  2132
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2133
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2134
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2135
        fi
slouken@0
  2136
        # Set up files for the timer library
slouken@0
  2137
        if test x$enable_timers = xyes; then
slouken@0
  2138
            COPY_ARCH_SRC(src/timer, macos, SDL_systimer.c)
slouken@0
  2139
        fi
slouken@0
  2140
        # The MacOS platform requires special setup
slouken@0
  2141
        SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
slouken@0
  2142
        SDL_LIBS="-lSDLmain $SDL_LIBS"
slouken@0
  2143
        ;;
slouken@0
  2144
    *-*-darwin* )
slouken@0
  2145
        # Strictly speaking, we want "Mac OS X", not "Darwin", which is
slouken@158
  2146
        # just the OS X kernel sans upper layers like Carbon and Cocoa.
slouken@158
  2147
        # But config.guess comes back with "darwin", so go with the flow.
slouken@158
  2148
        ARCH=macosx
slouken@1
  2149
        CheckDummyVideo
slouken@68
  2150
        CheckDiskAudio
slouken@158
  2151
        CheckQUARTZ
slouken@0
  2152
        CheckMacGL
slouken@0
  2153
        CheckPTHREAD
slouken@0
  2154
        # Set up files for the main() stub
slouken@194
  2155
        COPY_ARCH_SRC(src/main, macosx, SDLMain.m)
slouken@194
  2156
        COPY_ARCH_SRC(src/main, macosx, SDLMain.h)
slouken@0
  2157
        # Set up files for the audio library
slouken@0
  2158
        if test x$enable_audio = xyes; then
slouken@0
  2159
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
slouken@0
  2160
            AUDIO_DRIVERS="$AUDIO_DRIVERS macrom/libaudio_macrom.la"
slouken@0
  2161
        fi
slouken@0
  2162
        # Set up files for the joystick library
slouken@0
  2163
        if test x$enable_joystick = xyes; then
slouken@172
  2164
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS darwin"
slouken@172
  2165
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS darwin/libjoystick_darwin.la"
slouken@196
  2166
            SDL_LIBS="$SDL_LIBS -framework IOKit"
slouken@0
  2167
        fi
slouken@0
  2168
        # Set up files for the cdrom library
slouken@0
  2169
        if test x$enable_cdrom = xyes; then
slouken@153
  2170
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@153
  2171
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@0
  2172
        fi
slouken@0
  2173
        # Set up files for the thread library
slouken@0
  2174
        if test x$enable_threads = xyes; then
slouken@0
  2175
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
slouken@0
  2176
            COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
slouken@0
  2177
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
slouken@0
  2178
            COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
slouken@94
  2179
            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
slouken@0
  2180
                COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
slouken@0
  2181
            else
slouken@0
  2182
                COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@0
  2183
            fi
slouken@0
  2184
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@0
  2185
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@0
  2186
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@0
  2187
        fi
slouken@0
  2188
        # Set up files for the timer library
slouken@0
  2189
        if test x$enable_timers = xyes; then
slouken@0
  2190
            COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
slouken@0
  2191
        fi
slouken@0
  2192
        # The MacOS X platform requires special setup
slouken@158
  2193
        SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework -F/System/Library/Frameworks/Cocoa.framework"
slouken@158
  2194
        SDL_LIBS="-lSDLmain $SDL_LIBS -framework Carbon -framework Cocoa"
slouken@0
  2195
        ;;
slouken@281
  2196
    *-*-mint*)
slouken@281
  2197
        ARCH=mint
slouken@281
  2198
        CheckDummyVideo
slouken@281
  2199
        CheckDiskAudio
slouken@281
  2200
        CheckAtariBiosEvent
slouken@281
  2201
        CheckAtariXbiosVideo
slouken@281
  2202
        CheckAtariGemVideo
slouken@281
  2203
        CheckPTH
slouken@281
  2204
        # Set up files for the main() stub
slouken@281
  2205
        COPY_ARCH_SRC(src/main, linux, SDL_main.c)
slouken@281
  2206
        # Set up files for the audio library
slouken@281
  2207
        if test x$enable_audio = xyes; then
slouken@281
  2208
            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
slouken@281
  2209
            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
slouken@281
  2210
        fi
slouken@281
  2211
        # Set up files for the joystick library
slouken@281
  2212
        # (No joystick support yet)
slouken@281
  2213
        if test x$enable_joystick = xyes; then
slouken@281
  2214
            JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
slouken@281
  2215
            JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
slouken@281
  2216
        fi
slouken@281
  2217
        # Set up files for the cdrom library
slouken@281
  2218
        if test x$enable_cdrom = xyes; then
slouken@281
  2219
            CDROM_SUBDIRS="$CDROM_SUBDIRS dummy"
slouken@281
  2220
            CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la"
slouken@281
  2221
        fi
slouken@281
  2222
        # Set up files for the thread library
slouken@281
  2223
        if test x$enable_threads = xyes; then
slouken@281
  2224
            if test x$enable_pth = xyes; then
slouken@281
  2225
                COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c)
slouken@281
  2226
                COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h)
slouken@281
  2227
            else
slouken@281
  2228
                COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c)
slouken@281
  2229
                COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h)
slouken@281
  2230
            fi
slouken@281
  2231
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c)
slouken@281
  2232
            COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h)
slouken@281
  2233
            COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
slouken@281
  2234
            COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
slouken@281
  2235
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c)
slouken@281
  2236
            COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
slouken@281
  2237
        fi
slouken@281
  2238
        # Set up files for the timer library
slouken@281
  2239
        if test x$enable_timers = xyes; then
slouken@281
  2240
            COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
slouken@281
  2241
            COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer.S)
slouken@281
  2242
            COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer_s.h)
slouken@281
  2243
        fi
slouken@281
  2244
        # MiNT does not define "unix"
slouken@281
  2245
        CFLAGS="$CFLAGS -Dunix"
slouken@281
  2246
        ;;
slouken@0
  2247
    *)
slouken@0
  2248
        AC_MSG_ERROR(Unsupported target:  Please add to configure.in)
slouken@0
  2249
        ;;
slouken@0
  2250
esac
slouken@0
  2251
AC_SUBST(ARCH)
slouken@0
  2252
slouken@0
  2253
# Set the conditional variables for this target
slouken@0
  2254
AM_CONDITIONAL(TARGET_LINUX, test $ARCH = linux)
slouken@0
  2255
AM_CONDITIONAL(TARGET_SOLARIS, test $ARCH = solaris)
slouken@0
  2256
AM_CONDITIONAL(TARGET_IRIX, test $ARCH = irix)
slouken@0
  2257
AM_CONDITIONAL(TARGET_BSDI, test $ARCH = bsdi)
slouken@0
  2258
AM_CONDITIONAL(TARGET_FREEBSD, test $ARCH = freebsd)
slouken@39
  2259
AM_CONDITIONAL(TARGET_NETBSD, test $ARCH = netbsd)
slouken@0
  2260
AM_CONDITIONAL(TARGET_OPENBSD, test $ARCH = openbsd)
slouken@0
  2261
AM_CONDITIONAL(TARGET_AIX, test $ARCH = aix)
slouken@0
  2262
AM_CONDITIONAL(TARGET_WIN32, test $ARCH = win32)
slouken@0
  2263
AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos)
slouken@0
  2264
AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos)
slouken@158
  2265
AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx)
slouken@279
  2266
AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx)
slouken@281
  2267
AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint)
slouken@0
  2268
slouken@0
  2269
# Set conditional variables for shared and static library selection.
slouken@0
  2270
# These are not used in any Makefile.am but in sdl-config.in.
slouken@0
  2271
AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = yes])
slouken@0
  2272
AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
slouken@0
  2273
slouken@0
  2274
# Set runtime shared library paths as needed
slouken@0
  2275
slouken@0
  2276
if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
slouken@0
  2277
  SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
slouken@0
  2278
fi
slouken@0
  2279
if test $ARCH = solaris; then
slouken@0
  2280
  SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
slouken@0
  2281
fi
slouken@257
  2282
if test $ARCH = openbsd -o $ARCH = bsdi; then
slouken@257
  2283
    SHARED_SYSTEM_LIBS="$SYSTEM_LIBS"
slouken@257
  2284
else
slouken@257
  2285
    SHARED_SYSTEM_LIBS=""
slouken@1
  2286
fi
slouken@257
  2287
STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
slouken@1
  2288
slouken@0
  2289
dnl Output the video drivers we use
slouken@0
  2290
if test x$enable_video = xtrue; then
slouken@0
  2291
    if test "$VIDEO_SUBDIRS" = ""; then
slouken@0
  2292
        AC_MSG_ERROR(*** No video drivers are enabled!)
slouken@0
  2293
    fi
slouken@0
  2294
fi
slouken@0
  2295
AC_SUBST(AUDIO_SUBDIRS)
slouken@0
  2296
AC_SUBST(AUDIO_DRIVERS)
slouken@0
  2297
AC_SUBST(VIDEO_SUBDIRS)
slouken@0
  2298
AC_SUBST(VIDEO_DRIVERS)
slouken@0
  2299
AC_SUBST(JOYSTICK_SUBDIRS)
slouken@0
  2300
AC_SUBST(JOYSTICK_DRIVERS)
slouken@153
  2301
AC_SUBST(CDROM_SUBDIRS)
slouken@153
  2302
AC_SUBST(CDROM_DRIVERS)
slouken@0
  2303
AC_SUBST(SDL_EXTRADIRS)
slouken@0
  2304
AC_SUBST(SDL_EXTRALIBS)
slouken@0
  2305
slouken@0
  2306
dnl Expand the cflags and libraries needed by apps using SDL
slouken@0
  2307
AC_SUBST(SDL_CFLAGS)
slouken@0
  2308
AC_SUBST(SDL_LIBS)
slouken@0
  2309
AC_SUBST(SDL_RLD_FLAGS)
slouken@0
  2310
slouken@257
  2311
dnl Expand the libraries needed for static and dynamic linking
slouken@257
  2312
AC_SUBST(STATIC_SYSTEM_LIBS)
slouken@257
  2313
AC_SUBST(SHARED_SYSTEM_LIBS)
slouken@261
  2314
AC_SUBST(SYSTEM_LIBS)
slouken@257
  2315
slouken@0
  2316
dnl Expand the include directories for building SDL
slouken@0
  2317
CFLAGS="$CFLAGS -I\$(top_srcdir)/include"
slouken@0
  2318
CFLAGS="$CFLAGS -I\$(top_srcdir)/include/SDL"
slouken@0
  2319
CFLAGS="$CFLAGS -I\$(top_srcdir)/src -I\$(top_srcdir)/src/$ARCH"
slouken@0
  2320
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/main"
slouken@0
  2321
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/audio"
slouken@0
  2322
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video"
slouken@292
  2323
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/XFree86/extensions"
slouken@0
  2324
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/events"
slouken@0
  2325
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/joystick"
slouken@0
  2326
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/cdrom"
slouken@0
  2327
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/thread"
slouken@0
  2328
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/timer"
slouken@0
  2329
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/endian"
slouken@0
  2330
CFLAGS="$CFLAGS -I\$(top_srcdir)/src/file"
slouken@0
  2331
CXXFLAGS="$CFLAGS"
slouken@0
  2332
slouken@158
  2333
slouken@158
  2334
# Check for darwin at the very end and set up the Objective C compiler
slouken@158
  2335
# We do this here so that we get the full CFLAGS into OBJCFLAGS
slouken@158
  2336
case "$target" in
slouken@158
  2337
    *-*-darwin*)
slouken@158
  2338
        OBJC="cc"
slouken@158
  2339
        OBJCFLAGS="$CFLAGS"
slouken@200
  2340
        OBJCDEPMODE="$CCDEPMODE"
slouken@158
  2341
        AC_SUBST(OBJC)
slouken@158
  2342
        AC_SUBST(OBJCFLAGS)
slouken@200
  2343
        AC_SUBST(OBJCDEPMODE)
slouken@158
  2344
        ;;
slouken@158
  2345
esac
slouken@158
  2346
slouken@0
  2347
# Finally create all the generated files
slouken@0
  2348
dnl Important: Any directory that you want to be in the distcheck should
slouken@0
  2349
dnl            have a file listed here, so that configure generates the
slouken@0
  2350
dnl            subdirectories on the build target.
slouken@0
  2351
AC_OUTPUT([
slouken@0
  2352
Makefile
slouken@0
  2353
docs/Makefile
slouken@0
  2354
docs/html/Makefile
slouken@0
  2355
docs/man3/Makefile
slouken@0
  2356
include/Makefile
slouken@0
  2357
src/Makefile
slouken@0
  2358
src/main/Makefile
slouken@168
  2359
src/main/macosx/Makefile
slouken@172
  2360
src/main/macosx/Info.plist
slouken@0
  2361
src/audio/Makefile
slouken@0
  2362
src/audio/alsa/Makefile
slouken@0
  2363
src/audio/arts/Makefile
slouken@0
  2364
src/audio/baudio/Makefile
slouken@0
  2365
src/audio/dma/Makefile
slouken@0
  2366
src/audio/dmedia/Makefile
slouken@0
  2367
src/audio/dsp/Makefile
slouken@0
  2368
src/audio/esd/Makefile
slouken@0
  2369
src/audio/macrom/Makefile
slouken@0
  2370
src/audio/nas/Makefile
slouken@0
  2371
src/audio/nto/Makefile
slouken@37
  2372
src/audio/openbsd/Makefile
slouken@0
  2373
src/audio/paudio/Makefile
slouken@0
  2374
src/audio/sun/Makefile
slouken@0
  2375
src/audio/ums/Makefile
slouken@0
  2376
src/audio/windib/Makefile
slouken@0
  2377
src/audio/windx5/Makefile
slouken@68
  2378
src/audio/disk/Makefile
slouken@0
  2379
src/video/Makefile
slouken@292
  2380
src/video/XFree86/Makefile
slouken@292
  2381
src/video/XFree86/extensions/Makefile
slouken@292
  2382
src/video/XFree86/Xinerama/Makefile
slouken@292
  2383
src/video/XFree86/Xv/Makefile
slouken@292
  2384
src/video/XFree86/Xxf86dga/Makefile
slouken@292
  2385
src/video/XFree86/Xxf86vm/Makefile
slouken@0
  2386
src/video/cybergfx/Makefile
slouken@0
  2387
src/video/x11/Makefile
slouken@0
  2388
src/video/dga/Makefile
slouken@30
  2389
src/video/nanox/Makefile
slouken@0
  2390
src/video/fbcon/Makefile
slouken@167
  2391
src/video/directfb/Makefile
slouken@70
  2392
src/video/ps2gs/Makefile
slouken@0
  2393
src/video/ggi/Makefile
slouken@0
  2394
src/video/maccommon/Makefile
slouken@0
  2395
src/video/macdsp/Makefile
slouken@0
  2396
src/video/macrom/Makefile
slouken@47
  2397
src/video/quartz/Makefile
slouken@0
  2398
src/video/svga/Makefile
slouken@75
  2399
src/video/vgl/Makefile
slouken@0
  2400
src/video/aalib/Makefile
slouken@0
  2401
src/video/wincommon/Makefile
slouken@0
  2402
src/video/windib/Makefile
slouken@0
  2403
src/video/windx5/Makefile
slouken@0
  2404
src/video/bwindow/Makefile
slouken@0
  2405
src/video/photon/Makefile
slouken@174
  2406
src/video/epoc/Makefile
slouken@1
  2407
src/video/dummy/Makefile
slouken@281
  2408
src/video/ataricommon/Makefile
slouken@281
  2409
src/video/xbios/Makefile
slouken@281
  2410
src/video/gem/Makefile
slouken@0
  2411
src/events/Makefile
slouken@0
  2412
src/joystick/Makefile
slouken@21
  2413
src/joystick/amigaos/Makefile
slouken@0
  2414
src/joystick/beos/Makefile
slouken@281
  2415
src/joystick/bsd/Makefile
slouken@172
  2416
src/joystick/darwin/Makefile
slouken@0
  2417
src/joystick/dummy/Makefile
slouken@0
  2418
src/joystick/linux/Makefile
slouken@0
  2419
src/joystick/macos/Makefile
slouken@0
  2420
src/joystick/win32/Makefile
slouken@0
  2421
src/cdrom/Makefile
slouken@153
  2422
src/cdrom/aix/Makefile
slouken@153
  2423
src/cdrom/beos/Makefile
slouken@153
  2424
src/cdrom/dummy/Makefile
slouken@178
  2425
src/cdrom/bsdi/Makefile
slouken@153
  2426
src/cdrom/freebsd/Makefile
slouken@153
  2427
src/cdrom/linux/Makefile
slouken@153
  2428
src/cdrom/macos/Makefile
slouken@153
  2429
src/cdrom/openbsd/Makefile
slouken@153
  2430
src/cdrom/qnx/Makefile
slouken@153
  2431
src/cdrom/win32/Makefile
slouken@0
  2432
src/thread/Makefile
slouken@0
  2433
src/timer/Makefile
slouken@0
  2434
src/endian/Makefile
slouken@0
  2435
src/file/Makefile
slouken@0
  2436
src/hermes/Makefile
slouken@0
  2437
sdl-config
slouken@0
  2438
SDL.spec
slouken@0
  2439
], [chmod +x sdl-config])