configure.in
author Sam Lantinga <slouken@libsdl.org>
Thu, 06 May 2004 15:55:06 +0000
changeset 886 05c551e5bc64
parent 884 20d3a599f601
child 935 f8d5ddc7aef1
permissions -rw-r--r--
Date: Sat, 24 Apr 2004 15:13:32 +0300
From: "Mike Gorchak"
Subject: SDL updates for the QNX6

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