configure.in
author Sam Lantinga <slouken@libsdl.org>
Wed, 10 Dec 2003 12:35:56 +0000
changeset 753 b14fdadd8311
parent 750 ce48d14ca5bf
child 754 623b453a3219
permissions -rw-r--r--
Date: Thu, 4 Dec 2003 07:48:40 +0200
From: "Mike Gorchak"
Subject: SDL/QNX6 new patch

Here in attachment my patch for the SDL/QNX6 again :) It contain non-crtitical/cosmetic fixes:

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