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