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